<p>The ATNF Pulsar Catalogue's galactic longitude and latitude are heliocentric,
but the origin of their rectangular coordinates is near the center of our galaxy.</p>

<p>The <a href="http://www.atnf.csiro.au/people/pulsar/psrcat/psrcat_help.html" rel="nofollow noreferrer">catalogue documentation</a>,
section 6. Distances, says:</p>

<blockquote>
  <p>The Galactocentric coordinate system (XX, YY, ZZ) is right-handed
  with the Sun at (0.0, 8.5 kpc, 0.0)
  and the ZZ axis directed toward the north Galactic pole.</p>
</blockquote>

<p>From a heliocentric point of view
<a href="https://en.wikipedia.org/wiki/Galactic_coordinate_system#Rectangular_coordinates" rel="nofollow noreferrer">(U, V, W)</a>
= (8.5 - YY, XX, ZZ).
Then $\tan{l} = V / U$ and $\tan{b} = W / \sqrt{U^2 + V^2}$
as you'd expect.</p>

CC BY-SA 3.0
2018-03-30T14:52:05.163Z
Aha, thank you! A few notes in case anyone runs into similar troubles:

1. my YY and XX column labels are swapped (oops).
2. This answer unconventionally maps yxz to uvw, more typically it is xyz to uvw
3. The last equation for `G_b` should be `tan(b) = 90 - W/sqrt(u^2+v^2)`
7yl4r
CC BY-SA 3.0
2018-03-29T18:47:17.953Z
2018-03-29T19:18:35.893Z
2018-03-29T19:18:35.893Z
Mike G
<p>I am trying to relate Galactic Latitude (b) and Longitude (l) (spherical coordinates) to galactic cartesian x,y,z coordinates in the ATNF pulsar catalog. </p>

<p><a href="http://www.atnf.csiro.au/people/pulsar/psrcat/proc_form.php?version=1.58&amp;Name=Name&amp;GL=GL&amp;GB=GB&amp;ZZ=ZZ&amp;XX=XX&amp;YY=YY&amp;startUserDefined=true&amp;c1_val=&amp;c2_val=&amp;c3_val=&amp;c4_val=&amp;sort_attr=jname&amp;sort_order=asc&amp;condition=&amp;pulsar_names=&amp;ephemeris=short&amp;coords_unit=raj%2Fdecj&amp;radius=&amp;coords_1=&amp;coords_2=&amp;style=Long%20with%20last%20digit%20error&amp;no_value=*&amp;fsize=3&amp;x_axis=&amp;x_scale=linear&amp;y_axis=&amp;y_scale=linear&amp;state=query&amp;table_bottom.x=43&amp;table_bottom.y=24" rel="nofollow noreferrer">This query</a> shows some sample data with <code>G_l</code>, <code>G_b</code>, <code>XX</code>, <code>YY</code>, and <code>ZZ</code>; excerpt:</p>

<pre><code>------------------------------------------------------------------
#     NAME                     Gl     Gb     ZZ     XX     YY
                               (deg)  (deg)  (kpc)  (kpc)  (kpc)
------------------------------------------------------------------
1     J0002+6216    cwp+17     117.33 -0.07  -0.00  0.00   8.50
2     J0006+1834    cnt96      108.17 -42.98 -0.59  0.60   8.70
3     J0007+7303    aaa+09c    119.66 10.46  0.25   1.20   9.18
</code></pre>

<p>The description of the variables from the <a href="http://www.atnf.csiro.au/research/pulsar/psrcat/psrcat_help.html?type=normal&amp;highlight=gl#gl" rel="nofollow noreferrer">ATNF documentation</a> are as follows:</p>

<pre><code>GL:          Galactic longitude (degrees) 
GB:          Galactic latitude (degrees) 
[...]
ZZ:          Distance from the Galactic plane, based on Dist
XX:          X-Distance in X-Y-Z Galactic coordinate system (kpc)
YY:          Y-Distance in X-Y-Z Galactic coordinate system (kpc)
</code></pre>

<p>My understanding is that these variables should be related by the following equations:</p>

<ul>
<li><code>tan(G_L) = YY/XX</code></li>
<li><code>tan(G_b) = XX/ZZ</code></li>
</ul>

<p>However, when I test this assumption my calculated values are very different:</p>

<p><a href="https://i.sstatic.net/pYo4Q.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pYo4Q.png" alt="test-spreadsheet"></a></p>

<p>I have tried exploring the possibility that the x,y,z coordinate system may be oriented differently than I expect, but I can find no orientation that yields similar results for <code>G_l</code> or <code>G_b</code>:</p>

