38 #include "vircam_dfs.h"
39 #include "vircam_utils.h"
42 #define DELEXTN "^(ESO.INS |ESO.OBS |ESO.TEL |INSTRUME|PIPEFILE|ORIGIN" \
43 "|TELESCOP|OBJECT|RA|DEC|EPOCH|EQUINOX|DATAMD5|RADECSYS" \
44 "|DATE-OBS|MJD-OBS|UTC|LST|PI-COI|OBSERVER).*$"
46 #define REGFIX "^(ORIGIN|TELESCOP|INSTRUME|OBJECT|RA|DEC|EPOCH|EQUINOX" \
47 "|RADECSYS|DATE-OBS|MJD-OBS|UTC|LST|PI-COI|OBSERVER)$"
90 const char *fctid =
"vircam_dfs_set_groups";
100 nframes = cpl_frameset_get_size(
set);
104 for (i = 0; i < nframes; i++) {
105 cur_frame = cpl_frameset_get_frame(
set,i);
106 tag = cpl_frame_get_tag(cur_frame);
110 if (!strcmp(tag,VIRCAM_CROSSTALK_RAW) ||
111 !strcmp(tag,VIRCAM_DARK_RAW) ||
112 !strcmp(tag,VIRCAM_DARKCUR_RAW) ||
113 !strcmp(tag,VIRCAM_NOISE_FLAT_RAW) ||
114 !strcmp(tag,VIRCAM_NOISE_DARK_RAW) ||
115 !strcmp(tag,VIRCAM_DOME_RAW) ||
116 !strcmp(tag,VIRCAM_SCI_OBJECT_RAW) ||
117 !strcmp(tag,VIRCAM_SCI_OBJECT_EXT_RAW) ||
118 !strcmp(tag,VIRCAM_OFFSET_SKY_RAW) ||
119 !strcmp(tag,VIRCAM_TEST_SCIENCE_RAW) ||
120 !strcmp(tag,VIRCAM_LIN_DOME_RAW) ||
121 !strcmp(tag,VIRCAM_LIN_DOME_CHECK) ||
122 !strcmp(tag,VIRCAM_LIN_DARK_RAW) ||
123 !strcmp(tag,VIRCAM_LIN_DARK_CHECK) ||
124 !strcmp(tag,VIRCAM_ILLUM_RAW) ||
125 !strcmp(tag,VIRCAM_PERSIST_OBJ_RAW) ||
126 !strcmp(tag,VIRCAM_PERSIST_DARK_RAW) ||
127 !strcmp(tag,VIRCAM_RESET_RAW) ||
128 !strcmp(tag,VIRCAM_STD_OBJECT_RAW) ||
129 !strcmp(tag,VIRCAM_TWI_RAW))
130 cpl_frame_set_group(cur_frame,CPL_FRAME_GROUP_RAW);
134 else if (!strcmp(tag,VIRCAM_CAL_RESET) ||
135 !strcmp(tag,VIRCAM_CAL_DARK) ||
136 !strcmp(tag,VIRCAM_CAL_DOME_FLAT) ||
137 !strcmp(tag,VIRCAM_CAL_TWILIGHT_FLAT) ||
138 !strcmp(tag,VIRCAM_CAL_CONF) ||
139 !strcmp(tag,VIRCAM_CAL_BPM) ||
140 !strcmp(tag,VIRCAM_CAL_FRINGE) ||
141 !strcmp(tag,VIRCAM_CAL_CHANTAB) ||
142 !strcmp(tag,VIRCAM_CAL_READGAINFILE) ||
143 !strcmp(tag,VIRCAM_CAL_CHANTAB_INIT) ||
144 !strcmp(tag,VIRCAM_CAL_PHOTTAB) ||
145 !strcmp(tag,VIRCAM_CAL_STDTAB) ||
146 !strcmp(tag,VIRCAM_CAL_OBJCAT) ||
147 !strcmp(tag,VIRCAM_CAL_MSTDTAB) ||
148 !strcmp(tag,VIRCAM_CAL_2MASS) ||
149 !strcmp(tag,VIRCAM_CAL_SCHL_N) ||
150 !strcmp(tag,VIRCAM_CAL_SCHL_S) ||
151 !strcmp(tag,VIRCAM_CAL_REFCAT) ||
152 !strcmp(tag,VIRCAM_CAL_SKY) ||
153 !strcmp(tag,VIRCAM_CAL_OBJMASK) ||
154 !strcmp(tag,VIRCAM_REF_RESET) ||
155 !strcmp(tag,VIRCAM_REF_DARK) ||
156 !strcmp(tag,VIRCAM_REF_DOME_FLAT) ||
157 !strcmp(tag,VIRCAM_REF_TWILIGHT_FLAT))
158 cpl_frame_set_group(cur_frame,CPL_FRAME_GROUP_CALIB);
159 else if (!strcmp(tag,VIRCAM_PRO_OBJCAT_SCI) ||
160 !strcmp(tag,VIRCAM_PRO_CONF_SCI) ||
161 !strcmp(tag,VIRCAM_PRO_JITTERED_SCI))
162 cpl_frame_set_group(cur_frame,CPL_FRAME_GROUP_PRODUCT);
164 cpl_msg_info(fctid,
"No such tag as %s in frame %s",tag,
165 cpl_frame_get_filename(cur_frame));
205 cpl_frameset *frameset,
206 cpl_parameterlist *parlist,
211 const char *fctid=
"vircam_dfs_set_product_primary_header";
212 char package[PACKSZ];
213 cpl_propertylist *pcopy;
217 (void)snprintf(package,PACKSZ,
"%s/%s",PACKAGE,PACKAGE_VERSION);
223 pcopy = cpl_propertylist_duplicate(plist);
227 if (cpl_dfs_setup_product_header(plist,frame,frameset,parlist,recipeid,
228 package,dict,inherit) != CPL_ERROR_NONE) {
229 cpl_msg_warning(fctid,
230 "Problem with the product primary DFS compliance -- %s",
231 cpl_error_get_message());
238 cpl_propertylist_copy_property_regexp(plist,
239 (
const cpl_propertylist *)pcopy,
241 cpl_propertylist_delete(pcopy);
275 cpl_frameset *frameset,
276 cpl_parameterlist *parlist,
279 cpl_frame *inherit) {
280 const char *fctid=
"vircam_dfs_set_product_exten_header";
281 char package[PACKSZ];
285 (void)snprintf(package,PACKSZ,
"%s/%s",PACKAGE,PACKAGE_VERSION);
289 if (cpl_dfs_setup_product_header(plist,frame,frameset,parlist,recipeid,
290 package,dict,inherit) != CPL_ERROR_NONE) {
291 cpl_msg_warning(fctid,
292 "Problem with the product extn DFS compliance -- %s",
293 cpl_error_get_message());
299 cpl_propertylist_erase_regexp(plist,DELEXTN,0);