66 #define PRINT_USAGE(rc) \ 67 fprintf(stderr, "Usage: %s [ -s1 first_slice ] [ -s2 last_slice ] " \ 68 "[ -n nifu ] TRACE_SAMPLES\n", argv[0]); \ 69 cpl_end(); return (rc); 71 int main(
int argc,
char **argv)
73 cpl_init(CPL_INIT_DEFAULT);
84 unsigned char nifu = 0;
88 for (i = 1; i < argc; i++) {
89 if (strncmp(argv[i],
"-s1", 4) == 0) {
93 slice1 = atoi(argv[i]);
97 }
else if (strncmp(argv[i],
"-s2", 4) == 0) {
101 slice2 = atoi(argv[i]);
105 }
else if (strncmp(argv[i],
"-n", 3) == 0) {
109 nifu = atoi(argv[i]);
110 if (nifu == 0 || nifu > kMuseNumIFUs) {
116 }
else if (strncmp(argv[i],
"-", 1) == 0) {
130 cpl_table *ts = cpl_table_load(tsname, iext, 1);
132 fprintf(stderr,
"%s: %s: %s\n", argv[0], tsname, cpl_error_get_message());
136 cpl_propertylist *header = cpl_propertylist_load(tsname, iext);
137 char *extname = NULL;
138 if (cpl_propertylist_has(header,
"EXTNAME")) {
141 printf(
"MUSE TRACE_SAMPLES table \"%s%s\", contains %"CPL_SIZE_FORMAT
" rows\n",
142 tsname, extname ? extname :
"", cpl_table_get_nrow(ts));
144 cpl_propertylist_delete(header);
151 case CPL_ERROR_ILLEGAL_INPUT:
152 fprintf(stderr,
"%s: \"%s%s\" does not seem to contain a MUSE tracing " 153 "samples table!\n", argv[0], tsname, extname ? extname :
"");
156 case CPL_ERROR_FILE_NOT_CREATED:
158 fprintf(stderr,
"%s: %s (temporary file for plotting)\n",
159 argv[0], cpl_error_get_message());
162 case CPL_ERROR_UNSUPPORTED_MODE:
163 fprintf(stderr,
"%s: your platform does not seem to support pipes " 164 "[popen()/pclose()]!\n", argv[0]);
167 case CPL_ERROR_ASSIGNING_STREAM:
168 fprintf(stderr,
"%s: could not open gnuplot (this tool uses it for " 169 "plotting)!\n", argv[0]);
177 cpl_table_delete(ts);
const char * muse_pfits_get_extname(const cpl_propertylist *aHeaders)
find out the extension name
int muse_utils_get_extension_for_ifu(const char *aFilename, unsigned char aIFU)
Return extension number that corresponds to this IFU/channel number.
void muse_processing_recipeinfo(cpl_plugin *)
Output main pipeline configuration, inputs, and parameters.
cpl_error_code muse_trace_plot_widths(cpl_table *aSamples, unsigned short aSlice1, unsigned short aSlice2, unsigned char aIFU)
Plotting the width from trace sample points using gnuplot.