Velocities in spherical coordinates
See original GitHub issueHi, I’m converting some positions and velocities from ICRS to Galactocentric, and then turning that into a spherical representation. The velocities are given as angular velocities, which is a little strange since I would have expected them in km/s.
c = coord.SkyCoord(
ra = ra * u.deg,
dec = dec * u.deg,
pm_ra_cosdec = pmracosdec * u.mas/u.yr,
pm_dec = pmdec * u.mas / u.yr,
radial_velocity = vrad * u.km / u.s,
distance = dist * u.kpc,
frame = 'icrs',
)
cg = c.transform_to(coord.Galactocentric())
cgs = cg.represent_as('spherical')
diffs = cgs.differentials['s']
diffs
<SphericalDifferential (d_lon, d_lat, d_distance) in (mas / yr, mas / yr, kpc mas / (rad yr))
(-0.17801241, -0.06221044, -12.62912254)>
How can I get these in km/s? For d_distance
I can do
cgs.differentials['s'].d_distance.to(u.km/u.s)
but for d_lon
and d_lat
I can’t do the conversion, even when I multiply by the distance:
(cgs.differentials['s'].d_lon * dist * u.kpc).to(u.km/u.s)
gives the following error:
UnitConversionError: 'kpc mas / yr' and 'km / s' (speed) are not convertible
Thanks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Spherical coordinates - Dynamics
The spherical coordinate system extends polar coordinates into 3D by using an ... the spherical basis vectors to rotate with the following angular...
Read more >3.4: Velocity and Acceleration Components - Physics LibreTexts
In figure III.9, P is a point moving along a curve such that its spherical coordinates are changing ...
Read more >How do you find velocity in spherical coordinates? - Quora
Vx, Vy, and Vz be the x,y, and z components of the velocity V in Cartesian co-ordinates i.e. V= iVx + jVy +...
Read more >Spherical coordinate system - Wikipedia
Spherical coordinates (r, θ, φ) as commonly used in physics (ISO 80000-2:2019 convention): radial distance r (distance to origin), polar angle θ (theta)...
Read more >Conversion of cartesian position and velocity to spherical ...
In spherical coordinates the velocity is: →v · However, the velocity vector is the same vector wether you write it using the spherical ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Coming back to this because of velocity conversion headaches the students are facing at our Galactic Dynamics summer school — we should really just implement your proposed solution @mhvk (and same for
PhysicsSpherical
,Cylindrical
, etc.)!Sounds good! Mostly just needs agreement on the name! Also for the attributes:
v_ra
,v_dec
,radial_velocity
, I guess?