aboutsummaryrefslogtreecommitdiff
path: root/sys/mwcs/mwv1tran.gx
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /sys/mwcs/mwv1tran.gx
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/mwcs/mwv1tran.gx')
-rw-r--r--sys/mwcs/mwv1tran.gx34
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/mwcs/mwv1tran.gx b/sys/mwcs/mwv1tran.gx
new file mode 100644
index 00000000..170d8239
--- /dev/null
+++ b/sys/mwcs/mwv1tran.gx
@@ -0,0 +1,34 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "../mwcs.h"
+
+# MW_V1TRAN -- Optimized 1D coordinate transformation for an array of points.
+
+procedure mw_v1tran$t (a_ct, x1, x2, npts)
+
+pointer a_ct #I pointer to CTRAN descriptor
+PIXEL x1[ARB] #I coordinates in input system
+PIXEL x2[ARB] #O coordinates in output system
+int npts
+
+int i
+pointer ct
+PIXEL scale, offset
+errchk mw_ctran$t
+
+begin
+ # Get real or double version of descriptor.
+ ct = CT_$T(a_ct)
+
+ scale = Mem$t[CT_LTM(ct)]
+ offset = Mem$t[CT_LTV(ct)]
+
+ # Perform the transformation; case LNR is a simple linear transform.
+ if (CT_TYPE(ct) == LNR) {
+ do i = 1, npts
+ x2[i] = scale * x1[i] + offset
+ } else {
+ do i = 1, npts
+ call mw_ctran$t (a_ct, x1[i], x2[i], 1)
+ }
+end