<p>I couldn’t really figure out the way to get RA Dec from the data mentioned. I ended up using a catalog that already has RA Dec of objects. </p>

CC BY-SA 4.0
2018-09-18T19:38:10.057Z
2018-09-18T19:38:10.057Z
Codetard
<p>I'm developing a telescope controller open-source application. I started this project with a very little knowledge of Astronomy.
Basically, the app is going to send data to telescope over a wireless connection.</p>

<hr>

<p>Data of the celestial object is as follow:</p>

<pre><code>["SAO#": 308,
"HD": 8890,
"Con": "Alpha Ursae Minoris",
"StarName": "Polaris",
"RAH": 2,
"RAM": 31.812,
"DED": 89,
"DEM": 15.85,
"Mag": 2.02,
"PRA": 0.038,
"PDec": -0.015]
</code></pre>

<p>RAH = RA hours, RAM = RA minutes,<br>
DED = Dec degrees, DEM = Dec minutes</p>

<p>(PRA and PDec are the drift of the star in arc-seconds per year (from the catalog Epoch J2000.0). I don't need to use these in the app, that I'm told.)</p>

<p>The controller server (data receiver) accepts in this format:<br>
Set target RA- HH:MM:SS,<br>
Set target Dec- DD:MM:SS,<br>
Set target Azm- DDD:MM:SS,<br>
Set target Alt- DD:MM:SS</p>

<hr>

<p><strong>I would want to convert the given celestial object data to Ra, Dec, Azm, Alt.</strong></p>

<p>I'm told that:  </p>

<pre><code>RA = ((RAH + (RAM / 60.0)) * 15.0); //in degrees, RA is an earthly longitude projected onto the sky
DEC = (DED + (DEM / 60.0)); //in degrees, Dec is an earthly latitude projected onto the sky
</code></pre>

