55 #define PRINT_USAGE(rc) \ 56 fprintf(stderr, "Usage: %s [ -s ] FILENAME TAG\n", argv[0]); \ 57 cpl_end(); return (rc); 59 #define PRINT_USAGE(rc) \ 60 fprintf(stderr, "Usage: %s FILENAME TAG\n", argv[0]); \ 61 cpl_end(); return (rc); 64 int main(
int argc,
char **argv)
66 cpl_init(CPL_INIT_DEFAULT);
77 cpl_boolean statcal = CPL_FALSE;
79 for (i = 1; i < argc; i++) {
81 if (strncmp(argv[i],
"-s", 3) == 0) {
85 if (strncmp(argv[i],
"-", 1) == 0) {
99 cpl_errorstate state = cpl_errorstate_get();
101 cpl_frameset *fset = cpl_frameset_new();
102 cpl_frame *frame = cpl_frame_new();
103 cpl_frame_set_filename(frame, iname);
104 cpl_frame_set_tag(frame, tag);
105 cpl_frame_set_type(frame, CPL_FRAME_TYPE_TABLE);
106 cpl_frame_set_group(frame, CPL_FRAME_GROUP_PRODUCT);
107 cpl_frame_set_level(frame, CPL_FRAME_LEVEL_FINAL);
108 printf(
"Working on \"%s\" (tag %s).\n", iname, tag);
111 cpl_frame_dump(frame, stdout);
114 cpl_frameset_insert(fset, frame);
116 printf(
"fset unsigned!\n");
117 cpl_frameset_dump(fset, stdout);
120 unsigned int flags = CPL_DFS_SIGNATURE_DATAMD5;
122 flags |= CPL_DFS_SIGNATURE_CHECKSUM;
124 cpl_dfs_sign_products(fset, flags);
126 printf(
"fset signed!\n");
127 cpl_frameset_dump(fset, stdout);
130 cpl_frameset_delete(fset);
140 printf(
"Handling \"%s\" as STATIC calibration!\n", iname);
143 fits_open_file(&fptr, iname, READWRITE, &status);
145 fits_report_error(stderr, status);
148 fits_delete_key(fptr,
"PIPEFILE", &status);
150 fits_report_error(stderr, status);
153 fits_update_key_str(fptr,
"HIERARCH ESO OBS NAME",
"STATIC",
154 "Static calibration for the MUSE pipeline.", &status);
159 fits_report_error(stderr, status);
162 fits_write_chksum(fptr, &status);
164 fits_report_error(stderr, status);
166 fits_close_file(fptr, &status);
168 fits_report_error(stderr, status);
174 if (!cpl_errorstate_is_equal(state)) {
void muse_cplerrorstate_dump_some(unsigned aCurrent, unsigned aFirst, unsigned aLast)
Dump some CPL errors.
void muse_processing_recipeinfo(cpl_plugin *)
Output main pipeline configuration, inputs, and parameters.