diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /noao/digiphot/daophot/daolib/dprdnoise.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/digiphot/daophot/daolib/dprdnoise.x')
-rw-r--r-- | noao/digiphot/daophot/daolib/dprdnoise.x | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/noao/digiphot/daophot/daolib/dprdnoise.x b/noao/digiphot/daophot/daolib/dprdnoise.x new file mode 100644 index 00000000..9e4baa3c --- /dev/null +++ b/noao/digiphot/daophot/daolib/dprdnoise.x @@ -0,0 +1,36 @@ +include <imhdr.h> +include "../lib/daophotdef.h" + +# DP_RDNOISE - Read the readout noise value from the image header. + +procedure dp_rdnoise (im, dao) + +pointer im # pointer to IRAF image +pointer dao # pointer to the daophot structure + +pointer sp, key +real rdnoise +real imgetr(), dp_statr() + +begin + call smark (sp) + call salloc (key, SZ_FNAME, TY_CHAR) + call dp_stats (dao, CCDREAD, Memc[key], SZ_FNAME) + if (Memc[key] == EOS) + rdnoise = dp_statr (dao, READNOISE) + else { + iferr { + rdnoise = imgetr (im, Memc[key]) + } then { + rdnoise = dp_statr (dao, 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 dp_setr (dao, READNOISE, 0.0) + else + call dp_setr (dao, READNOISE, rdnoise) + call sfree (sp) +end |