<p>The two frames have different axes.
In the galactic frame, the Z axis is perpendicular to the galactic equator.
<a href="https://en.wikipedia.org/wiki/International_Celestial_Reference_System_and_its_realizations" rel="noreferrer">ICRS</a> and its predecessor FK5 are equatorial, with Z axis perpendicular to Earth's equator as of 2000-01-01.
The angle between the different Z axes is ~63°.
The <a href="https://en.wikipedia.org/wiki/Astronomical_coordinate_systems#Equatorial_%E2%86%94_galactic" rel="noreferrer">transformation</a> from one frame to the other is a 3D rotation.</p>
<p>Here is a Stellarium screenshot showing the J2000 equatorial grid in blue and the galactic coordinate grid in brown.
<img src="https://i.sstatic.net/sFlXW.png" alt="screenshot of equatorial and galactic coordinate grids" /></p>

CC BY-SA 4.0
2024-01-11T17:52:00.210Z
2024-01-11T17:52:00.210Z
Mike G
<p>I'm having trouble understanding why these two approaches have different results:</p>
<pre><code>from astropy import units as u
from astropy.coordinates import SkyCoord

lon, lat, dist_pc = 123.7, -1.4, 1789

# Starting from galactic coordinates
c = SkyCoord(l=lon*u.degree, b=lat*u.degree, distance=dist_pc*u.pc, frame='galactic')
# To cylindrical
c.representation_type = 'cylindrical'
print(c)

# From galactic
c = SkyCoord(l=lon*u.degree, b=lat*u.degree, frame='galactic')
# To (ra, dec)
ra, dec = c.fk5.ra.deg, c.fk5.dec.deg
c = SkyCoord(ra=ra*u.degree, dec=dec*u.degree, distance=dist_pc*u.pc)
# To cylindrical
c.representation_type = 'cylindrical'
print(c)
</code></pre>
<p>where the results are:</p>
<pre><code>&lt;SkyCoord (Galactic): (rho, phi, z) in (pc, deg, pc)
    (1788.46596522, 123.7, -43.70916672)&gt;

&lt;SkyCoord (ICRS): (rho, phi, z) in (pc, deg, pc)
    (854.67518315, 14.46690657, 1571.63969513)&gt;
</code></pre>
<p>I understand the <code>Galactic</code> results but I can't visualize what the <code>ICRS</code> results represent.</p>

<astropy><coordinate-systems>
Visualizing difference in astropy's cylindrical representation
Gabriel
# Visualizing difference in astropy's cylindrical representation

(Asked by: username_0 on 2024-01-11)

I'm having trouble understanding why these two approaches have different results:
from astropy import units as u
from astropy.coordinates import SkyCoord

lon, lat, dist_pc = 123.7, -1.4, 1789

# Starting from galactic coordinates
c = SkyCoord(l=lon*u.degree, b=lat*u.degree, distance=dist_pc*u.pc, frame='galactic')
# To cylindrical
c.representation_type = 'cylindrical'
print(c)

# From galactic
c = SkyCoord(l=lon*u.degree, b=lat*u.degree, frame='galactic')
# To (ra, dec)
ra, dec = c.fk5.ra.deg, c.fk5.dec.deg
c = SkyCoord(ra=ra*u.degree, dec=dec*u.degree, distance=dist_pc*u.pc)
# To cylindrical
c.representation_type = 'cylindrical'
print(c)

where the results are:




I understand the Galactic results but I can't visualize what the ICRS results represent.

**Tags:** astropy, coordinate-systems

---

## 1 answers

### Answer by username_1 on 2024-01-11. Score: 7 | Accepted answer

The two frames have different axes.
In the galactic frame, the Z axis is perpendicular to the galactic equator.
[ICRS](https://en.wikipedia.org/wiki/International_Celestial_Reference_System_and_its_realizations) and its predecessor FK5 are equatorial, with Z axis perpendicular to Earth's equator as of 2000-01-01.
The angle between the different Z axes is ~63°.
The [transformation](https://en.wikipedia.org/wiki/Astronomical_coordinate_systems#Equatorial_%E2%86%94_galactic) from one frame to the other is a 3D rotation.

Here is a Stellarium screenshot showing the J2000 equatorial grid in blue and the galactic coordinate grid in brown.
![screenshot of equatorial and galactic coordinate grids](https://i.sstatic.net/sFlXW.png)


---

