aboutsummaryrefslogtreecommitdiff
path: root/noao/twodspec/apextract/apdefault.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/twodspec/apextract/apdefault.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/twodspec/apextract/apdefault.x')
-rw-r--r--noao/twodspec/apextract/apdefault.x42
1 files changed, 42 insertions, 0 deletions
diff --git a/noao/twodspec/apextract/apdefault.x b/noao/twodspec/apextract/apdefault.x
new file mode 100644
index 00000000..bea10f7c
--- /dev/null
+++ b/noao/twodspec/apextract/apdefault.x
@@ -0,0 +1,42 @@
+include <imhdr.h>
+include "apertures.h"
+
+# AP_DEFAULT -- Create a default aperture.
+# The aperture ID, beam, axis, and the aperture center in both dimensions
+# are specified. The aperture limits along the dispersion axis are set to
+# the full size of the image while along the dispersion axis they are queried.
+# The default offset curve is a constant zero curve.
+
+procedure ap_default (im, apid, apbeam, apaxis, apcenter, dispcenter, ap)
+
+pointer im # IMIO pointer
+int apid # Aperture ID
+int apbeam # Aperture beam number
+int apaxis # Aperture axis
+real apcenter # Center along the aperture axis
+real dispcenter # Center along the dispersion axis
+pointer ap # Aperture pointer
+
+int dispaxis
+real apgetr()
+
+begin
+ dispaxis = mod (apaxis, 2) + 1
+
+ call ap_alloc (ap)
+ AP_ID(ap) = apid
+ AP_BEAM(ap) = apbeam
+ AP_AXIS(ap) = apaxis
+ AP_CEN(ap, apaxis) = apcenter
+ AP_LOW(ap, apaxis) = apgetr ("lower")
+ if (IS_INDEFR(AP_LOW(ap,apaxis)))
+ call error (1, "INDEF not allowed (lower)")
+ AP_HIGH(ap, apaxis) = apgetr ("upper")
+ if (IS_INDEFR(AP_HIGH(ap,apaxis)))
+ call error (1, "INDEF not allowed (upper)")
+ AP_CEN(ap, dispaxis) = dispcenter
+ AP_LOW(ap, dispaxis) = 1 - AP_CEN(ap, dispaxis)
+ AP_HIGH(ap, dispaxis) = IM_LEN(im, dispaxis) - AP_CEN(ap, dispaxis)
+ call ap_cvset (NULL, ap)
+ call ap_icset (NULL, ap, IM_LEN(im, apaxis))
+end