aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/daophot/daolib/dppadu.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/digiphot/daophot/daolib/dppadu.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/digiphot/daophot/daolib/dppadu.x')
-rw-r--r--noao/digiphot/daophot/daolib/dppadu.x36
1 files changed, 36 insertions, 0 deletions
diff --git a/noao/digiphot/daophot/daolib/dppadu.x b/noao/digiphot/daophot/daolib/dppadu.x
new file mode 100644
index 00000000..b1ca7c25
--- /dev/null
+++ b/noao/digiphot/daophot/daolib/dppadu.x
@@ -0,0 +1,36 @@
+include <imhdr.h>
+include "../lib/daophotdef.h"
+
+# DP_PADU -- Read the gain value from the image header.
+
+procedure dp_padu (im, dao)
+
+pointer im # pointer to IRAF image
+pointer dao # pointer to the daophot structure
+
+pointer sp, key
+real padu
+real imgetr(), dp_statr()
+
+begin
+ call smark (sp)
+ call salloc (key, SZ_FNAME, TY_CHAR)
+ call dp_stats (dao, CCDGAIN, Memc[key], SZ_FNAME)
+ if (Memc[key] == EOS)
+ padu = dp_statr (dao, PHOTADU)
+ else {
+ iferr {
+ padu = imgetr (im, Memc[key])
+ } then {
+ padu = dp_statr (dao, PHOTADU)
+ call eprintf ("Warning: Image %s Keyword %s not found.\n")
+ call pargstr (IM_HDRFILE(im))
+ call pargstr (Memc[key])
+ }
+ }
+ if (IS_INDEFR(padu) || padu <= 0.0)
+ call dp_setr (dao, PHOTADU, 1.0)
+ else
+ call dp_setr (dao, PHOTADU, padu)
+ call sfree (sp)
+end