aboutsummaryrefslogtreecommitdiff
path: root/vo/votools/gasplib/pixtoeq.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 /vo/votools/gasplib/pixtoeq.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'vo/votools/gasplib/pixtoeq.x')
-rw-r--r--vo/votools/gasplib/pixtoeq.x37
1 files changed, 37 insertions, 0 deletions
diff --git a/vo/votools/gasplib/pixtoeq.x b/vo/votools/gasplib/pixtoeq.x
new file mode 100644
index 00000000..123403f0
--- /dev/null
+++ b/vo/votools/gasplib/pixtoeq.x
@@ -0,0 +1,37 @@
+include <math.h>
+define SZ_CDMTX 4
+
+# PHYSTOPIX -- procedure to obtain pixel coordinates from the equatorial
+# ones, giving the center position and scale of the frame.
+
+procedure pixtoeq (plt_ra_cen, plt_dec_cen, plt_x_cen, plt_y_cen,
+ cdmtx, x, y, ra, dec)
+
+double plt_ra_cen # Plate centre (radians)
+double plt_dec_cen # " "
+double plt_x_cen # Plate center in x (pixels)
+double plt_y_cen # Plate center in y (pixels)
+double cdmtx[SZ_CDMTX] # CD Matrix (cd11, cd12, cd21, cd22)
+double ra # Objects RA position (radians)
+double dec # Objects DEC position (radians)
+double x # Position from centre (pixels)
+double y # "
+
+double xi # Standard coordinate (degrees)
+double eta # "
+double cd11, cd12, cd21, cd22
+double xi_arcs, eta_arcs # Standard coord. in arc seconds.
+
+begin
+
+ cd11 = cdmtx[1]
+ cd12 = cdmtx[2]
+ cd21 = cdmtx[3]
+ cd22 = cdmtx[4]
+
+ xi = cd11*(x-plt_x_cen) + cd12*(y-plt_y_cen)
+ eta = cd21*(x-plt_x_cen) + cd22*(y-plt_y_cen)
+ xi_arcs = xi*3600.0 # to arcs
+ eta_arcs = eta*3600.0
+ call trsteq (plt_ra_cen, plt_dec_cen, xi_arcs, eta_arcs, ra, dec)
+end