<p>The transformation to <span class="math-container">$x,y,z$</span> coordinates, starting from the RA, Dec and a distance (as given in the HYG catalogue) is a simple trigonometric exercise, since the <span class="math-container">$x,y,z$</span> (in this case) is referred to a coordinate system aligned with the equatorial coordinate system.</p>

<p><span class="math-container">$$x = d \cos({\rm RA}) \cos({\rm DEC}),$$</span>
<span class="math-container">$$y = d \sin({\rm RA}) \cos({\rm DEC}),$$</span>
<span class="math-container">$$z = d \sin({\rm DEC}),$$</span>
where <span class="math-container">$d$</span> is the distance. How that distance has been obtained is not clear from the README file accompanying the database. It may have been by (incorrectly) inverting Hipparcos parallaxes.</p>

<p>The dso.csv appears to be a catalogue of deep sky objects. There is no information in the catalogue itself which allows you to calculate or estimate a distance.</p>

<p>You could try cross-referencing the catalogue against the  NASA/IPAC Extragalactic Database (NED). <a href="https://ned.ipac.caltech.edu/" rel="nofollow noreferrer">https://ned.ipac.caltech.edu/</a>
If the recession velocity there is bigger than about 1000 km/s, then you will get a rough distance by using Hubble's law
<span class="math-container">$$ d = v/H_0$$</span>
 with <span class="math-container">$H_0 \sim 70$</span> km/s per Mpc (or whatever your preferred value is). If the recesson velocity is smaller than this then the object is too close for Hubble's law to be valid.</p>

<p>e.g. The first line inthe catalogue appears to be a galaxy known as IC 5370, that has a recession velocity of 10372.00 km/s (no error bar given and I doubt any more than 4 significant figures is warranted and in any case <span class="math-container">$H_0$</span> is not known accurately to more than 2 significant figures), which gives an approximate distance of 150 Mpc.</p>

CC BY-SA 4.0
2020-04-25T10:44:06.240Z
2020-04-25T12:41:34.047Z
2020-04-25T12:41:34.047Z
ProfRob
<p>The HYG star database can be found <a href="https://github.com/astronexus/HYG-Database" rel="nofollow noreferrer">here</a></p>

<p>From the hygdata_v3.csv file, how are the cartesian (x,y,z) coordinates calculated? (Is there a mathematical formula for this?)</p>

<p>And in the dso.csv file, there aren't any x,y,z coordinated. How can I calculate that?</p>

CC BY-SA 4.0
2020-04-24T16:25:39.687Z
@barrycarter, yes but doesn't the cartesian coordinates in the database take into account the parallax angles?
SidS
CC BY-SA 4.0
2020-04-24T16:55:06.773Z
Parallax angle is just a measure for distance, hence distance is given often in parsec
planetmaker
CC BY-SA 4.0
2020-04-24T18:22:27.887Z
What is your question? How the distance is found or how X,y,z is found?
ProfRob
CC BY-SA 4.0
2020-04-25T08:26:25.247Z
@RobJeffries - I would like to know how x,y,z, is found for the hygdata csv file and how the distance is found from the dso csv file
SidS
CC BY-SA 4.0
2020-04-26T11:16:48.797Z
@RobJeffries it is the dataset containing deep sky objects.
SidS
<star><deep-sky-observing><star-catalogues>
How is the distance of a star from Earth calculated in the HYG star database
SidS
# How is the distance of a star from Earth calculated in the HYG star database

(Asked by: username_0 on 2020-04-24)

The HYG star database can be found [here](https://github.com/astronexus/HYG-Database)

From the hygdata\_v3.csv file, how are the cartesian (x,y,z) coordinates calculated? (Is there a mathematical formula for this?)

And in the dso.csv file, there aren't any x,y,z coordinated. How can I calculate that?

**Tags:** star, deep-sky-observing, star-catalogues

> **Comments:**
> **username_0**: @barrycarter, yes but doesn't the cartesian coordinates in the database take into account the parallax angles?  
> **username_1**: Parallax angle is just a measure for distance, hence distance is given often in parsec  
> **username_2**: What is your question? How the distance is found or how X,y,z is found?  
> **username_0**: @RobJeffries - I would like to know how x,y,z, is found for the hygdata csv file and how the distance is found from the dso csv file  
> **username_0**: @RobJeffries it is the dataset containing deep sky objects.  

---

## 1 answers

### Answer by username_2 on 2020-04-25. Score: 2

The transformation to $x,y,z$ coordinates, starting from the RA, Dec and a distance (as given in the HYG catalogue) is a simple trigonometric exercise, since the $x,y,z$ (in this case) is referred to a coordinate system aligned with the equatorial coordinate system.

$$x = d \cos({\rm RA}) \cos({\rm DEC}),$$
$$y = d \sin({\rm RA}) \cos({\rm DEC}),$$
$$z = d \sin({\rm DEC}),$$
where $d$ is the distance. How that distance has been obtained is not clear from the README file accompanying the database. It may have been by (incorrectly) inverting Hipparcos parallaxes.

The dso.csv appears to be a catalogue of deep sky objects. There is no information in the catalogue itself which allows you to calculate or estimate a distance.

You could try cross-referencing the catalogue against the NASA/IPAC Extragalactic Database (NED). <https://ned.ipac.caltech.edu/>
If the recession velocity there is bigger than about 1000 km/s, then you will get a rough distance by using Hubble's law
$$ d = v/H\_0$$
with $H\_0 \sim 70$ km/s per Mpc (or whatever your preferred value is). If the recesson velocity is smaller than this then the object is too close for Hubble's law to be valid.

e.g. The first line inthe catalogue appears to be a galaxy known as IC 5370, that has a recession velocity of 10372.00 km/s (no error bar given and I doubt any more than 4 significant figures is warranted and in any case $H\_0$ is not known accurately to more than 2 significant figures), which gives an approximate distance of 150 Mpc.


---

