aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/apphot/aplib/aprdnoise.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/apphot/aplib/aprdnoise.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/digiphot/apphot/aplib/aprdnoise.x')
-rw-r--r--noao/digiphot/apphot/aplib/aprdnoise.x36
1 files changed, 36 insertions, 0 deletions
diff --git a/noao/digiphot/apphot/aplib/aprdnoise.x b/noao/digiphot/apphot/aplib/aprdnoise.x
new file mode 100644
index 00000000..e4fbda2c
--- /dev/null
+++ b/noao/digiphot/apphot/aplib/aprdnoise.x
@@ -0,0 +1,36 @@
+include <imhdr.h>
+include "../lib/noise.h"
+
+# AP_RDNOISE - Procedure to set the image read noise parameter.
+
+procedure ap_rdnoise (im, ap)
+
+pointer im # pointer to IRAF image
+pointer ap # pointer to apphot structure
+
+pointer sp, key
+real rdnoise
+real imgetr(), apstatr()
+
+begin
+ call smark (sp)
+ call salloc (key, SZ_FNAME, TY_CHAR)
+ call apstats (ap, CCDREAD, Memc[key], SZ_FNAME)
+ if (Memc[key] == EOS)
+ rdnoise = apstatr (ap, READNOISE)
+ else {
+ iferr {
+ rdnoise = imgetr (im, Memc[key])
+ } then {
+ rdnoise = apstatr (ap, READNOISE)
+ call eprintf ("Warning: Image %s Keyword %s not found.\n")
+ call pargstr (IM_HDRFILE(im))
+ call pargstr (Memc[key])
+ }
+ }
+ if (IS_INDEFR(rdnoise) || rdnoise <= 0.0)
+ call apsetr (ap, READNOISE, 0.0)
+ else
+ call apsetr (ap, READNOISE, rdnoise)
+ call sfree (sp)
+end