67 #define PRINT_USAGE(rc) \
68 fprintf(stderr, "Usage: %s [ -s slice ] [ -i iteration ] [ -l ] " \
69 "[ -c c1 c2 ] WAVECAL_RESIDUALS\n", argv[0]); \
70 cpl_end(); return (rc);
72 int main(
int argc,
char **argv)
74 cpl_init(CPL_INIT_DEFAULT);
82 unsigned short slice = 0;
83 unsigned int iteration = 0;
84 cpl_boolean lambda = CPL_FALSE;
85 cpl_vector *cuts = NULL;
89 for (i = 1; i < argc; i++) {
90 if (strncmp(argv[i],
"-s", 3) == 0) {
94 slice = atol(argv[i]);
98 }
else if (strncmp(argv[i],
"-i", 3) == 0) {
102 iteration = atol(argv[i]);
104 cpl_vector_delete(cuts);
107 }
else if (strncmp(argv[i],
"-c", 3) == 0) {
108 cuts = cpl_vector_new(2);
112 cpl_vector_set(cuts, 0, atof(argv[i++]));
113 cpl_vector_set(cuts, 1, atof(argv[i]));
117 }
else if (strncmp(argv[i],
"-l", 3) == 0) {
119 }
else if (strncmp(argv[i],
"-", 1) == 0) {
127 cpl_table *table = cpl_table_load(tname, 1, 0);
132 printf(
"MUSE WAVECAL_RESIDUALS table \"%s\", contains %"CPL_SIZE_FORMAT
133 " rows\n", tname, cpl_table_get_nrow(table));
136 cpl_vector_delete(cuts);
141 case CPL_ERROR_ILLEGAL_INPUT:
142 fprintf(stderr,
"%s: \"%s\" does not seem to contain a MUSE wavelength "
143 "calibration residuals table!\n", argv[0], tname);
146 case CPL_ERROR_DATA_NOT_FOUND:
148 fprintf(stderr,
"%s: \"%s\" does not seem to contain data for slice %d "
149 "and iteration %d!\n", argv[0], tname, slice, iteration);
151 fprintf(stderr,
"%s: \"%s\" does not seem to contain data for slice %d "
152 "and the last iteration!\n", argv[0], tname, slice);
156 case CPL_ERROR_UNSUPPORTED_MODE:
157 fprintf(stderr,
"%s: your platform does not seem to support pipes "
158 "[popen()/pclose()]!\n", argv[0]);
161 case CPL_ERROR_ASSIGNING_STREAM:
162 fprintf(stderr,
"%s: could not open gnuplot (this tool uses it for "
163 "plotting)!\n", argv[0]);
170 cpl_table_delete(table);
cpl_error_code muse_wave_plot_residuals(cpl_table *aTable, const unsigned short aSlice, unsigned int aIter, cpl_boolean aPlotLambda, cpl_vector *aCuts)
Fancy plotting of wavelength calibration residuals (color coded over x/y-position) using gnuplot...