aboutsummaryrefslogtreecommitdiff
path: root/noao/astutil/asttools/astgaltoeq.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/astutil/asttools/astgaltoeq.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/astutil/asttools/astgaltoeq.x')
-rw-r--r--noao/astutil/asttools/astgaltoeq.x37
1 files changed, 37 insertions, 0 deletions
diff --git a/noao/astutil/asttools/astgaltoeq.x b/noao/astutil/asttools/astgaltoeq.x
new file mode 100644
index 00000000..94f7861d
--- /dev/null
+++ b/noao/astutil/asttools/astgaltoeq.x
@@ -0,0 +1,37 @@
+include <math.h>
+
+# Definition of system
+define LP 123.00d0 # Longtitude of pole
+define BP 27.40d0 # Latitude of pole
+define LO 97.7422d0 # Longitude of origin
+define BO -60.1810d0 # Latitude of origin
+define GEPOCH 1950.0d0 # Epoch of definition
+
+# AST_GALTOEQ -- Convert galactic coordinates (1950) to equatorial coordinates.
+
+procedure ast_galtoeq (lii, bii, ra, dec, epoch)
+
+double lii # Galactic longitude (degrees)
+double bii # Galactic latitude (degrees)
+double ra # Right ascension (hours)
+double dec # Declination (degrees)
+double epoch # Epoch of coordinates
+
+double ao, bo, ap, bp, a1, b1, a2, b2
+
+begin
+ ao = DEGTORAD (LO)
+ bo = DEGTORAD (BO)
+ ap = DEGTORAD (LP)
+ bp = DEGTORAD (BP)
+ a1 = DEGTORAD (lii)
+ b1 = DEGTORAD (bii)
+
+ call ast_coord (ao, bo, ap, bp, a1, b1, a2, b2)
+
+ a2 = mod (24.0d0 + RADTODEG(a2) / 15.0d0, 24.0d0)
+ b2 = RADTODEG (b2)
+
+ # Precess the coordinates
+ call ast_precess (a2, b2, GEPOCH, ra, dec, epoch)
+end