aboutsummaryrefslogtreecommitdiff
path: root/noao/imred/quadred/src/quad/ccdgetparam.x
diff options
context:
space:
mode:
Diffstat (limited to 'noao/imred/quadred/src/quad/ccdgetparam.x')
-rw-r--r--noao/imred/quadred/src/quad/ccdgetparam.x48
1 files changed, 48 insertions, 0 deletions
diff --git a/noao/imred/quadred/src/quad/ccdgetparam.x b/noao/imred/quadred/src/quad/ccdgetparam.x
new file mode 100644
index 00000000..a032b553
--- /dev/null
+++ b/noao/imred/quadred/src/quad/ccdgetparam.x
@@ -0,0 +1,48 @@
+procedure ccdgetparam ()
+
+char image[SZ_FNAME] # Image whose parameter is to be fetched
+char parameter[SZ_LINE] # Parameter whose value is required.
+char instrument[SZ_FNAME] # CCD intrument file.
+
+char buffer[SZ_LINE]
+pointer im
+
+pointer immap()
+int hdmaccf()
+bool streq()
+
+begin
+
+ call clgstr ("image", image, SZ_FNAME)
+ im = immap (image, READ_ONLY, 0)
+
+ call clgstr ("instrument", instrument, SZ_FNAME)
+ call hdmopen (instrument)
+
+ call clgstr ("parameter", parameter, SZ_LINE)
+
+ # Handle special cases where we must translate the parameter value
+ # to the corresponding package name.
+ if (streq (parameter, "imagetyp")) {
+ call ccdtypes (im, buffer, SZ_LINE)
+ call printf ("%s\n")
+ call pargstr (buffer)
+
+ } else if (streq (parameter, "subset")) {
+ call ccdsubset (im, buffer, SZ_LINE)
+ call printf ("%s\n")
+ call pargstr (buffer)
+
+ } else {
+
+ if (hdmaccf (im, parameter) == NO) {
+ call printf ("UNDEFINED!\n")
+ } else {
+ call hdmgstr (im, parameter, buffer, SZ_LINE)
+ call printf ("%s\n")
+ call pargstr (buffer)
+ }
+ }
+
+ call imunmap (im)
+end