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/apitime.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/digiphot/apphot/aplib/apitime.x')
-rw-r--r-- | noao/digiphot/apphot/aplib/apitime.x | 36 |
1 files changed, 36 insertions, 0 deletions
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 <imhdr.h> +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 |