diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/mwcs/gen/mwv1tranr.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/mwcs/gen/mwv1tranr.x')
-rw-r--r-- | sys/mwcs/gen/mwv1tranr.x | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/mwcs/gen/mwv1tranr.x b/sys/mwcs/gen/mwv1tranr.x new file mode 100644 index 00000000..045f6a33 --- /dev/null +++ b/sys/mwcs/gen/mwv1tranr.x @@ -0,0 +1,32 @@ +include "../mwcs.h" + +# MW_V1TRAN -- Optimized 1D coordinate transformation for an array of points. + +procedure mw_v1tranr (a_ct, x1, x2, npts) + +pointer a_ct #I pointer to CTRAN descriptor +real x1[ARB] #I coordinates in input system +real x2[ARB] #O coordinates in output system +int npts + +int i +pointer ct +real scale, offset +errchk mw_ctranr + +begin + # Get real or double version of descriptor. + ct = CT_R(a_ct) + + scale = Memr[CT_LTM(ct)] + offset = Memr[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_ctranr (a_ct, x1[i], x2[i], 1) + } +end |