# include # include # include "../stiserr.h" /* This routine gets the exposure time and the time of the middle of the exposure from an extension header. Phil Hodge, 1998 Oct 5: Change status value 1001 to GENERIC_ERROR_CODE. */ int GetTimes11 (Hdr *hdr, double *exptime, double *midpt) { /* arguments: Hdr *hdr i: header of current imset double *exptime o: the exposure time (sec) double *midpt o: the time (MJD) of the middle of the exposure */ int status; double expstart, expend; int use_def = 0; /* missing keyword is fatal error */ int Get_KeyD (Hdr *, char *, int, double, double *); if (status = Get_KeyD (hdr, "EXPTIME", use_def, 0., exptime)) return (status); if (*exptime < 0.) { printf ("ERROR Exposure time = %.6g is invalid.\n", *exptime); return (GENERIC_ERROR_CODE); } if (status = Get_KeyD (hdr, "EXPSTART", use_def, 0., &expstart)) return (status); if (status = Get_KeyD (hdr, "EXPEND", use_def, 0., &expend)) return (status); *midpt = (expstart + expend) / 2.; return (0); }