<p><a href="https://i.sstatic.net/bxDtO.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bxDtO.png" alt="trig-exaustive-search"></a></p>

<p>Where could I have gone wrong? I feel like I am losing my mind not being able to convert these with simple trig.</p>

<coordinate><data-analysis><pulsar>
Why are the spherical and cartesian galactic coordinates in the ATNF Pulsar Catalogue different?
7yl4r
# Why are the spherical and cartesian galactic coordinates in the ATNF Pulsar Catalogue different?

(Asked by: username_0 on 2018-03-29)

I am trying to relate Galactic Latitude (b) and Longitude (l) (spherical coordinates) to galactic cartesian x,y,z coordinates in the ATNF pulsar catalog.

[This query](http://www.atnf.csiro.au/people/pulsar/psrcat/proc_form.php?version=1.58&Name=Name&GL=GL&GB=GB&ZZ=ZZ&XX=XX&YY=YY&startUserDefined=true&c1_val=&c2_val=&c3_val=&c4_val=&sort_attr=jname&sort_order=asc&condition=&pulsar_names=&ephemeris=short&coords_unit=raj%2Fdecj&radius=&coords_1=&coords_2=&style=Long%20with%20last%20digit%20error&no_value=*&fsize=3&x_axis=&x_scale=linear&y_axis=&y_scale=linear&state=query&table_bottom.x=43&table_bottom.y=24) shows some sample data with `G_l`, `G_b`, `XX`, `YY`, and `ZZ`; excerpt:

```
------------------------------------------------------------------
#     NAME                     Gl     Gb     ZZ     XX     YY
                               (deg)  (deg)  (kpc)  (kpc)  (kpc)
------------------------------------------------------------------
1     J0002+6216    cwp+17     117.33 -0.07  -0.00  0.00   8.50
2     J0006+1834    cnt96      108.17 -42.98 -0.59  0.60   8.70
3     J0007+7303    aaa+09c    119.66 10.46  0.25   1.20   9.18

```

The description of the variables from the [ATNF documentation](http://www.atnf.csiro.au/research/pulsar/psrcat/psrcat_help.html?type=normal&highlight=gl#gl) are as follows:

```
GL:          Galactic longitude (degrees) 
GB:          Galactic latitude (degrees) 
[...]
ZZ:          Distance from the Galactic plane, based on Dist
XX:          X-Distance in X-Y-Z Galactic coordinate system (kpc)
YY:          Y-Distance in X-Y-Z Galactic coordinate system (kpc)

```

My understanding is that these variables should be related by the following equations:

* `tan(G_L) = YY/XX`
* `tan(G_b) = XX/ZZ`

However, when I test this assumption my calculated values are very different:

[![test-spreadsheet](https://i.sstatic.net/pYo4Q.png)](https://i.sstatic.net/pYo4Q.png)

I have tried exploring the possibility that the x,y,z coordinate system may be oriented differently than I expect, but I can find no orientation that yields similar results for `G_l` or `G_b`:

[![trig-exaustive-search](https://i.sstatic.net/bxDtO.png)](https://i.sstatic.net/bxDtO.png)

Where could I have gone wrong? I feel like I am losing my mind not being able to convert these with simple trig.

**Tags:** coordinate, data-analysis, pulsar


---

## 1 answers

### Answer by username_1 on 2018-03-29. Score: 2 | Accepted answer

The ATNF Pulsar Catalogue's galactic longitude and latitude are heliocentric,
but the origin of their rectangular coordinates is near the center of our galaxy.

The [catalogue documentation](http://www.atnf.csiro.au/people/pulsar/psrcat/psrcat_help.html),
section 6. Distances, says:

> The Galactocentric coordinate system (XX, YY, ZZ) is right-handed
> with the Sun at (0.0, 8.5 kpc, 0.0)
> and the ZZ axis directed toward the north Galactic pole.

From a heliocentric point of view
[(U, V, W)](https://en.wikipedia.org/wiki/Galactic_coordinate_system#Rectangular_coordinates)
= (8.5 - YY, XX, ZZ).
Then $\tan{l} = V / U$ and $\tan{b} = W / \sqrt{U^2 + V^2}$
as you'd expect.

> **Comments:**
> **username_0**: Aha, thank you! A few notes in case anyone runs into similar troubles:  1. my YY and XX column labels are swapped (oops). 2. This answer unconventionally maps yxz to uvw, more typically it is xyz to uvw 3. The last equation for `G_b` should be `tan(b) = 90 - W/sqrt(u^2+v^2)`  

---

