pynbody.plot.profile.rotation_curve#
- pynbody.plot.profile.rotation_curve(sim, center=True, r_units='kpc', v_units='km s^-1', nbins=50, bin_spacing='log', quick=False, rmin=None, rmax=None, parts=False, **kwargs)[source]#
Generate and plot a rotation curve.
This routine centres and aligns the disk into the x-y plane, then uses the potential in that plane to generate and plot a rotation curve.
The transformation of the simulation is then reverted to its original state.
Changed in version 2.0: The transformation of the simulation is now reverted when the routine exits. Previously, the transformation was left in place.
The clear, axes, legend, filename and yrange keywords have been removed for consistency with the rest of the plotting routines. Use the matplotlib functions directly to save the figure or modify the axes.
- Parameters:
sim (pynbody.snapshot.SimSnap) – The simulation snapshot to be used.
center (bool, optional) – If True (default), the simulation is centered and rotated so that the disk is in the x-y plane. If False, the simulation is assumed to be pre-centred and already aligned.
quick (bool, optional) – If True, the rotation curve is calculated using a spherical approximation to the circular velocity. If False (default), the rotation curve is calculated using 3D forces.
bin_spacing (str, optional) – The type of bin spacing to use in the profile. See
Profilefor details.rmin (float, optional) – The minimum radius to use in the profile. Default is the minimum radius in the simulation.
rmax (float, optional) – The maximum radius to use in the profile. Default is the maximum radius in the simulation.
nbins (int, optional) – The number of bins to use in the profile. Default is 50.
r_units (str, optional) – The units in which to plot the radial axis. Default is ‘kpc’.
v_units (str, optional) – The units in which to plot the velocity axis. Default is ‘km s^-1’.
parts (bool, optional) – If True, the rotation curve is calculated and plotted for each particle type separately. Default is False.
min (float, optional) – Deprecated. Use rmin instead.
max (float, optional) – Deprecated. Use rmax instead.
- Returns:
r (pynbody.array.SimArray) – The radial bins used in the profile.
v (pynbody.array.SimArray) – The circular velocity profile