StreamTrack¶
- class galpy.df.StreamTrack(tp_grid, track_xyz, track_vxvyvz, cov_xyz=None, custom_sky_transform=None, parameter_kind='time', ro=None, vo=None, zo=None, solarmotion=None)[source]¶
Smooth phase-space track for a single arm of a stream.
A StreamTrack holds a smooth mean curve (and optional covariance) in galactocentric Cartesian phase space, parameterized by an affine curve parameter
tp. The class is a pure precomputed-track container — accessors evaluate the stored splines andcov(basis=...)transforms the stored covariance into other bases via analytical Jacobians. The fitting pipeline (closest-point + offset smoothing) is provided by thefrom_particles()classmethod.The semantics of
tpare set at construction viaparameter_kind:"time"(default): astropyQuantityinputs to accessors are parsed viaconversion.parse_time. Used by the streamspraydf pipeline, wheretp=0is the progenitor today,tp>0is future (leading arm),tp<0is past (trailing arm)."angle": parsed viaconversion.parse_angle. The natural choice for streamdf-style tracks indexed by an angle along the stream.None: pass-through; useful for any other custom curve parameter.
Accessors and
cov()returnNaNfortpvalues outside the track’s valid range (rather than silent cubic-spline extrapolation). For an arraytp, only the offending entries are NaN.- particles¶
Present-day phase space
(R, vR, vT, z, vz, phi)of the particles the track was fit to, in the layout thatfrom_particles()accepts andstreamspraydf.streamTrackreturns from itsparticles=knob. Available only on tracks built viafrom_particles()(thestreamspraydf.streamTrackpath); absent on tracks constructed directly from precomputed splines via__init__(). Useful for re-fitting at different smoothing / iteration settings without re-sampling the spray DF.- Type:
ndarray of shape (6, N), or absent
- __init__(tp_grid, track_xyz, track_vxvyvz, cov_xyz=None, custom_sky_transform=None, parameter_kind='time', ro=None, vo=None, zo=None, solarmotion=None)[source]¶
Build a StreamTrack from a precomputed smooth track.
- Parameters:
tp_grid (array, shape (N,)) – Affine curve parameter samples. Must be strictly monotonic.
track_xyz (array, shape (N, 3)) – Galactocentric Cartesian positions
(x, y, z)ontp_grid, in galpy internal length units.track_vxvyvz (array, shape (N, 3)) – Galactocentric Cartesian velocities
(vx, vy, vz)ontp_grid, in galpy internal velocity units.cov_xyz (array, shape (N, 6, 6), optional) – Galactocentric Cartesian covariance
(x, y, z, vx, vy, vz)ontp_grid(internal units). Required forcov()and for thespreadband inplot().None(default) ⇒ no covariance support.custom_sky_transform (array, shape (3, 3), optional) – Rotation from equatorial to a custom
(phi1, phi2)sky frame. Enables thephi1/phi2/pmphi1/pmphi2accessors andcov(basis="customsky").parameter_kind ({"time", "angle", None}, optional) – How astropy
Quantityinputs to accessors are interpreted (see class docstring). Default"time".ro (float or Quantity, optional) – Distance scale (kpc). When omitted, falls back to the
normalization.roconfig value and physical-units output is off by default (_roSet=False); when set explicitly, physical-units output is on by default. MirrorsOrbit.vo (float or Quantity, optional) – Circular velocity scale (km/s). Same semantics as
ro.zo (float or Quantity, optional) – Sun’s height above the midplane (kpc). Default None.
solarmotion (str, numpy.ndarray or Quantity, optional) –
'hogg','dehnen','schoenrich', or[-U, V, W]in km/s. Default None.