61 #define PRINT_USAGE(rc) \ 62 fprintf(stderr, "Usage: %s [ -s startidx ] [ -c count ] PIXTABLE\n", \ 64 cpl_end(); return (rc); 66 int main(
int argc,
char **argv)
68 cpl_init(CPL_INIT_DEFAULT);
77 cpl_size start = 0, count = CPL_SIZE_MAX;
81 for (i = 1; i < argc; i++) {
82 if (strncmp(argv[i],
"-s", 3) == 0) {
86 start = atol(argv[i]);
90 }
else if (strncmp(argv[i],
"-c", 3) == 0) {
94 count = atol(argv[i]);
98 }
else if (strncmp(argv[i],
"-", 1) == 0) {
106 cpl_msg_set_level(CPL_MSG_WARNING);
112 if (count == CPL_SIZE_MAX) {
116 cpl_propertylist *theader = cpl_propertylist_load(tname, 1);
117 cpl_size nrow = cpl_propertylist_get_long_long(theader,
"NAXIS2");
118 cpl_propertylist_delete(theader);
120 printf(
"# MUSE pixel table \"%s\", showing %"CPL_SIZE_FORMAT
" rows starting " 121 "at index %"CPL_SIZE_FORMAT
" of %"CPL_SIZE_FORMAT
"\n", tname, count,
128 case CPL_ERROR_BAD_FILE_FORMAT:
129 fprintf(stderr,
"%s: \"%s\" does not seem to contain a MUSE pixel table!\n",
133 case CPL_ERROR_ILLEGAL_INPUT:
134 fprintf(stderr,
"%s: Illegal data range given (start index=%"CPL_SIZE_FORMAT
135 " count=%"CPL_SIZE_FORMAT
") for table with %"CPL_SIZE_FORMAT
cpl_size muse_pixtable_get_nrow(const muse_pixtable *aPixtable)
get the number of rows within the pixel table
cpl_error_code muse_pixtable_dump(muse_pixtable *aPixtable, cpl_size aStart, cpl_size aCount, unsigned char aDisplayHeader)
Dump a MUSE pixel table to the screen, resolving the origin column.
Structure definition of MUSE pixel table.
muse_pixtable * muse_pixtable_load_window(const char *aFilename, cpl_size aStart, cpl_size aNRows)
Load a range of rows from the table and all the FITS headers of a MUSE pixel table from a file...
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.