galpy.df.streamspraydf.sample

streamspraydf.sample(n, return_orbit=True, returndt=False, integrate=True, tail=None)[source]

Sample from the DF

Parameters:
  • n (int) – Number of points to return. When tail='both', n is the total number of points, split equally between the leading and trailing tails.

  • return_orbit (bool, optional) – If True, the output phase-space positions is an orbit.Orbit object. If False, the output is (R,vR,vT,z,vz,phi). Default is True.

  • returndt (bool, optional) – If True, also return the time since the star was stripped. Default is False.

  • integrate (bool, optional) – If True, integrate the orbits to the present time. If False, return positions at stripping (probably want to combine with returndt=True then to make sense of them!). Default is True.

  • tail (str, optional) – 'leading', 'trailing', or 'both' to override the default set at class initialization. Default is None (use the value of tail= from __init__). The progenitor is integrated identically for either arm, so any override value works regardless of the initialization choice.

Returns:

Orbit instance or (R,vR,vT,z,vz,phi) of points on the stream in 6,N array (set of 6 Quantities when physical output is on); optionally the time is included as well. When tail='both', the leading-tail points come first, followed by the trailing-tail points. The ro/vo unit-conversion parameters and the zo/solarmotion parameters as well as whether physical outputs are on, match the settings of the progenitor Orbit given to the class initialization

Return type:

Orbit, numpy.ndarray, or tuple

Notes

  • 2018-07-31 - Written - Bovy (UofT)

  • 2022-05-18 - Made output Orbit ro/vo/zo/solarmotion/roSet/voSet match that of the progenitor orbit - Bovy (UofT)

  • 2024-08-11 - Include the progenitor’s potential - Yingtian Chen (Umich)

  • 2026-04-28 - Added tail keyword override to match streamTrack - Bovy (UofT)