vgal_to_hel¶
-
gala.coordinates.
vgal_to_hel
(coordinate, vxyz, vcirc=<Quantity 220.0 km / s>, vlsr=<Quantity [ 10., 5.25, 7.17] km / s>, galactocentric_frame=None)[source]¶ Convert a Galactocentric, cartesian velocity to a Heliocentric velocity in spherical coordinates (e.g., proper motion and radial velocity).
The frame of the input coordinate determines the output frame of the proper motions. For example, if the input coordinate is in the ICRS frame, the proper motions returned will be \((\mu_\alpha\cos\delta,\mu_\delta)\). This function also handles array inputs (see examples below).
Parameters: coordinate :
SkyCoord
,BaseCoordinateFrame
This is most commonly a
SkyCoord
object, but alternatively, it can be any coordinate frame object that is transformable to the Galactocentric frame.vxyz :
Quantity
, iterablevcirc :
Quantity
(optional)Circular velocity of the Sun.
vlsr :
Quantity
(optional)Velocity of the Sun relative to the local standard of rest (LSR).
galactocentric_frame :
Galactocentric
(optional)An instantiated
Galactocentric
frame object with custom parameters for the Galactocentric coordinates. For example, if you want to set your own position of the Galactic center, you can pass in a frame with customgalcen_ra
andgalcen_dec
.Returns: pmv : tuple
A tuple containing the proper motions (in Galactic coordinates) and radial velocity, all as
Quantity
objects.Examples
>>> import astropy.units as u >>> import astropy.coordinates as coord >>> c = coord.Galactocentric(x=15.*u.kpc, y=13.*u.kpc, z=2.*u.kpc) >>> vxyz = [-115., 100., 95.]*u.km/u.s >>> icrs = c.transform_to(coord.ICRS) >>> vgal_to_hel(icrs, vxyz) (<Quantity -0.876885123328934 mas / yr>, <Quantity 0.024501209459030334 mas / yr>, <Quantity -163.24449462243052 km / s>)
>>> c = coord.Galactocentric([[15.,11.],[13,21.],[2.,-7]]*u.kpc) >>> vxyz = [[-115.,11.], [100.,-21.], [95.,103]]*u.km/u.s >>> icrs = c.transform_to(coord.ICRS) >>> vgal_to_hel(icrs, vxyz) (<Quantity [-0.87688512,-0.91157482] mas / yr>, <Quantity [ 0.02450121,-0.86124895] mas / yr>, <Quantity [-163.24449462,-198.31241148] km / s>)