42#include "irplib_utils.h"
44#include "visir_parameter.h"
46#include "visir_pfits.h"
52#define visir_plot_manpage \
53 "The recipe can produce a number of predefined plots. " \
54 "Zero means that none of the plots are produced, while " \
55 "increasing values (e.g. 1 or 2) increases the number " \
56 "of plots produced. If the plotting fails a warning is " \
57 "produced, and the recipe continues. " \
58 "The default behaviour of the plotting is to use " \
59 "gnuplot (with option -persist). The recipe currently " \
60 "produces 1D-plots using gnuplot commands. The recipe " \
61 "user can control the actual plotting-command used by " \
62 "the recipe to create the plot by setting the " \
63 "environment variable CPL_PLOTTER. Currently, if " \
65 "is set it must contain the string 'gnuplot'. Setting " \
66 "it to 'cat > my_gnuplot_$$.txt' causes a number of " \
67 "ASCII-files to be created, which each produce a plot " \
68 "when given as standard input to gnuplot (e.g. later " \
69 "or on a different computer). A finer control of the " \
70 "plotting options can be obtained by writing an " \
71 "executable script, e.g. my_gnuplot.pl, that " \
72 "executes gnuplot after setting the desired gnuplot " \
73 "options (e.g. set terminal pslatex color) " \
74 "and then setting CPL_PLOTTER to my_gnuplot.pl. " \
75 "The predefined plots include plotting of images. " \
76 "Images can be plotted not only with gnuplot, but also " \
77 "using the pnm format. This is controlled with the " \
78 "environment variable CPL_IMAGER. If CPL_IMAGER " \
79 "is set to a string that does not contain the word " \
80 "gnuplot, the recipe will generate the plot in pnm " \
81 "format. E.g. setting CPL_IMAGER to " \
82 "'display - &' will produce a gray-scale image " \
83 "using the image viewer display."
88#define VISIR_PARAMETER_SET(MASK, VARNAME, TYPE, MAN, DEFAULT, SHORT) \
89if (bitmask & MASK) { \
90 char * paramname = cpl_sprintf(PACKAGE ".%s." VARNAME, recipe); \
92 p = cpl_parameter_new_value(paramname, TYPE, MAN, context, DEFAULT); \
93 cpl_free(paramname); \
94 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, SHORT); \
95 cpl_parameterlist_append(self, p); \
97 (void)cpl_error_set_where(cpl_func);
\
102 if (chkmask & MASK) \
103 (void)cpl_error_set(cpl_func, CPL_ERROR_UNSPECIFIED); \
108#define VISIR_PARAMETER_GET_BOOL(MASK, VARNAME) \
109if (bitmask & MASK) { \
110 value = irplib_parameterlist_get_bool(self, PACKAGE, recipe, VARNAME); \
112 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), \
113 return(CPL_FALSE), "mask=0x%llx", MASK); \
120#define VISIR_PARAMETER_GET_INT(MASK, VARNAME) \
121if (bitmask & MASK) { \
122 value = irplib_parameterlist_get_int(self, PACKAGE, recipe, VARNAME); \
124 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), return(0), \
125 "mask=0x%llx", MASK); \
133#define VISIR_PARAMETER_GET_DOUBLE(MASK, VARNAME) \
134if (bitmask & MASK) { \
135 value = irplib_parameterlist_get_double(self, PACKAGE, recipe, VARNAME); \
137 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), return(0.0), \
138 "mask=0x%llx", MASK); \
146#define VISIR_PARAMETER_GET_STRING(MASK, VARNAME) \
147if (bitmask & MASK) { \
148 value = irplib_parameterlist_get_string(self, PACKAGE, recipe, VARNAME); \
150 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), return(NULL),\
151 "mask=0x%llx", MASK); \
182 visir_parameter bitmask)
187 visir_parameter chkmask = 0;
188 cpl_boolean zerodist = CPL_FALSE;
189 cpl_boolean dostrip = CPL_TRUE;
192 cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
193 cpl_ensure_code(recipe, CPL_ERROR_NULL_INPUT);
195 context = cpl_sprintf(PACKAGE
".%s", recipe);
198 VISIR_PARAMETER_SET(VISIR_PARAM_NODPOS,
"nodding", CPL_TYPE_STRING,
199 "An optional ASCII specification of the nodding positions "
200 "(in case they are missing from the FITS-file). "
201 "The file must consist of one line per input FITS-file "
202 "and each line must consist of an integer (which is "
203 "ignored) followed by a 0 or 1 (to indicate object or sky). ",
204 VISIR_STR_PAR_EMPTY,
"nod");
207 VISIR_PARAMETER_SET(VISIR_PARAM_AUTOBPM,
"auto_bpm", CPL_TYPE_BOOL,
208 "Automatic detection and correction of bad pixels",
212 VISIR_PARAMETER_SET(VISIR_PARAM_GLITCH,
"rem_glitch", CPL_TYPE_BOOL,
213 "Automatic filtering of glitches", FALSE,
"g");
216 VISIR_PARAMETER_SET(VISIR_PARAM_PURGE,
"purge_bad", CPL_TYPE_BOOL,
217 "Automatic purging of half-cycle images whose median "
218 "deviates more than a factor three from the mean of "
219 "the medians of half-cycle images or whose standard "
220 "deviation deviates more than a factor three from the "
221 "mean of their standard deviations", FALSE,
"p");
224 VISIR_PARAMETER_SET(VISIR_PARAM_UNION,
"union", CPL_TYPE_BOOL,
225 "Combine images using their union, as opposed to their "
226 "intersection (deprecated and ignored, "
227 "see --combine_method)", TRUE,
"union");
230 VISIR_PARAMETER_SET(VISIR_PARAM_REJECT,
"rej", CPL_TYPE_STRING,
231 "Each resulting pixel is the average of the "
232 "corresponding (interpolated) pixel value in each "
233 "jittered image. A positive value, n1, for the first "
234 "of the two integers specifies that for each pixel the "
235 "smallest n1 pixel values shall be ignored in the "
236 "averaging. Similarly, a positive value, n2, for the "
237 "second of the two integers specifies that for each "
238 "pixel the largest n2 pixel values shall be ignored in "
239 "the averaging.",
"0-0",
"rej");
241 VISIR_PARAMETER_SET(VISIR_PARAM_BKG_CORRECT,
"bkgcorrect", CPL_TYPE_BOOL,
242 "Subtract the median from the spectral column before "
243 "extracting the wavelength. This is required when "
244 "the skylines do not correctly cancel due to gratting "
245 "oscillations", TRUE,
"bkgcorrect");
248 VISIR_PARAMETER_SET(VISIR_PARAM_PLOT,
"plot", CPL_TYPE_INT,
249 visir_plot_manpage, 0,
"plot");
251 if (bitmask & VISIR_PARAM_ZERODIST) {
252 bitmask ^= VISIR_PARAM_ZERODIST;
263 VISIR_PARAMETER_SET(VISIR_PARAM_SLITSKEW,
"phi", CPL_TYPE_DOUBLE,
264 "Distortion correction: Skew of slit (degrees) "
265 "(clockwise)", zerodist ? 0.0 : 0.52,
"slit_skew");
270 VISIR_PARAMETER_SET(VISIR_PARAM_SPECSKEW,
"ksi", CPL_TYPE_DOUBLE,
271 "Distortion correction: LMR Skew of spectrum (degrees) "
272 "(counter-clockwise). Not used in High Resolution",
273 zerodist ? 0.0 : 1.73,
"spectrum_skew");
277 VISIR_PARAMETER_SET(VISIR_PARAM_VERTARC,
"eps", CPL_TYPE_DOUBLE,
278 "Distortion correction: LR Detector vertical curvature "
279 "(pixel). Reduced by a factor 4 in MR. Not used in HR "
280 "A-side. Increased by a factor 115/52 in HR B-side",
281 zerodist ? 0.0 : -0.8,
"vert_arc");
285 VISIR_PARAMETER_SET(VISIR_PARAM_HORIARC,
"delta", CPL_TYPE_DOUBLE,
286 "Distortion correction: LMR Detector horizontal "
287 "curvature (pixel). Increased by a factor 1.5 in HR "
288 "A-side. Reduced by a factor 2 in HR B-side",
289 zerodist ? 0.0 : 0,
"hori_arc");
292 VISIR_PARAMETER_SET(VISIR_PARAM_ORDEROFF,
"orderoffset", CPL_TYPE_INT,
293 "Echelle order offset. The offset is relative to the "
294 "main order. The allowed range of offsets depend on "
295 "the selected grism. The offset can never exceed +/-4. "
296 "If the main order is e.g. 8 an order offset of +1 "
297 "will cause the recipe to base the data reduction on "
298 "order 9. With a positive order offset the central "
299 "wavelength becomes smaller while for a negative "
300 "order offset the central wavelength becomes larger.", 0,
304 VISIR_PARAMETER_SET(VISIR_PARAM_OFFSETS,
"offsets", CPL_TYPE_STRING,
305 "An optional ASCII specification of the offsets "
306 "in case those in FITS-headers are missing or wrong. "
307 "The file must consist of one line per input pair of "
308 "FITS-files, and each line must consist of two "
309 "numbers which represent the shift in pixels of that "
310 "image relative to the first image. The first line "
311 "should thus comprise two zeros. Correct FITS-header "
312 "offsets mean that the i'th X offset can be gotten "
313 "from Xoffset_0 - Xoffset_i, where Xoffset_i is the "
314 "value of " VISIR_PFITS_DOUBLE_CUMOFFSETX
" and "
315 "likewise for Y.", VISIR_STR_PAR_EMPTY,
"off");
317 VISIR_PARAMETER_SET(VISIR_PARAM_REFINE,
"refine", CPL_TYPE_BOOL,
318 "User-defined refining of the image offsets. See "
319 "options objs and xcorr", FALSE,
"ref");
321 VISIR_PARAMETER_SET(VISIR_PARAM_OBJECTS,
"objects", CPL_TYPE_STRING,
322 "The shift and add of images needs anchor points that "
323 "typically are bright objects. These are normally "
324 "detected automatically but with user-defined refining "
325 "of offsets enabled, they must be provided by the user "
326 "through an ASCII file containing one line per anchor "
327 "point with each line consisting of its x and y "
328 "coordinate (in pixels). This file is ignored with "
329 "user-defined refining of offsets disabled.",
330 VISIR_STR_PAR_EMPTY,
"objs");
334 VISIR_PARAMETER_SET(VISIR_PARAM_XCORR,
"xcorr", CPL_TYPE_STRING,
335 "If user-defined refining of offsets is enabled a "
336 "cross-correlation of the images is performed. In "
337 "order to speed up this process, this cross-"
338 "correlation is performed only on smaller rectangles "
339 "around the anchor points. The first two parameters "
340 "is the half-size of this rectangle in pixels. The "
341 "second pair is the maximum shift in x and y (pixels) "
342 "evaluated by the cross-correlation on the rectangle. "
343 "Used only if user-defined refining of offsets is enabled.",
344 "10-10-25-25",
"xcorr");
347 VISIR_PARAMETER_SET(VISIR_PARAM_JYVAL,
"jy_val", CPL_TYPE_DOUBLE,
348 "The flux of the standard star in Jansky",
352 VISIR_PARAMETER_SET(VISIR_PARAM_RADII,
"radii", CPL_TYPE_STRING,
353 "Radii : star_max bg_int bg_ext. "
354 "If set to \"default\", "
355 "the value 20-20-30 is used for DRS data, "
356 "and 40-40-50 for Aquarius data.",
360 VISIR_PARAMETER_SET(VISIR_PARAM_LOWLIM,
"low", CPL_TYPE_DOUBLE,
361 "Low threshold for the bad pixel map",
365 VISIR_PARAMETER_SET(VISIR_PARAM_HIGHLIM,
"high", CPL_TYPE_DOUBLE,
366 "High threshold for the bad pixel map",
370 VISIR_PARAMETER_SET(VISIR_PARAM_FIXCOMBI,
"fixcombi", CPL_TYPE_BOOL,
371 "Perform the distortion correction on the combined "
372 "image, and not on each of the jittered images. "
373 "This will reduce excution time and degrade the quality "
374 "of the combined image",
378 VISIR_PARAMETER_SET(VISIR_PARAM_EMIS_TOL,
"emis_tol", CPL_TYPE_DOUBLE,
379 "The computation of the mean and standard deviation "
380 "of the sensitivity is done for wavelengths with an "
381 "atmospheric emissivity of at most "
382 "emis_min + emis_tol * (emis_max - emis_min), where "
383 "emis_min is the minimum emissivity in the observed "
384 "wavelength range and emis_max is the ditto maximum. "
385 "Thus emis_tol = 1 means that all wavelengths are "
390 VISIR_PARAMETER_SET(VISIR_PARAM_QEFF,
"qeff", CPL_TYPE_DOUBLE,
395 VISIR_PARAMETER_SET(VISIR_PARAM_REJBORD,
"rej_bord", CPL_TYPE_STRING,
396 "Rejected left right bottom and top border (pixel)",
400 VISIR_PARAMETER_SET(VISIR_PARAM_HOT_LIM,
"hot_threshold", CPL_TYPE_DOUBLE,
401 "Hot pixel map threshold", 10.0,
"hot_t");
404 VISIR_PARAMETER_SET(VISIR_PARAM_COLD_LIM,
"cold_threshold", CPL_TYPE_DOUBLE,
405 "Cold pixel map threshold", 6.0,
"cold_t");
408 VISIR_PARAMETER_SET(VISIR_PARAM_DEV_LIM,
"dev_threshold", CPL_TYPE_DOUBLE,
409 "Deviant pixel map threshold", 5.0,
"dev_t");
412 VISIR_PARAMETER_SET(VISIR_PARAM_NSAMPLES,
"nsamples", CPL_TYPE_INT,
413 "Number of samples for Read-Out Noise (RON) computation",
417 VISIR_PARAMETER_SET(VISIR_PARAM_HALFSIZE,
"hsize", CPL_TYPE_INT,
418 "Half size of the window for Read-Out Noise (RON) "
419 "computation", 2,
"hsize");
423 VISIR_PARAMETER_SET(VISIR_PARAM_COMBINE,
"comb_meth", CPL_TYPE_STRING,
424 "Combine images using one of: 1) Onto the first image "
425 "(first); 2) Their union (union); 3) Their intersection"
426 " (inter). NB: Only the 'first'-method produces an "
427 "image product with WCS coordinates. A successful "
428 "'first'-method always produces a combined image with "
429 "dimensions equal to those of the input images. "
430 "For the 'union'-method the result image is at least "
431 "as large as the input images while for the 'inter'-"
432 "method the result image is at most as large as the "
433 "input images",
"union",
"combine_method");
435 if (bitmask & VISIR_PARAM_STRIPNON) {
436 bitmask ^= VISIR_PARAM_STRIPNON;
443 VISIR_PARAMETER_SET(VISIR_PARAM_STRIPITE,
"nstripe",
444 CPL_TYPE_INT,
"Max number of destriping iterations "
445 "(0 to disable destriping). Horizontal destriping is "
446 "done first and if no horizontal striping is detected, "
447 "vertical destriping is performed", dostrip ? 15 : 0,
448 "destripe_iterations");
451 VISIR_PARAMETER_SET(VISIR_PARAM_STRIPMOR,
"mstripe", CPL_TYPE_BOOL,
452 "Destripe with morphological cleaning", FALSE,
456 VISIR_PARAMETER_SET(VISIR_PARAM_REJLEFT,
"reject_left", CPL_TYPE_INT,
457 "Reject leftmost columns in spectrum extraction, zero "
458 "means all columns on the left are used. In cross-"
459 "dispersion mode a (small) negative number may be used "
463 VISIR_PARAMETER_SET(VISIR_PARAM_REJRIGHT,
"reject_right", CPL_TYPE_INT,
464 "Reject rightmost columns in spectrum extraction, zero "
465 "means all columns on the right are used. In cross-"
466 "dispersion mode a (small) negative number may be used "
470 VISIR_PARAMETER_SET(VISIR_PARAM_APERT_FILE,
"apfile", CPL_TYPE_STRING,
471 "An optional ASCII file specification of the aperture "
472 "definitions to use during spectral extraction. "
473 "Each line must contain either 3 fields for optimal "
474 "extraction, or an even number of fields greater than 5 "
475 "for aperture extraction. For optimal extraction, the "
476 "1st field should be 'O', and for aperture extraction "
477 "it should be 'A'. In both cases the next pair of fields "
478 "indicate the left & right edges of the source aperture "
479 "in pixel coordinates. For aperture extraction, fields "
480 "after the 3rd define the sky apertures coordinates, "
481 "with the 4th field indicating the method used to "
482 "determine the sky background [one of 'A' (average), "
483 "'F' (linear fit), or 'M' (median)] followed by at "
484 "least one pair of pixel coordinates representing the "
485 "left & right edge of a sky aperture. You may supply "
486 "more sky apertures by supplying additional pixel "
487 "coordinate pairs after the first. Multiple lines "
488 "targeting the same order are allowed.",
489 VISIR_STR_PAR_EMPTY,
"apfile");
492 VISIR_PARAMETER_SET(VISIR_PARAM_RONOISE,
"ron", CPL_TYPE_DOUBLE,
493 "Readout noise of the detector",
497 VISIR_PARAMETER_SET(VISIR_PARAM_ECCMAX,
"eccmax", CPL_TYPE_DOUBLE,
498 "The maximum eccentricity allowed in the combination "
499 "of the three (in parallel nod/chopping) or four (in "
500 "perpendicular nod/chopping) beams. In parallel mode, "
501 "three perfectly aligned points spaced with the "
502 "chopnod throw will have eccentricity 0, while in "
503 "perpedicular mode a square with the chopnod throw as "
504 "the side length will have eccentricity 0",
508 VISIR_PARAMETER_SET(VISIR_PARAM_OXSIGMA,
"optex_sigma", CPL_TYPE_DOUBLE,
509 "Sigma to use for clipping in optimal extraction",
513 VISIR_PARAMETER_SET(VISIR_PARAM_OXNITER,
"optex_niters", CPL_TYPE_INT,
514 "Number of optimal extraction iterations to perform",
518 VISIR_PARAMETER_SET(VISIR_PARAM_OXSMOOTH,
"optex_smooth", CPL_TYPE_INT,
519 "Width of smoothing window to use along spectral "
520 "dimension during optimal extraction. A median filter "
525 VISIR_PARAMETER_SET(VISIR_PARAM_GAIN,
"gain", CPL_TYPE_DOUBLE,
530 VISIR_PARAMETER_SET(VISIR_PARAM_OXKERNEL,
"optex_kernel", CPL_TYPE_INT,
531 "Size of square smoothing kernel, in pixels, to apply "
532 "to science frame before optimal extraction (ignored "
533 "during aperture extraction). A median filter is used.",
537 VISIR_PARAMETER_SET(VISIR_PARAM_RESPCAL,
"respcal", CPL_TYPE_STRING,
538 "An optional path to a FITS file containing a 1-D "
539 "fringe model to be divided into the 1-D extracted "
540 "spectra in order to remove the fringes.",
541 VISIR_STR_PAR_EMPTY,
"respcal");
545 cpl_ensure_code(!cpl_error_get_code(), cpl_error_get_code());
546 cpl_ensure_code(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE);
548 return CPL_ERROR_NONE;
564 visir_parameter bitmask)
568 cpl_boolean value = CPL_FALSE;
571 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), CPL_FALSE);
572 cpl_ensure(self, CPL_ERROR_NULL_INPUT, CPL_FALSE);
573 cpl_ensure(recipe, CPL_ERROR_NULL_INPUT, CPL_FALSE);
576 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_AUTOBPM,
"auto_bpm");
579 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_GLITCH,
"rem_glitch");
582 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_PURGE,
"purge_bad");
584 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_REFINE,
"refine");
587 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_FIXCOMBI,
"fixcombi");
590 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_STRIPMOR,
"mstripe");
593 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_BKG_CORRECT,
"bkgcorrect");
596 cpl_ensure(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE, CPL_FALSE);
597 cpl_ensure(nbits == 1, CPL_ERROR_ILLEGAL_INPUT, CPL_FALSE);
617 visir_parameter bitmask)
624 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), 0);
625 cpl_ensure(self, CPL_ERROR_NULL_INPUT, 0);
626 cpl_ensure(recipe, CPL_ERROR_NULL_INPUT, 0);
630 VISIR_PARAMETER_GET_INT(VISIR_PARAM_PLOT,
"plot");
633 VISIR_PARAMETER_GET_INT(VISIR_PARAM_ORDEROFF,
"orderoffset");
636 VISIR_PARAMETER_GET_INT(VISIR_PARAM_NSAMPLES,
"nsamples");
639 VISIR_PARAMETER_GET_INT(VISIR_PARAM_HALFSIZE,
"hsize");
642 VISIR_PARAMETER_GET_INT(VISIR_PARAM_STRIPITE,
"nstripe");
645 VISIR_PARAMETER_GET_INT(VISIR_PARAM_REJLEFT,
"reject_left");
648 VISIR_PARAMETER_GET_INT(VISIR_PARAM_REJRIGHT,
"reject_right");
651 VISIR_PARAMETER_GET_INT(VISIR_PARAM_OXNITER,
"optex_niters");
654 VISIR_PARAMETER_GET_INT(VISIR_PARAM_OXSMOOTH,
"optex_smooth");
657 VISIR_PARAMETER_GET_INT(VISIR_PARAM_OXKERNEL,
"optex_kernel");
660 cpl_ensure(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE, 0);
661 cpl_ensure(nbits == 1, CPL_ERROR_ILLEGAL_INPUT, 0);
680 visir_parameter bitmask)
684 double value = DBL_MAX;
687 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), 0.0);
688 cpl_ensure(self, CPL_ERROR_NULL_INPUT, 0.0);
689 cpl_ensure(recipe, CPL_ERROR_NULL_INPUT, 0.0);
692 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_SLITSKEW,
"phi");
695 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_SPECSKEW,
"ksi");
698 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_VERTARC,
"eps");
701 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_HORIARC,
"delta");
704 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_RONOISE,
"ron");
707 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_JYVAL,
"jy_val");
710 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_LOWLIM,
"low");
713 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_HIGHLIM,
"high");
716 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_EMIS_TOL,
"emis_tol");
719 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_QEFF,
"qeff");
722 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_HOT_LIM,
"hot_threshold");
725 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_COLD_LIM,
"cold_threshold");
728 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_DEV_LIM,
"dev_threshold");
731 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_ECCMAX,
"eccmax");
734 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_OXSIGMA,
"optex_sigma");
737 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_GAIN,
"gain");
739 cpl_ensure(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE, 0.0);
740 cpl_ensure(nbits == 1, CPL_ERROR_ILLEGAL_INPUT, 0.0);
760 visir_parameter bitmask)
764 const char * value = NULL;
765 const cpl_boolean is_combine
766 = bitmask & VISIR_PARAM_COMBINE ? CPL_TRUE : CPL_FALSE;
768 cpl_ensure(self, CPL_ERROR_NULL_INPUT, NULL);
769 cpl_ensure(recipe, CPL_ERROR_NULL_INPUT, NULL);
772 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_NODPOS,
"nodding");
775 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_REJECT,
"rej");
778 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_OFFSETS,
"offsets");
780 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_REFINE,
"refine");
782 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_OBJECTS,
"objects");
785 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_XCORR,
"xcorr");
788 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_RADII,
"radii");
791 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_REJBORD,
"rej_bord");
794 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_COMBINE,
"comb_meth");
797 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_APERT_FILE,
"apfile");
800 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_RESPCAL,
"respcal");
802 cpl_ensure(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE, NULL);
803 cpl_ensure(nbits == 1, CPL_ERROR_ILLEGAL_INPUT, NULL);
805 assert(value != NULL);
809 cpl_ensure(strcmp(value,
"first") == 0 || strcmp(value,
"union") == 0 ||
810 strcmp(value,
"intersect") == 0, CPL_ERROR_UNSUPPORTED_MODE,
cpl_error_code visir_parameter_set(cpl_parameterlist *self, const char *recipe, visir_parameter bitmask)
Define the specified parameters.
int visir_parameterlist_get_int(const cpl_parameterlist *self, const char *recipe, visir_parameter bitmask)
Retrieve the value of a VISIR integer parameter.
const char * visir_parameterlist_get_string(const cpl_parameterlist *self, const char *recipe, visir_parameter bitmask)
Retrieve the value of a VISIR string parameter.
double visir_parameterlist_get_double(const cpl_parameterlist *self, const char *recipe, visir_parameter bitmask)
Retrieve the value of a VISIR parameter of type double.
cpl_boolean visir_parameterlist_get_bool(const cpl_parameterlist *self, const char *recipe, visir_parameter bitmask)
Retrieve the value of a VISIR boolean parameter.