00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifdef HAVE_CONFIG_H
00029 #include <config.h>
00030 #endif
00031
00032
00033
00034
00035
00036 #include <string.h>
00037 #include <math.h>
00038 #include <float.h>
00039 #include <assert.h>
00040 #include <cpl.h>
00041
00042 #include "irplib_utils.h"
00043
00044 #include "visir_parameter.h"
00045 #include "visir_dfs.h"
00046 #include "visir_pfits.h"
00047
00048
00049
00050
00051
00052 #define visir_plot_manpage \
00053 "The recipe can produce a number of predefined plots. " \
00054 "Zero means that none of the plots are produced, while " \
00055 "increasing values (e.g. 1 or 2) increases the number " \
00056 "of plots produced. If the plotting fails a warning is " \
00057 "produced, and the recipe continues. " \
00058 "The default behaviour of the plotting is to use " \
00059 "gnuplot (with option -persist). The recipe currently " \
00060 "produces 1D-plots using gnuplot commands. The recipe " \
00061 "user can control the actual plotting-command used by " \
00062 "the recipe to create the plot by setting the " \
00063 "environment variable CPL_PLOTTER. Currently, if " \
00064 "CPL_PLOTTER " \
00065 "is set it must contain the string 'gnuplot'. Setting " \
00066 "it to 'cat > my_gnuplot_$$.txt' causes a number of " \
00067 "ASCII-files to be created, which each produce a plot " \
00068 "when given as standard input to gnuplot (e.g. later " \
00069 "or on a different computer). A finer control of the " \
00070 "plotting options can be obtained by writing an " \
00071 "executable script, e.g. my_gnuplot.pl, that " \
00072 "executes gnuplot after setting the desired gnuplot " \
00073 "options (e.g. set terminal pslatex color) " \
00074 "and then setting CPL_PLOTTER to my_gnuplot.pl. " \
00075 "The predefined plots include plotting of images. " \
00076 "Images can be plotted not only with gnuplot, but also " \
00077 "using the pnm format. This is controlled with the " \
00078 "environment variable CPL_IMAGER. If CPL_IMAGER " \
00079 "is set to a string that does not contain the word " \
00080 "gnuplot, the recipe will generate the plot in pnm " \
00081 "format. E.g. setting CPL_IMAGER to " \
00082 "'display - &' will produce a gray-scale image " \
00083 "using the image viewer display."
00084
00085
00086
00087
00088 #define VISIR_PARAMETER_SET(MASK, VARNAME, TYPE, MAN, DEFAULT, SHORT) \
00089 if (bitmask & MASK) { \
00090 char * paramname = cpl_sprintf(PACKAGE ".%s." VARNAME, recipe); \
00091 \
00092 p = cpl_parameter_new_value(paramname, TYPE, MAN, context, DEFAULT); \
00093 cpl_free(paramname); \
00094 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, SHORT); \
00095 cpl_parameterlist_append(self, p); \
00096 \
00097 (void)cpl_error_set_where(cpl_func); \
00098 \
00099 bitmask ^= MASK; \
00100 \
00101 \
00102 if (chkmask & MASK) \
00103 (void)cpl_error_set(cpl_func, CPL_ERROR_UNSPECIFIED); \
00104 chkmask |= MASK; \
00105 }
00106
00107
00108 #define VISIR_PARAMETER_GET_BOOL(MASK, VARNAME) \
00109 if (bitmask & MASK) { \
00110 value = irplib_parameterlist_get_bool(self, PACKAGE, recipe, VARNAME); \
00111 \
00112 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), \
00113 return(CPL_FALSE), "mask=0x%llx", MASK); \
00114 nbits++; \
00115 bitmask ^= MASK; \
00116 \
00117 }
00118
00119
00120 #define VISIR_PARAMETER_GET_INT(MASK, VARNAME) \
00121 if (bitmask & MASK) { \
00122 value = irplib_parameterlist_get_int(self, PACKAGE, recipe, VARNAME); \
00123 \
00124 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), return(0), \
00125 "mask=0x%llx", MASK); \
00126 \
00127 nbits++; \
00128 bitmask ^= MASK; \
00129 \
00130 }
00131
00132
00133 #define VISIR_PARAMETER_GET_DOUBLE(MASK, VARNAME) \
00134 if (bitmask & MASK) { \
00135 value = irplib_parameterlist_get_double(self, PACKAGE, recipe, VARNAME); \
00136 \
00137 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), return(0.0), \
00138 "mask=0x%llx", MASK); \
00139 \
00140 nbits++; \
00141 bitmask ^= MASK; \
00142 \
00143 }
00144
00145
00146 #define VISIR_PARAMETER_GET_STRING(MASK, VARNAME) \
00147 if (bitmask & MASK) { \
00148 value = irplib_parameterlist_get_string(self, PACKAGE, recipe, VARNAME); \
00149 \
00150 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), return(NULL),\
00151 "mask=0x%llx", MASK); \
00152 \
00153 nbits++; \
00154 bitmask ^= MASK; \
00155 \
00156 }
00157
00158
00159
00165
00166
00170
00179
00180 cpl_error_code visir_parameter_set(cpl_parameterlist * self,
00181 const char * recipe,
00182 visir_parameter bitmask)
00183 {
00184
00185 cpl_parameter * p;
00186 char * context;
00187 visir_parameter chkmask = 0;
00188 cpl_boolean zerodist = CPL_FALSE;
00189 cpl_boolean dostrip = CPL_TRUE;
00190
00191
00192 cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
00193 cpl_ensure_code(recipe, CPL_ERROR_NULL_INPUT);
00194
00195 context = cpl_sprintf(PACKAGE ".%s", recipe);
00196
00197
00198 VISIR_PARAMETER_SET(VISIR_PARAM_NODPOS, "nodding", CPL_TYPE_STRING,
00199 "An optional ASCII specification of the nodding positions "
00200 "(in case they are missing from the FITS-file). "
00201 "The file must consist of one line per input FITS-file "
00202 "and each line must consist of an integer (which is "
00203 "ignored) followed by a 0 or 1 (to indicate object or sky). ",
00204 VISIR_STR_PAR_EMPTY, "nod");
00205
00206
00207 VISIR_PARAMETER_SET(VISIR_PARAM_AUTOBPM, "auto_bpm", CPL_TYPE_BOOL,
00208 "Automatic detection and correction of bad pixels",
00209 TRUE, "auto_bpm");
00210
00211
00212 VISIR_PARAMETER_SET(VISIR_PARAM_GLITCH, "rem_glitch", CPL_TYPE_BOOL,
00213 "Automatic filtering of glitches", FALSE, "g");
00214
00215
00216 VISIR_PARAMETER_SET(VISIR_PARAM_PURGE, "purge_bad", CPL_TYPE_BOOL,
00217 "Automatic purging of half-cycle images whose median "
00218 "deviates more than a factor three from the mean of "
00219 "the medians of half-cycle images or whose standard "
00220 "deviation deviates more than a factor three from the "
00221 "mean of their standard deviations", FALSE, "p");
00222
00223
00224 VISIR_PARAMETER_SET(VISIR_PARAM_UNION, "union", CPL_TYPE_BOOL,
00225 "Combine images using their union, as opposed to their "
00226 "intersection (deprecated and ignored, "
00227 "see --combine_method)", TRUE, "union");
00228
00229
00230 VISIR_PARAMETER_SET(VISIR_PARAM_REJECT, "rej", CPL_TYPE_STRING,
00231 "Each resulting pixel is the average of the "
00232 "corresponding (interpolated) pixel value in each "
00233 "jittered image. A positive value, n1, for the first "
00234 "of the two integers specifies that for each pixel the "
00235 "smallest n1 pixel values shall be ignored in the "
00236 "averaging. Similarly, a positive value, n2, for the "
00237 "second of the two integers specifies that for each "
00238 "pixel the largest n2 pixel values shall be ignored in "
00239 "the averaging.", "0-0", "rej");
00240
00241 VISIR_PARAMETER_SET(VISIR_PARAM_BKG_CORRECT, "bkgcorrect", CPL_TYPE_BOOL,
00242 "Subtract the median from the spectral column before "
00243 "extracting the wavelength. This is required when "
00244 "the skylines do not correctly cancel due to gratting "
00245 "oscillations", FALSE, "bkgcorrect");
00246
00247
00248 VISIR_PARAMETER_SET(VISIR_PARAM_PLOT, "plot", CPL_TYPE_INT,
00249 visir_plot_manpage, 0, "plot");
00250
00251 if (bitmask & VISIR_PARAM_ZERODIST) {
00252 bitmask ^= VISIR_PARAM_ZERODIST;
00253
00254
00255 zerodist = CPL_TRUE;
00256 }
00257
00258
00259
00260
00261
00262
00263 VISIR_PARAMETER_SET(VISIR_PARAM_SLITSKEW, "phi", CPL_TYPE_DOUBLE,
00264 "Distortion correction: Skew of slit (degrees) "
00265 "(clockwise)", zerodist ? 0.0 : 0.52, "slit_skew");
00266
00267
00268
00269
00270 VISIR_PARAMETER_SET(VISIR_PARAM_SPECSKEW, "ksi", CPL_TYPE_DOUBLE,
00271 "Distortion correction: LMR Skew of spectrum (degrees) "
00272 "(counter-clockwise). Not used in High Resolution",
00273 zerodist ? 0.0 : 1.73, "spectrum_skew");
00274
00275
00276
00277 VISIR_PARAMETER_SET(VISIR_PARAM_VERTARC, "eps", CPL_TYPE_DOUBLE,
00278 "Distortion correction: LR Detector vertical curvature "
00279 "(pixel). Reduced by a factor 4 in MR. Not used in HR "
00280 "A-side. Increased by a factor 115/52 in HR B-side",
00281 zerodist ? 0.0 : -0.8, "vert_arc");
00282
00283
00284
00285 VISIR_PARAMETER_SET(VISIR_PARAM_HORIARC, "delta", CPL_TYPE_DOUBLE,
00286 "Distortion correction: LMR Detector horizontal "
00287 "curvature (pixel). Increased by a factor 1.5 in HR "
00288 "A-side. Reduced by a factor 2 in HR B-side",
00289 zerodist ? 0.0 : 0, "hori_arc");
00290
00291
00292 VISIR_PARAMETER_SET(VISIR_PARAM_ORDEROFF, "orderoffset", CPL_TYPE_INT,
00293 "Echelle order offset. The offset is relative to the "
00294 "main order. The allowed range of offsets depend on "
00295 "the selected grism. The offset can never exceed +/-4. "
00296 "If the main order is e.g. 8 an order offset of +1 "
00297 "will cause the recipe to base the data reduction on "
00298 "order 9. With a positive order offset the central "
00299 "wavelength becomes smaller while for a negative "
00300 "order offset the central wavelength becomes larger.", 0,
00301 "orderoffset");
00302
00303
00304 VISIR_PARAMETER_SET(VISIR_PARAM_OFFSETS, "offsets", CPL_TYPE_STRING,
00305 "An optional ASCII specification of the offsets "
00306 "in case those in FITS-headers are missing or wrong. "
00307 "The file must consist of one line per input pair of "
00308 "FITS-files, and each line must consist of two "
00309 "numbers which represent the shift in pixels of that "
00310 "image relative to the first image. The first line "
00311 "should thus comprise two zeros. Correct FITS-header "
00312 "offsets mean that the i'th X offset can be gotten "
00313 "from Xoffset_0 - Xoffset_i, where Xoffset_i is the "
00314 "value of " VISIR_PFITS_DOUBLE_CUMOFFSETX " and "
00315 "likewise for Y.", VISIR_STR_PAR_EMPTY, "off");
00316
00317 VISIR_PARAMETER_SET(VISIR_PARAM_REFINE, "refine", CPL_TYPE_BOOL,
00318 "User-defined refining of the image offsets. See "
00319 "options objs and xcorr", FALSE, "ref");
00320
00321 VISIR_PARAMETER_SET(VISIR_PARAM_OBJECTS, "objects", CPL_TYPE_STRING,
00322 "The shift and add of images needs anchor points that "
00323 "typically are bright objects. These are normally "
00324 "detected automatically but with user-defined refining "
00325 "of offsets enabled, they must be provided by the user "
00326 "through an ASCII file containing one line per anchor "
00327 "point with each line consisting of its x and y "
00328 "coordinate (in pixels). This file is ignored with "
00329 "user-defined refining of offsets disabled.",
00330 VISIR_STR_PAR_EMPTY, "objs");
00331
00332
00333
00334 VISIR_PARAMETER_SET(VISIR_PARAM_XCORR, "xcorr", CPL_TYPE_STRING,
00335 "If user-defined refining of offsets is enabled a "
00336 "cross-correlation of the images is performed. In "
00337 "order to speed up this process, this cross-"
00338 "correlation is performed only on smaller rectangles "
00339 "around the anchor points. The first two parameters "
00340 "is the half-size of this rectangle in pixels. The "
00341 "second pair is the maximum shift in x and y (pixels) "
00342 "evaluated by the cross-correlation on the rectangle. "
00343 "Used only if user-defined refining of offsets is enabled.",
00344 "10-10-25-25", "xcorr");
00345
00346
00347 VISIR_PARAMETER_SET(VISIR_PARAM_JYVAL, "jy_val", CPL_TYPE_DOUBLE,
00348 "The flux of the standard star in Jansky",
00349 -999.0, "jy_val");
00350
00351
00352 VISIR_PARAMETER_SET(VISIR_PARAM_RADII, "radii", CPL_TYPE_STRING,
00353 "Radii : star_max bg_int bg_ext",
00354 "20-20-30", "radii");
00355
00356
00357 VISIR_PARAMETER_SET(VISIR_PARAM_LOWLIM, "low", CPL_TYPE_DOUBLE,
00358 "Low threshold for the bad pixel map",
00359 0.2, "low");
00360
00361
00362 VISIR_PARAMETER_SET(VISIR_PARAM_HIGHLIM, "high", CPL_TYPE_DOUBLE,
00363 "High threshold for the bad pixel map",
00364 5.0, "high");
00365
00366
00367 VISIR_PARAMETER_SET(VISIR_PARAM_FIXCOMBI, "fixcombi", CPL_TYPE_BOOL,
00368 "Perform the distortion correction on the combined "
00369 "image, and not on each of the jittered images. "
00370 "This will reduce excution time and degrade the quality "
00371 "of the combined image",
00372 FALSE, "fixcombi");
00373
00374
00375 VISIR_PARAMETER_SET(VISIR_PARAM_EMIS_TOL, "emis_tol", CPL_TYPE_DOUBLE,
00376 "The computation of the mean and standard deviation "
00377 "of the sensitivity is done for wavelengths with an "
00378 "atmospheric emissivity of at most "
00379 "emis_min + emis_tol * (emis_max - emis_min), where "
00380 "emis_min is the minimum emissivity in the observed "
00381 "wavelength range and emis_max is the ditto maximum. "
00382 "Thus emis_tol = 1 means that all wavelengths are "
00383 "included.",
00384 1.0, "emis_tol");
00385
00386
00387 VISIR_PARAMETER_SET(VISIR_PARAM_QEFF, "qeff", CPL_TYPE_DOUBLE,
00388 "Ignored",
00389 1.0, "qeff");
00390
00391
00392 VISIR_PARAMETER_SET(VISIR_PARAM_REJBORD, "rej_bord", CPL_TYPE_STRING,
00393 "Rejected left right bottom and top border (pixel)",
00394 "50 50 50 50", "r");
00395
00396
00397 VISIR_PARAMETER_SET(VISIR_PARAM_HOT_LIM, "hot_threshold", CPL_TYPE_DOUBLE,
00398 "Hot pixel map threshold", 10.0, "hot_t");
00399
00400
00401 VISIR_PARAMETER_SET(VISIR_PARAM_COLD_LIM, "cold_threshold", CPL_TYPE_DOUBLE,
00402 "Cold pixel map threshold", 6.0, "cold_t");
00403
00404
00405 VISIR_PARAMETER_SET(VISIR_PARAM_DEV_LIM, "dev_threshold", CPL_TYPE_DOUBLE,
00406 "Deviant pixel map threshold", 5.0, "dev_t");
00407
00408
00409 VISIR_PARAMETER_SET(VISIR_PARAM_NSAMPLES, "nsamples", CPL_TYPE_INT,
00410 "Number of samples for Read-Out Noise (RON) computation",
00411 100, "nsamples");
00412
00413
00414 VISIR_PARAMETER_SET(VISIR_PARAM_HALFSIZE, "hsize", CPL_TYPE_INT,
00415 "Half size of the window for Read-Out Noise (RON) "
00416 "computation", 2, "hsize");
00417
00418
00419
00420 VISIR_PARAMETER_SET(VISIR_PARAM_COMBINE, "comb_meth", CPL_TYPE_STRING,
00421 "Combine images using one of: 1) Onto the first image "
00422 "(first); 2) Their union (union); 3) Their intersection"
00423 " (inter). NB: Only the 'first'-method produces an "
00424 "image product with WCS coordinates. A successful "
00425 "'first'-method always produces a combined image with "
00426 "dimensions equal to those of the input images. "
00427 "For the 'union'-method the result image is at least "
00428 "as large as the input images while for the 'inter'-"
00429 "method the result image is at most as large as the "
00430 "input images", "union", "combine_method");
00431
00432 if (bitmask & VISIR_PARAM_STRIPNON) {
00433 bitmask ^= VISIR_PARAM_STRIPNON;
00434
00435
00436 dostrip = CPL_FALSE;
00437 }
00438
00439
00440 VISIR_PARAMETER_SET(VISIR_PARAM_STRIPITE, "nstripe",
00441 CPL_TYPE_INT, "Max number of destriping iterations "
00442 "(0 to disable destriping). Horizontal destriping is "
00443 "done first and if no horizontal striping is detected, "
00444 "vertical destriping is performed", dostrip ? 15 : 0,
00445 "destripe_iterations");
00446
00447
00448 VISIR_PARAMETER_SET(VISIR_PARAM_STRIPMOR, "mstripe", CPL_TYPE_BOOL,
00449 "Destripe with morphological cleaning", FALSE,
00450 "destripe_morpho");
00451
00452
00453 VISIR_PARAMETER_SET(VISIR_PARAM_REJLEFT, "reject_left", CPL_TYPE_INT,
00454 "Reject leftmost columns in spectrum extraction, zero "
00455 "means all columns on the left are used. In cross-"
00456 "dispersion mode a (small) negative number may be used "
00457 "(pixel)", 0, "rl");
00458
00459
00460 VISIR_PARAMETER_SET(VISIR_PARAM_REJRIGHT, "reject_right", CPL_TYPE_INT,
00461 "Reject rightmost columns in spectrum extraction, zero "
00462 "means all columns on the right are used. In cross-"
00463 "dispersion mode a (small) negative number may be used "
00464 "(pixel)", 0, "rr");
00465
00466
00467 VISIR_PARAMETER_SET(VISIR_PARAM_ECCMAX, "eccmax", CPL_TYPE_DOUBLE,
00468 "The maximum eccentricity allowed in the combination "
00469 "of the three (in parallel nod/chopping) or four (in "
00470 "perpendicular nod/chopping) beams. In parallel mode, "
00471 "three perfectly aligned points spaced with the "
00472 "chopnod throw will have eccentricity 0, while in "
00473 "perpedicular mode a square with the chopnod throw as "
00474 "the side length will have eccentricity 0",
00475 0.25, "eccmax");
00476
00477 cpl_free(context);
00478
00479 cpl_ensure_code(!cpl_error_get_code(), cpl_error_get_code());
00480 cpl_ensure_code(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE);
00481
00482 return CPL_ERROR_NONE;
00483 }
00484
00485
00495
00496 cpl_boolean visir_parameterlist_get_bool(const cpl_parameterlist * self,
00497 const char * recipe,
00498 visir_parameter bitmask)
00499 {
00500
00501 int nbits = 0;
00502 cpl_boolean value = CPL_FALSE;
00503
00504
00505 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), CPL_FALSE);
00506 cpl_ensure(self, CPL_ERROR_NULL_INPUT, CPL_FALSE);
00507 cpl_ensure(recipe, CPL_ERROR_NULL_INPUT, CPL_FALSE);
00508
00509
00510 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_AUTOBPM, "auto_bpm");
00511
00512
00513 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_GLITCH, "rem_glitch");
00514
00515
00516 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_PURGE, "purge_bad");
00517
00518 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_REFINE, "refine");
00519
00520
00521 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_FIXCOMBI, "fixcombi");
00522
00523
00524 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_STRIPMOR, "mstripe");
00525
00526
00527 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_BKG_CORRECT, "bkgcorrect");
00528
00529
00530 cpl_ensure(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE, CPL_FALSE);
00531 cpl_ensure(nbits == 1, CPL_ERROR_ILLEGAL_INPUT, CPL_FALSE);
00532
00533 return value;
00534
00535 }
00536
00537
00538
00548
00549 int visir_parameterlist_get_int(const cpl_parameterlist * self,
00550 const char * recipe,
00551 visir_parameter bitmask)
00552 {
00553
00554 int nbits = 0;
00555 int value = 0;
00556
00557
00558 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), 0);
00559 cpl_ensure(self, CPL_ERROR_NULL_INPUT, 0);
00560 cpl_ensure(recipe, CPL_ERROR_NULL_INPUT, 0);
00561
00562
00563
00564 VISIR_PARAMETER_GET_INT(VISIR_PARAM_PLOT, "plot");
00565
00566
00567 VISIR_PARAMETER_GET_INT(VISIR_PARAM_ORDEROFF, "orderoffset");
00568
00569
00570 VISIR_PARAMETER_GET_INT(VISIR_PARAM_NSAMPLES, "nsamples");
00571
00572
00573 VISIR_PARAMETER_GET_INT(VISIR_PARAM_HALFSIZE, "hsize");
00574
00575
00576 VISIR_PARAMETER_GET_INT(VISIR_PARAM_STRIPITE, "nstripe");
00577
00578
00579 VISIR_PARAMETER_GET_INT(VISIR_PARAM_REJLEFT, "reject_left");
00580
00581
00582 VISIR_PARAMETER_GET_INT(VISIR_PARAM_REJRIGHT, "reject_right");
00583
00584
00585 cpl_ensure(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE, 0);
00586 cpl_ensure(nbits == 1, CPL_ERROR_ILLEGAL_INPUT, 0);
00587
00588 return value;
00589
00590 }
00591
00592
00602
00603 double visir_parameterlist_get_double(const cpl_parameterlist * self,
00604 const char * recipe,
00605 visir_parameter bitmask)
00606 {
00607
00608 int nbits = 0;
00609 double value = DBL_MAX;
00610
00611
00612 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), 0.0);
00613 cpl_ensure(self, CPL_ERROR_NULL_INPUT, 0.0);
00614 cpl_ensure(recipe, CPL_ERROR_NULL_INPUT, 0.0);
00615
00616
00617 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_SLITSKEW, "phi");
00618
00619
00620 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_SPECSKEW, "ksi");
00621
00622
00623 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_VERTARC, "eps");
00624
00625
00626 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_HORIARC, "delta");
00627
00628
00629 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_JYVAL, "jy_val");
00630
00631
00632 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_LOWLIM, "low");
00633
00634
00635 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_HIGHLIM, "high");
00636
00637
00638 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_EMIS_TOL, "emis_tol");
00639
00640
00641 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_QEFF, "qeff");
00642
00643
00644 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_HOT_LIM, "hot_threshold");
00645
00646
00647 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_COLD_LIM, "cold_threshold");
00648
00649
00650 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_DEV_LIM, "dev_threshold");
00651
00652
00653 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_ECCMAX, "eccmax");
00654
00655 cpl_ensure(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE, 0.0);
00656 cpl_ensure(nbits == 1, CPL_ERROR_ILLEGAL_INPUT, 0.0);
00657
00658 return value;
00659
00660 }
00661
00662
00663
00664
00673
00674 const char * visir_parameterlist_get_string(const cpl_parameterlist * self,
00675 const char * recipe,
00676 visir_parameter bitmask)
00677 {
00678
00679 int nbits = 0;
00680 const char * value = NULL;
00681 const cpl_boolean is_combine
00682 = bitmask & VISIR_PARAM_COMBINE ? CPL_TRUE : CPL_FALSE;
00683
00684 cpl_ensure(self, CPL_ERROR_NULL_INPUT, NULL);
00685 cpl_ensure(recipe, CPL_ERROR_NULL_INPUT, NULL);
00686
00687
00688 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_NODPOS, "nodding");
00689
00690
00691 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_REJECT, "rej");
00692
00693
00694 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_OFFSETS, "offsets");
00695
00696 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_REFINE, "refine");
00697
00698 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_OBJECTS, "objects");
00699
00700
00701 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_XCORR, "xcorr");
00702
00703
00704 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_RADII, "radii");
00705
00706
00707 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_REJBORD, "rej_bord");
00708
00709
00710 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_COMBINE, "comb_meth");
00711
00712 cpl_ensure(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE, NULL);
00713 cpl_ensure(nbits == 1, CPL_ERROR_ILLEGAL_INPUT, NULL);
00714
00715 assert(value != NULL);
00716
00717
00718 if (is_combine)
00719 cpl_ensure(strcmp(value, "first") == 0 || strcmp(value, "union") == 0 ||
00720 strcmp(value, "intersect") == 0, CPL_ERROR_UNSUPPORTED_MODE,
00721 NULL);
00722
00723 return value;
00724
00725 }
00726