From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- noao/digiphot/apphot/aplib/appadu.x | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 noao/digiphot/apphot/aplib/appadu.x (limited to 'noao/digiphot/apphot/aplib/appadu.x') 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 +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 -- cgit