From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- noao/digiphot/apphot/aplib/apitime.x | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 noao/digiphot/apphot/aplib/apitime.x (limited to 'noao/digiphot/apphot/aplib/apitime.x') diff --git a/noao/digiphot/apphot/aplib/apitime.x b/noao/digiphot/apphot/aplib/apitime.x new file mode 100644 index 00000000..c01dfc9e --- /dev/null +++ b/noao/digiphot/apphot/aplib/apitime.x @@ -0,0 +1,36 @@ +include +include "../lib/apphot.h" + +# AP_ITIME - Procedure to set the image exposure time . + +procedure ap_itime (im, ap) + +pointer im # pointer to IRAF image +pointer ap # pointer to apphot structure + +pointer sp, key +real itime +real imgetr(), apstatr() + +begin + call smark (sp) + call salloc (key, SZ_FNAME, TY_CHAR) + call apstats (ap, EXPOSURE, Memc[key], SZ_FNAME) + if (Memc[key] == EOS) + itime = apstatr (ap, ITIME) + else { + iferr { + itime = imgetr (im, Memc[key]) + } then { + itime = apstatr (ap, ITIME) + call eprintf ("Warning: Image %s Keyword: %s not found\n") + call pargstr (IM_HDRFILE(im)) + call pargstr (Memc[key]) + } + } + if (IS_INDEFR(itime) || itime <= 0.0) + call apsetr (ap, ITIME, 1.0) + else + call apsetr (ap, ITIME, itime) + call sfree (sp) +end -- cgit