<p>Obtain from the publisher Willmann-Bell the book ''Astronomical Algorithms'' by Jean Meeus. If obtaining elsewhere, be sure to obtain the 2nd ed. with corrections as of August 10, 2009. The equations you want are in Chapter 13, "Transformations of Coordinates".</p>

<p>Some variables must be defined:</p>

<p>$\alpha$ = right ascension, if obtained from formula it is in radians<br>
$\delta$ = declination, positive north, negative south<br>
$h$ = altitude, positive above the horizon, negative below horizon<br>
$A$ = azimuth, measured westward from the South, other sources often measure from the North<br>
$\psi$ = observer's latitude<br>
$H$ = local hour angle<br>
$\theta$ = local sidereal time</p>

<p>The first step is to transform horizon coordinates (azimuth and altitude) to equatorial coordinates (local hour angle and declination).</p>

<p>$$
\tan H  = \frac{\sin A}{\cos A \sin \psi + \tan h  \cos \psi}\\
\sin \delta  = \sin \psi  \sin h  - \cos \psi  \cos h  \cos A
$$</p>

<p>Then the local hour angle H is transformed to right ascension $\alpha$:</p>

<p>$$
\alpha = \theta - H
$$</p>

CC BY-SA 3.0
2015-09-16T10:42:55.540Z
Thank you for your answers. I'm not sure how the type of the mount affect the final results. Yes, the telescope is on alt-az mount, but I don't need for now to track the movement of celestial objects, only to give as much precise position as possible. I assume that from sensor readings I can calculate altitude and azimuth, from yaw and pitch, but I'm not sure if I need roll in the calculations.
yode
CC BY-SA 3.0
2015-09-16T17:04:59.627Z
I think you're right, no need for roll in the calculations. And since the sensor is on the telescope, not the mount, I was probably wrong about needing to do anything differently for an equatorial mount.
Gerard Ashton
CC BY-SA 3.0
2015-09-15T14:35:37.083Z
2015-09-15T14:35:37.083Z
Gerard Ashton
<p>I have 9DOF sensor (accelerometer, gyroscope, and magnetometer) that gives orientation via Euler angles (yaw, pitch, roll). Along with GPS data (latitude, longitude, elevation, time) this is passed to a PC application that has to calculate Dec and RA of a target (e.g. star). Sensor and GPS receiver are mounted on a telescope, so it should give the celestial coordinates of a star. The problem is that I don't know how to get Dec and RA from those data. I would very much appreciate a detail explanation of how I could get this.</p>

CC BY-SA 3.0
2015-09-15T16:08:20.270Z
It makes a big difference whether the telescope (and hence the sensor) is on an equatorial mount or an altitude-azimuth mount. Which is it? My answer below presumes it is an altitude-azimuth mount.
Gerard Ashton
CC BY-SA 4.0
2023-02-03T02:32:48.990Z
I found this question and your other one on hour angle - it occurred to me while trying to use my ancient alt/az refractor to look for comet C/2022 E3 (ZTF), building a scope-mounted sensor to tell me where I'm pointing would help. I suspect your inquiry was to create a similar device/system. Did you ever do so, and do you have recommendations on how to (or how not to!) do so?
Mark O
CC BY-SA 4.0
2023-02-04T09:08:55.293Z
@MarkO Yes I did, but unfortunately, for precise guidance and tracking you need motors and professional applications. The sensor that I was using was giving enormous error in measurements, so you need some expensive gear, I’m afraid.
yode
<star><telescope><observational-astronomy><declination>
Calculate Dec and RA of a star from Euler angles and GPS data
yode
# Calculate Dec and RA of a star from Euler angles and GPS data

(Asked by: username_0 on 2015-09-15)

I have 9DOF sensor (accelerometer, gyroscope, and magnetometer) that gives orientation via Euler angles (yaw, pitch, roll). Along with GPS data (latitude, longitude, elevation, time) this is passed to a PC application that has to calculate Dec and RA of a target (e.g. star). Sensor and GPS receiver are mounted on a telescope, so it should give the celestial coordinates of a star. The problem is that I don't know how to get Dec and RA from those data. I would very much appreciate a detail explanation of how I could get this.

**Tags:** star, telescope, observational-astronomy, declination
> **Comments:**
> **username_1**: It makes a big difference whether the telescope (and hence the sensor) is on an equatorial mount or an altitude-azimuth mount. Which is it? My answer below presumes it is an altitude-azimuth mount.  
> **username_2**: I found this question and your other one on hour angle - it occurred to me while trying to use my ancient alt/az refractor to look for comet C/2022 E3 (ZTF), building a scope-mounted sensor to tell me where I'm pointing would help. I suspect your inquiry was to create a similar device/system. Did you ever do so, and do you have recommendations on how to (or how not to!) do so?  
> **username_0**: @MarkO Yes I did, but unfortunately, for precise guidance and tracking you need motors and professional applications. The sensor that I was using was giving enormous error in measurements, so you need some expensive gear, I’m afraid.  

---

## 1 answers

### Answer by username_1 on 2015-09-15. Score: 1 | Accepted answer

Obtain from the publisher Willmann-Bell the book ''Astronomical Algorithms'' by Jean Meeus. If obtaining elsewhere, be sure to obtain the 2nd ed. with corrections as of August 10, 2009. The equations you want are in Chapter 13, "Transformations of Coordinates".

Some variables must be defined:

$\alpha$ = right ascension, if obtained from formula it is in radians  
$\delta$ = declination, positive north, negative south  
$h$ = altitude, positive above the horizon, negative below horizon  
$A$ = azimuth, measured westward from the South, other sources often measure from the North  
$\psi$ = observer's latitude  
$H$ = local hour angle  
$\theta$ = local sidereal time

The first step is to transform horizon coordinates (azimuth and altitude) to equatorial coordinates (local hour angle and declination).

$$
\tan H = \frac{\sin A}{\cos A \sin \psi + \tan h \cos \psi}\\
\sin \delta = \sin \psi \sin h - \cos \psi \cos h \cos A
$$

Then the local hour angle H is transformed to right ascension $\alpha$:

$$
\alpha = \theta - H
$$

> **Comments:**
> **username_0**: Thank you for your answers. I'm not sure how the type of the mount affect the final results. Yes, the telescope is on alt-az mount, but I don't need for now to track the movement of celestial objects, only to give as much precise position as possible. I assume that from sensor readings I can calculate altitude and azimuth, from yaw and pitch, but I'm not sure if I need roll in the calculations.  
> **username_1**: I think you're right, no need for roll in the calculations. And since the sensor is on the telescope, not the mount, I was probably wrong about needing to do anything differently for an equatorial mount.  

---