<p>For a star or other celestial object from the catalogs they have a fixed Epoch (J2000.)  I need to apply a correction for precession/nutation (wobble of the Earth's axis of rotation) to get a half decent estimate of the star's RA/Dec "now". </p>

<p>I'm using a <a href="http://onekiloparsec.github.io/SwiftAA/" rel="nofollow noreferrer">code library</a> that seems to have support for this and does the calculation on it own.<br>
I would want to know the procedure of the data conversion from equatorial coordinates to horizontal including. 
For an instance this is how the code works:</p>

<pre><code>    let jd = Date().julianDay
    let RAH = 2.0
    let RAM = 31.812
    let DED = 89.0
    let DEM = 15.85

    let eqCoor = EquatorialCoordinates.init(rightAscension: Hour((RAH+(RAM/60.0))*15.0), declination: (Degree(DED+(DEM/60.0))), epoch: Epoch.J2000, equinox: Equinox.standardJ2000)
    let annualAbb = eqCoor.correctedForAnnualAberration(julianDay: jd, highPrecision: true)
    let initEQ = AstronomicalObject.init(name: "Polaris", coordinates: annualAbb, julianDay: jd, highPrecision: true)
    print("EquatorialCoordinates -&gt; RA(α):", initEQ.equatorialCoordinates.alpha, "DEC(δ):", initEQ.equatorialCoordinates.delta) 

    let userLocation = GeographicCoordinates(positivelyWestwardLongitude: Degree(.plus, 75, 51, 13.65), latitude: Degree(.plus, 30, 54, 43.55), altitude: 256)
    print("User Location -&gt; Latitude:", userLocation.latitude, "Longitude:", userLocation.longitude)

    let preccCoor = annualAbb.precessedCoordinates(to: Equinox.standardJ2000)
    let horizontalCoor = preccCoor.makeHorizontalCoordinates(for: userLocation, at: jd)
    print("Horizontal Coordinates -&gt; Azimuth:", horizontalCoor.azimuth.inHours, "Altitude:", horizontalCoor.altitude.inRadians.inDegrees)
</code></pre>

<p>This is the data that code returns:</p>

<pre><code>EquatorialCoordinates -&gt; RA(α): +37h56m06.009s DEC(δ): +89°16'05.165"
User Location -&gt; Latitude: +30°54'43.550" Longitude: +75°51'13.650"
Horizontal Coordinates -&gt; Azimuth: +12h1m07.396s Altitude: +30°13'16.650"
</code></pre>

<p>Here's the data from <a href="https://stellarium.org/" rel="nofollow noreferrer">Stellarium</a> according to the same location as my code.</p>

<p><a href="https://i.sstatic.net/zfYAw.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/zfYAw.png" alt="enter image description here"></a></p>

<p>The data calculated from my code is not even close to the one from Stellarium except apparent altitude.</p>

<telescope><amateur-observing><fundamental-astronomy><coordinate>
Need help with the calculations/conversion of a celestial object
Codetard
# Need help with the calculations/conversion of a celestial object

(Asked by: username_0 on 2018-09-04)

I'm developing a telescope controller open-source application. I started this project with a very little knowledge of Astronomy.
Basically, the app is going to send data to telescope over a wireless connection.

---

Data of the celestial object is as follow:

```
["SAO#": 308,
"HD": 8890,
"Con": "Alpha Ursae Minoris",
"StarName": "Polaris",
"RAH": 2,
"RAM": 31.812,
"DED": 89,
"DEM": 15.85,
"Mag": 2.02,
"PRA": 0.038,
"PDec": -0.015]

```

RAH = RA hours, RAM = RA minutes,  
DED = Dec degrees, DEM = Dec minutes

(PRA and PDec are the drift of the star in arc-seconds per year (from the catalog Epoch J2000.0). I don't need to use these in the app, that I'm told.)

The controller server (data receiver) accepts in this format:  
Set target RA- HH:MM:SS,  
Set target Dec- DD:MM:SS,  
Set target Azm- DDD:MM:SS,  
Set target Alt- DD:MM:SS

---

**I would want to convert the given celestial object data to Ra, Dec, Azm, Alt.**

I'm told that:

```
RA = ((RAH + (RAM / 60.0)) * 15.0); //in degrees, RA is an earthly longitude projected onto the sky
DEC = (DED + (DEM / 60.0)); //in degrees, Dec is an earthly latitude projected onto the sky

```

For a star or other celestial object from the catalogs they have a fixed Epoch (J2000.) I need to apply a correction for precession/nutation (wobble of the Earth's axis of rotation) to get a half decent estimate of the star's RA/Dec "now".

I'm using a [code library](http://onekiloparsec.github.io/SwiftAA/) that seems to have support for this and does the calculation on it own.  
I would want to know the procedure of the data conversion from equatorial coordinates to horizontal including.
For an instance this is how the code works:

```
    let jd = Date().julianDay
    let RAH = 2.0
    let RAM = 31.812
    let DED = 89.0
    let DEM = 15.85

    let eqCoor = EquatorialCoordinates.init(rightAscension: Hour((RAH+(RAM/60.0))*15.0), declination: (Degree(DED+(DEM/60.0))), epoch: Epoch.J2000, equinox: Equinox.standardJ2000)
    let annualAbb = eqCoor.correctedForAnnualAberration(julianDay: jd, highPrecision: true)
    let initEQ = AstronomicalObject.init(name: "Polaris", coordinates: annualAbb, julianDay: jd, highPrecision: true)
    print("EquatorialCoordinates -> RA(α):", initEQ.equatorialCoordinates.alpha, "DEC(δ):", initEQ.equatorialCoordinates.delta) 

    let userLocation = GeographicCoordinates(positivelyWestwardLongitude: Degree(.plus, 75, 51, 13.65), latitude: Degree(.plus, 30, 54, 43.55), altitude: 256)
    print("User Location -> Latitude:", userLocation.latitude, "Longitude:", userLocation.longitude)

    let preccCoor = annualAbb.precessedCoordinates(to: Equinox.standardJ2000)
    let horizontalCoor = preccCoor.makeHorizontalCoordinates(for: userLocation, at: jd)
    print("Horizontal Coordinates -> Azimuth:", horizontalCoor.azimuth.inHours, "Altitude:", horizontalCoor.altitude.inRadians.inDegrees)

```

This is the data that code returns:

```
EquatorialCoordinates -> RA(α): +37h56m06.009s DEC(δ): +89°16'05.165"
User Location -> Latitude: +30°54'43.550" Longitude: +75°51'13.650"
Horizontal Coordinates -> Azimuth: +12h1m07.396s Altitude: +30°13'16.650"

```

Here's the data from [Stellarium](https://stellarium.org/) according to the same location as my code.

[![enter image description here](https://i.sstatic.net/zfYAw.png)](https://i.sstatic.net/zfYAw.png)

The data calculated from my code is not even close to the one from Stellarium except apparent altitude.

**Tags:** telescope, amateur-observing, fundamental-astronomy, coordinate


---

## 1 answers

### Answer by username_0 on 2018-09-18. Score: 0 | Accepted answer

I couldn’t really figure out the way to get RA Dec from the data mentioned. I ended up using a catalog that already has RA Dec of objects.


---

