37 #include <casu_utils.h>
38 #include "vircam_pfits.h"
40 static int vircam_pfits_get_float(
const cpl_propertylist *plist,
41 const char *key,
float *fval);
42 static int vircam_pfits_get_double(
const cpl_propertylist *plist,
43 const char *key,
double *fval);
71 return(vircam_pfits_get_double(plist,
"CRVAL1",crval1));
88 return(vircam_pfits_get_double(plist,
"CRPIX1",crpix1));
105 return(vircam_pfits_get_double(plist,
"CRVAL2",crval2));
122 return(vircam_pfits_get_double(plist,
"CRPIX2",crpix2));
137 return(vircam_pfits_get_double(plist,
"CD1_1",cd11));
152 return(vircam_pfits_get_double(plist,
"CD1_2",cd12));
168 return(vircam_pfits_get_double(plist,
"CD2_1",cd21));
183 return(vircam_pfits_get_double(plist,
"CD2_2",cd22));
199 return(vircam_pfits_get_double(plist,
"PV2_1",pv21));
215 return(vircam_pfits_get_double(plist,
"PV2_3",pv23));
231 return(vircam_pfits_get_double(plist,
"PV2_5",pv25));
248 return(vircam_pfits_get_float(plist,
"EXPTIME",exptime));
265 return(vircam_pfits_get_float(plist,
"ESO DET MINDIT",mindit));
282 return(vircam_pfits_get_float(plist,
"ESO DET DITDELAY",ditdelay));
300 val = cpl_propertylist_get_int(plist,
"NAXIS1");
301 if (cpl_error_get_code() == CPL_ERROR_NONE) {
325 val = cpl_propertylist_get_int(plist,
"NAXIS2");
326 if (cpl_error_get_code() == CPL_ERROR_NONE) {
350 val = cpl_propertylist_get_int(plist,
"ESO DET CHIP NO");
351 if (cpl_error_get_code() == CPL_ERROR_NONE) {
374 return(vircam_pfits_get_float(plist,
"ESO DRS XOFFDITHER",xoff));
391 return(vircam_pfits_get_float(plist,
"ESO DRS YOFFDITHER",yoff));
408 return(vircam_pfits_get_float(plist,
"ESO TEL AIRM START",airmass));
426 val = cpl_propertylist_get_int(plist,
"NUSTEP");
427 if (cpl_error_get_code() == CPL_ERROR_NONE) {
453 val = cpl_propertylist_get_int(plist,
"USTEPNUM");
454 if (cpl_error_get_code() == CPL_ERROR_NONE) {
480 val = cpl_propertylist_get_int(plist,
"NJITTER");
481 if (cpl_error_get_code() == CPL_ERROR_NONE) {
507 val = cpl_propertylist_get_int(plist,
"OFFSET_I");
508 if (cpl_error_get_code() == CPL_ERROR_NONE) {
534 val = cpl_propertylist_get_int(plist,
"JITTER_I");
535 if (cpl_error_get_code() == CPL_ERROR_NONE) {
561 val = cpl_propertylist_get_int(plist,
"OFFSTNUM");
562 if (cpl_error_get_code() == CPL_ERROR_NONE) {
587 val = cpl_propertylist_get_int(plist,
"ESO DET NDIT");
588 if (cpl_error_get_code() == CPL_ERROR_NONE) {
611 return(vircam_pfits_get_float(plist,
"ESO DET DIT",dit));
628 val = cpl_propertylist_get_bool(plist,
"ESO DET CHIP LIVE");
629 if (cpl_error_get_code() == CPL_ERROR_NONE) {
651 if(cpl_propertylist_has(plist,
"ESO INS FILT1 NAME") == 0) {
655 strcpy(filt,cpl_propertylist_get_string(plist,
"ESO INS FILT1 NAME"));
656 if (cpl_error_get_code() == CPL_ERROR_NONE) {
677 strcpy(projid,cpl_propertylist_get_string(plist,
"ESO OBS PROG ID"));
678 if (cpl_error_get_code() == CPL_ERROR_NONE) {
699 return(vircam_pfits_get_float(plist,
"ESO DET SATURATION",saturation));
715 return(vircam_pfits_get_float(plist,
"GAIN",gain));
731 return(vircam_pfits_get_double(plist,
"MJD-OBS",mjd));
747 return(vircam_pfits_get_double(plist,
"RA",ra));
763 return(vircam_pfits_get_double(plist,
"DEC",dec));
778 strcpy(tplstart,cpl_propertylist_get_string(plist,
"ESO TPL START"));
779 if (cpl_error_get_code() == CPL_ERROR_NONE) {
798 static int vircam_pfits_get_float(
const cpl_propertylist *plist,
799 const char *key,
float *fval) {
801 const char *fctid =
"vircam_pfits_get_float";
805 type = cpl_propertylist_get_type(plist,key);
806 if (cpl_error_get_code() != CPL_ERROR_NONE) {
816 *fval = cpl_propertylist_get_float(plist,key);
818 case CPL_TYPE_DOUBLE:
819 *fval = (float)cpl_propertylist_get_double(plist,key);
823 cpl_msg_error(fctid,
"Keyword %s is not floating point in header",key);
840 static int vircam_pfits_get_double(
const cpl_propertylist *plist,
841 const char *key,
double *fval) {
843 const char *fctid =
"vircam_pfits_get_float";
847 type = cpl_propertylist_get_type(plist,key);
848 if (cpl_error_get_code() != CPL_ERROR_NONE) {
858 *fval = (double)cpl_propertylist_get_float(plist,key);
860 case CPL_TYPE_DOUBLE:
861 *fval = cpl_propertylist_get_double(plist,key);
865 cpl_msg_error(fctid,
"Keyword %s is not floating point in header",key);
int vircam_pfits_get_crpix2(const cpl_propertylist *plist, double *crpix2)
Get the value of crpix2.
int vircam_pfits_get_ra(const cpl_propertylist *plist, double *ra)
Get the value of RA.
int vircam_pfits_get_cd12(const cpl_propertylist *plist, double *cd12)
Get the value of cd1_2.
int vircam_pfits_get_cd11(const cpl_propertylist *plist, double *cd11)
Get the value of cd1_1.
int vircam_pfits_get_jyoff(const cpl_propertylist *plist, float *yoff)
Get the value of the Y jitter offset.
int vircam_pfits_get_cd21(const cpl_propertylist *plist, double *cd21)
Get the value of cd2_1.
int vircam_pfits_get_ndit(const cpl_propertylist *plist, int *ndit)
Get the value of NDIT.
int vircam_pfits_get_dec(const cpl_propertylist *plist, double *dec)
Get the value of DEC.
int vircam_pfits_get_jitteri(const cpl_propertylist *plist, int *jitteri)
Get the position number of an observations in a jitter sequence.
int vircam_pfits_get_gain(const cpl_propertylist *plist, float *gain)
Get the value of the detector gain.
int vircam_pfits_get_jitternum(const cpl_propertylist *plist, int *jitternum)
Get the value of the first run number in the current jitter sequence.
int vircam_pfits_get_crval1(const cpl_propertylist *plist, double *crval1)
Get the value of crval1.
int vircam_pfits_get_ditdelay(const cpl_propertylist *plist, float *ditdelay)
Get the value of dit delay time.
int vircam_pfits_get_mjd(const cpl_propertylist *plist, double *mjd)
Get the value of the modified Julian date.
int vircam_pfits_get_naxis1(const cpl_propertylist *plist, long *naxis1)
Get the value of naxis1.
int vircam_pfits_get_projid(const cpl_propertylist *plist, char *projid)
Get the project id.
int vircam_pfits_get_dit(const cpl_propertylist *plist, float *dit)
Get the value of DIT.
int vircam_pfits_get_crval2(const cpl_propertylist *plist, double *crval2)
Get the value of crval2.
int vircam_pfits_get_jxoff(const cpl_propertylist *plist, float *xoff)
Get the value of the X jitter offset.
int vircam_pfits_get_detlive(const cpl_propertylist *plist, int *detlive)
Get the value of DET_LIVE.
int vircam_pfits_get_pv23(const cpl_propertylist *plist, double *pv23)
Get the value of pv2_3.
int vircam_pfits_get_njsteps(const cpl_propertylist *plist, int *njsteps)
Get the value of the number of observations in a jitter sequence.
int vircam_pfits_get_nusteps(const cpl_propertylist *plist, int *nusteps)
Get the value of the number of microsteps in a sequence.
int vircam_pfits_get_pv25(const cpl_propertylist *plist, double *pv25)
Get the value of pv2_5.
int vircam_pfits_get_tplstart(cpl_propertylist *plist, char *tplstart)
Get the value of template start time.
int vircam_pfits_get_exptime(const cpl_propertylist *plist, float *exptime)
Get the value of exposure time.
int vircam_pfits_get_mindit(const cpl_propertylist *plist, float *mindit)
Get the value of mindit time.
int vircam_pfits_get_saturation(const cpl_propertylist *plist, float *saturation)
Get the saturation level for this detector.
int vircam_pfits_get_ustepnum(const cpl_propertylist *plist, int *ustepnum)
Get the value of the first run number in the current microstep sequence.
int vircam_pfits_get_chipno(const cpl_propertylist *plist, int *chipno)
Get the value of chipno.
int vircam_pfits_get_pv21(const cpl_propertylist *plist, double *pv21)
Get the value of pv2_1.
int vircam_pfits_get_cd22(const cpl_propertylist *plist, double *cd22)
Get the value of cd2_2.
int vircam_pfits_get_crpix1(const cpl_propertylist *plist, double *crpix1)
Get the value of crpix1.
int vircam_pfits_get_airmass(const cpl_propertylist *plist, float *airmass)
Get the value of the airmass.
int vircam_pfits_get_filter(const cpl_propertylist *plist, char *filt)
Get the name of the current filter.
int vircam_pfits_get_offsetnum(const cpl_propertylist *plist, int *offsetnum)
Get the value of the first run number in the current tile sequence.
int vircam_pfits_get_naxis2(const cpl_propertylist *plist, long *naxis2)
Get the value of naxis2.