55 #define PRINT_USAGE(rc) \ 56 fprintf(stderr, "Usage: %s PIXTABLE_IN IFU SLICE PIXTABLE_OUT\n", argv[0]); \ 57 cpl_end(); return (rc); 59 int main(
int argc,
char **argv)
61 cpl_init(CPL_INIT_DEFAULT);
63 cpl_errorstate prestate = cpl_errorstate_get();
72 unsigned char ifu = 0;
73 unsigned short slice = 0;
77 for (i = 1; i < argc; i++) {
78 if (tiname && toname) {
86 slice = atoi(argv[i]);
91 if (ifu == 0 || ifu > kMuseNumIFUs) {
92 printf(
"Illegal IFU number %hhu given\n", ifu);
95 if (slice == 0 || slice > kMuseSlicesPerCCD) {
96 printf(
"Illegal slice number %hu given\n", slice);
105 printf(
"Loaded pixel table \"%s\" with %"CPL_SIZE_FORMAT
" rows\n",
110 if (rc == CPL_ERROR_NONE) {
111 printf(
"Erased slice %hu of IFU %hhu (%"CPL_SIZE_FORMAT
" pixels removed)\n",
112 slice, ifu, nrow - nrow2);
114 printf(
"Error while erasing slice %hu of IFU %hhu: %s\n", slice, ifu,
115 cpl_error_get_message());
119 printf(
"MUSE pixel table \"%s\" (%"CPL_SIZE_FORMAT
" rows) saved\n", toname,
122 rc = cpl_errorstate_is_equal(prestate) ? 0 : 50;
muse_pixtable * muse_pixtable_load(const char *aFilename)
Load the table itself and the FITS headers of a MUSE pixel table from a file.
cpl_size muse_pixtable_get_nrow(const muse_pixtable *aPixtable)
get the number of rows within the pixel table
cpl_error_code muse_pixtable_erase_ifu_slice(muse_pixtable *aPixtable, unsigned char aIFU, unsigned short aSlice)
Erase pixel table rows related to one slice of one IFU.
Structure definition of MUSE pixel table.
void muse_cplerrorstate_dump_some(unsigned aCurrent, unsigned aFirst, unsigned aLast)
Dump some CPL errors.
cpl_error_code muse_pixtable_save(muse_pixtable *aPixtable, const char *aFilename)
Save a MUSE pixel table to a file on disk.
void muse_pixtable_delete(muse_pixtable *aPixtable)
Deallocate memory associated to a pixel table object.
void muse_processing_recipeinfo(cpl_plugin *)
Output main pipeline configuration, inputs, and parameters.