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/apphot/aplib/aprdnoise.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/digiphot/apphot/aplib/aprdnoise.x')
-rw-r--r-- | noao/digiphot/apphot/aplib/aprdnoise.x | 36 |
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 |