galpy.df.sphericaldf.sample

sphericaldf.sample(R=None, z=None, phi=None, n=1, return_orbit=True, rmin=0.0)[source]

Sample the DF

Parameters:
  • R (float, numpy.ndarray, Quantity, or None, optional) – If set, sample velocities at this radius. If array, sample velocities at these radii, ignoring n.

  • z (float, numpy.ndarray, Quantity, or None, optional) – If set, sample velocities at this height. If array, sample velocities at these heights, ignoring n.

  • phi (float, numpy.ndarray, Quantity, or None, optional) – If set, sample velocities at this azimuth. If array, sample velocities at these azimuths, ignoring n.

  • n (int, optional) – Number of samples to generate. Default is 1.

  • return_orbit (bool, optional) – If True, return an orbit.Orbit instance. If False, return a tuple of (R,vR,vT,z,vz,phi). Default is True.

  • rmin (float, Quantity, optional) – Minimum radius at which to sample. Default is 0.

Returns:

If return_orbit is True, an orbit.Orbit instance. Otherwise, a tuple of (R,vR,vT,z,vz,phi).

Return type:

orbit.Orbit instance or tuple

Notes

  • When specifying position, it is necessary to specify both R and z; if phi is not set in this case, it is sampled

  • 2020-07-22 - Written - Lane (UofT)