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/appadu.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/digiphot/apphot/aplib/appadu.x')
-rw-r--r-- | noao/digiphot/apphot/aplib/appadu.x | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/noao/digiphot/apphot/aplib/appadu.x b/noao/digiphot/apphot/aplib/appadu.x new file mode 100644 index 00000000..121decaf --- /dev/null +++ b/noao/digiphot/apphot/aplib/appadu.x @@ -0,0 +1,37 @@ +include <imhdr.h> +include "../lib/noise.h" + +# AP_PADU -- Procedure to set the gain parameter for the noise model +# computation. + +procedure ap_padu (im, ap) + +pointer im # pointer to IRAF image +pointer ap # pointer to apphot structure + +pointer sp, key +real padu +real imgetr(), apstatr() + +begin + call smark (sp) + call salloc (key, SZ_FNAME, TY_CHAR) + call apstats (ap, GAIN, Memc[key], SZ_FNAME) + if (Memc[key] == EOS) + padu = apstatr (ap, EPADU) + else { + iferr { + padu = imgetr (im, Memc[key]) + } then { + padu = apstatr (ap, EPADU) + 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 apsetr (ap, EPADU, 1.0) + else + call apsetr (ap, EPADU, padu) + call sfree (sp) +end |