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 #include "irplib_plot.h"
00044
00045 #include "visir_parameter.h"
00046 #include "visir_dfs.h"
00047 #include "visir_pfits.h"
00048
00049
00050
00051
00052
00053
00054 #define VISIR_PARAMETER_SET(MASK, VARNAME, TYPE, MAN, DEFAULT, SHORT) \
00055 if (bitmask & MASK) { \
00056 char * paramname = cpl_sprintf(PACKAGE ".%s.%s", recipe, VARNAME); \
00057 assert( paramname != NULL ); \
00058 \
00059 bitmask ^= MASK; \
00060 \
00061 if (chkmask & MASK) \
00062 (void)cpl_error_set(cpl_func, CPL_ERROR_UNSPECIFIED); \
00063 chkmask |= MASK; \
00064 \
00065 p = cpl_parameter_new_value(paramname, TYPE, MAN, context, DEFAULT); \
00066 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, SHORT); \
00067 cpl_parameterlist_append(self, p); \
00068 \
00069 cpl_free(paramname); \
00070 \
00071 }
00072
00073
00074 #define VISIR_PARAMETER_GET_BOOL(MASK, VARNAME) \
00075 if (bitmask & MASK) { \
00076 value = irplib_parameterlist_get_bool(self, PACKAGE, recipe, VARNAME); \
00077 \
00078 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), \
00079 return(CPL_FALSE), "mask=%llu", MASK); \
00080 \
00081 nbits++; \
00082 bitmask ^= MASK; \
00083 \
00084 }
00085
00086
00087 #define VISIR_PARAMETER_GET_INT(MASK, VARNAME) \
00088 if (bitmask & MASK) { \
00089 value = irplib_parameterlist_get_int(self, PACKAGE, recipe, VARNAME); \
00090 \
00091 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), return(0), \
00092 "mask=%llu", MASK); \
00093 \
00094 nbits++; \
00095 bitmask ^= MASK; \
00096 \
00097 }
00098
00099
00100 #define VISIR_PARAMETER_GET_DOUBLE(MASK, VARNAME) \
00101 if (bitmask & MASK) { \
00102 value = irplib_parameterlist_get_double(self, PACKAGE, recipe, VARNAME); \
00103 \
00104 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), return(0.0), \
00105 "mask=%llu", MASK); \
00106 \
00107 nbits++; \
00108 bitmask ^= MASK; \
00109 \
00110 }
00111
00112
00113 #define VISIR_PARAMETER_GET_STRING(MASK, VARNAME) \
00114 if (bitmask & MASK) { \
00115 value = irplib_parameterlist_get_string(self, PACKAGE, recipe, VARNAME); \
00116 \
00117 cpl_error_ensure(!cpl_error_get_code(), cpl_error_get_code(), return(NULL),\
00118 "mask=%llu", MASK); \
00119 \
00120 nbits++; \
00121 bitmask ^= MASK; \
00122 \
00123 }
00124
00125
00126
00132
00133
00137
00146
00147 cpl_error_code visir_parameter_set(cpl_parameterlist * self,
00148 const char * recipe,
00149 visir_parameter bitmask)
00150 {
00151
00152 cpl_parameter * p;
00153 char * context;
00154 visir_parameter chkmask = 0;
00155 cpl_boolean zerodist = CPL_FALSE;
00156 cpl_boolean dostrip = CPL_TRUE;
00157
00158
00159 cpl_ensure_code(self, CPL_ERROR_NULL_INPUT);
00160 cpl_ensure_code(recipe, CPL_ERROR_NULL_INPUT);
00161
00162 context = cpl_sprintf(PACKAGE ".%s", recipe);
00163
00164
00165 VISIR_PARAMETER_SET(VISIR_PARAM_NODPOS, "nodding", CPL_TYPE_STRING,
00166 "An optional ASCII specification of the nodding positions "
00167 "(in case they are missing from the FITS-file). "
00168 "The file must consist of one line per input FITS-file "
00169 "and each line must consist of an integer (which is "
00170 "ignored) followed by a 0 or 1 (to indicate object or sky). ",
00171 "", "nod");
00172
00173
00174 VISIR_PARAMETER_SET(VISIR_PARAM_AUTOBPM, "auto_bpm", CPL_TYPE_BOOL,
00175 "Automatic detection and correction of bad pixels",
00176 TRUE, "auto_bpm");
00177
00178
00179 VISIR_PARAMETER_SET(VISIR_PARAM_GLITCH, "rem_glitch", CPL_TYPE_BOOL,
00180 "Automatic filtering of glitches", FALSE, "g");
00181
00182
00183 VISIR_PARAMETER_SET(VISIR_PARAM_PURGE, "purge_bad", CPL_TYPE_BOOL,
00184 "Automatic purging of half-cycle images whose median "
00185 "deviates more than a factor three from the mean of "
00186 "the medians of half-cycle images or whose standard "
00187 "deviation deviates more than a factor three from the "
00188 "mean of their standard deviations", FALSE, "p");
00189
00190
00191 VISIR_PARAMETER_SET(VISIR_PARAM_UNION, "union", CPL_TYPE_BOOL,
00192 "Combine images using their union, as opposed to their "
00193 "intersection (deprecated and ignored, "
00194 "see --combine_method)", TRUE, "union");
00195
00196
00197 VISIR_PARAMETER_SET(VISIR_PARAM_REJECT, "rej", CPL_TYPE_STRING,
00198 "Each resulting pixel is the average of the "
00199 "corresponding (interpolated) pixel value in each "
00200 "jittered image. A positive value, n1, for the first "
00201 "of the two integers specifies that for each pixel the "
00202 "smallest n1 pixel values shall be ignored in the "
00203 "averaging. Similarly, a positive value, n2, for the "
00204 "second of the two integers specifies that for each "
00205 "pixel the largest n2 pixel values shall be ignored in "
00206 "the averaging.", "0 0", "rej");
00207
00208
00209 VISIR_PARAMETER_SET(VISIR_PARAM_PLOT, "plot", CPL_TYPE_INT,
00210 irplib_plot_manpage, 0, "plot");
00211
00212 if (bitmask & VISIR_PARAM_ZERODIST) {
00213 bitmask ^= VISIR_PARAM_ZERODIST;
00214
00215
00216 zerodist = CPL_TRUE;
00217 }
00218
00219
00220
00221
00222
00223 VISIR_PARAMETER_SET(VISIR_PARAM_SLITSKEW, "phi", CPL_TYPE_DOUBLE,
00224 "Distortion correction: Skew of slit [degrees] "
00225 "(clockwise)", zerodist ? 0.0 : 1.6, "slit_skew");
00226
00227
00228
00229
00230 VISIR_PARAMETER_SET(VISIR_PARAM_SPECSKEW, "ksi", CPL_TYPE_DOUBLE,
00231 "Distortion correction: LMR Skew of spectrum [degrees] "
00232 "(counter-clockwise). Not used in High Resolution",
00233 zerodist ? 0.0 : 0.7, "spectrum_skew");
00234
00235
00236
00237 VISIR_PARAMETER_SET(VISIR_PARAM_VERTARC, "eps", CPL_TYPE_DOUBLE,
00238 "Distortion correction: LR Detector vertical curvature "
00239 "[pixel]. Reduced by a factor 4 in MR. Not used in HR "
00240 "A-side. Increased by a factor 115/52 in HR B-side",
00241 zerodist ? 0.0 : 1.04, "vert_arc");
00242
00243
00244
00245 VISIR_PARAMETER_SET(VISIR_PARAM_HORIARC, "delta", CPL_TYPE_DOUBLE,
00246 "Distortion correction: LMR Detector horizontal "
00247 "curvature [pixel]. Increased by a factor 1.5 in HR "
00248 "A-side. Reduced by a factor 2 in HR B-side",
00249 zerodist ? 0.0 : 0.08, "hori_arc");
00250
00251
00252 VISIR_PARAMETER_SET(VISIR_PARAM_ORDEROFF, "orderoffset", CPL_TYPE_INT,
00253 "Echelle order offset. The offset is relative to the "
00254 "main order. The allowed range of offsets depend on "
00255 "the selected grism. The offset can never exceed +/-4. "
00256 "If the main order is e.g. 8 an order offset of +1 "
00257 "will cause the recipe to base the data reduction on "
00258 "order 9. With a positive order offset the central "
00259 "wavelength becomes smaller while for a negative "
00260 "order offset the central wavelength becomes larger.", 0,
00261 "orderoffset");
00262
00263
00264 VISIR_PARAMETER_SET(VISIR_PARAM_OFFSETS, "offsets", CPL_TYPE_STRING,
00265 "An optional ASCII specification of the offsets "
00266 "in case those in FITS-headers are missing or wrong. "
00267 "The file must consist of one line per input pair of "
00268 "FITS-files, and each line must consist of two "
00269 "numbers which represent the shift in pixels of that "
00270 "image relative to the first image. The first line "
00271 "should thus comprise two zeros. Correct FITS-header "
00272 "offsets mean that the i'th X offset can be gotten "
00273 "from Xoffset_0 - Xoffset_i, where Xoffset_i is the "
00274 "value of " VISIR_PFITS_DOUBLE_CUMOFFSETX " and "
00275 "likewise for Y.", "", "off");
00276
00277 VISIR_PARAMETER_SET(VISIR_PARAM_REFINE, "refine", CPL_TYPE_BOOL,
00278 "User-defined refining of the image offsets. See "
00279 "options objs and xcorr", FALSE, "ref");
00280
00281 VISIR_PARAMETER_SET(VISIR_PARAM_OBJECTS, "objects", CPL_TYPE_STRING,
00282 "The shift and add of images needs anchor points that "
00283 "typically are bright objects. These are normally "
00284 "detected automatically but with user-defined refining "
00285 "of offsets enabled, they must be provided by the user "
00286 "through an ASCII file containing one line per anchor "
00287 "point with each line consisting of its x and y "
00288 "coordinate (in pixels). This file is ignored with "
00289 "user-defined refining of offsets disabled.",
00290 "", "objs");
00291
00292
00293
00294 VISIR_PARAMETER_SET(VISIR_PARAM_XCORR, "xcorr", CPL_TYPE_STRING,
00295 "If user-defined refining of offsets is enabled a "
00296 "cross-correlation of the images is performed. In "
00297 "order to speed up this process, this cross-"
00298 "correlation is performed only on smaller rectangles "
00299 "around the anchor points. The first two parameters "
00300 "is the half-size of this rectangle in pixels. The "
00301 "second pair is the maximum shift in x and y (pixels) "
00302 "evaluated by the cross-correlation on the rectangle. "
00303 "Used only if user-defined refining of offsets is enabled.",
00304 "10 10 25 25", "xcorr");
00305
00306
00307 VISIR_PARAMETER_SET(VISIR_PARAM_JYVAL, "jy_val", CPL_TYPE_DOUBLE,
00308 "The flux of the standard star in Jansky",
00309 -999.0, "jy_val");
00310
00311
00312 VISIR_PARAMETER_SET(VISIR_PARAM_RADII, "radii", CPL_TYPE_STRING,
00313 "Radii : star_max bg_int bg_ext",
00314 "20 20 30", "radii");
00315
00316
00317 VISIR_PARAMETER_SET(VISIR_PARAM_LOWLIM, "low", CPL_TYPE_DOUBLE,
00318 "Low threshold for the bad pixel map",
00319 0.2, "low");
00320
00321
00322 VISIR_PARAMETER_SET(VISIR_PARAM_HIGHLIM, "high", CPL_TYPE_DOUBLE,
00323 "High threshold for the bad pixel map",
00324 5.0, "high");
00325
00326
00327 VISIR_PARAMETER_SET(VISIR_PARAM_FIXCOMBI, "fixcombi", CPL_TYPE_BOOL,
00328 "Perform the distortion correction on the combined "
00329 "image, and not on each of the jittered images. "
00330 "This will reduce excution time and degrade the quality "
00331 "of the combined image",
00332 FALSE, "fixcombi");
00333
00334
00335 VISIR_PARAMETER_SET(VISIR_PARAM_EMIS_TOL, "emis_tol", CPL_TYPE_DOUBLE,
00336 "The computation of the mean and standard deviation "
00337 "of the sensitivity is done for wavelengths with an "
00338 "atmospheric emissivity of at most "
00339 "emis_min + emis_tol * (emis_max - emis_min), where "
00340 "emis_min is the minimum emissivity in the observed "
00341 "wavelength range and emis_max is the ditto maximum. "
00342 "Thus emis_tol = 1 means that all wavelengths are "
00343 "included.",
00344 1.0, "emis_tol");
00345
00346
00347 VISIR_PARAMETER_SET(VISIR_PARAM_QEFF, "qeff", CPL_TYPE_DOUBLE,
00348 "The overall Quantum-efficiency. The default value "
00349 "comes from PH. Galdemard measurements. This option "
00350 "is ignored for all but " VISIR_SPC_QEFF_ASCII
00351 "-tagged files, while the efficiencies in such files "
00352 "are multiplied by this overall efficiency",
00353 0.72, "qeff");
00354
00355
00356 VISIR_PARAMETER_SET(VISIR_PARAM_REJBORD, "rej_bord", CPL_TYPE_STRING,
00357 "Rejected left right bottom and top border [pixel]",
00358 "50 50 50 50", "r");
00359
00360
00361 VISIR_PARAMETER_SET(VISIR_PARAM_HOT_LIM, "hot_threshold", CPL_TYPE_DOUBLE,
00362 "Hot pixel map threshold", 10.0, "hot_t");
00363
00364
00365 VISIR_PARAMETER_SET(VISIR_PARAM_COLD_LIM, "cold_threshold", CPL_TYPE_DOUBLE,
00366 "Cold pixel map threshold", 6.0, "cold_t");
00367
00368
00369 VISIR_PARAMETER_SET(VISIR_PARAM_DEV_LIM, "dev_threshold", CPL_TYPE_DOUBLE,
00370 "Deviant pixel map threshold", 5.0, "dev_t");
00371
00372
00373 VISIR_PARAMETER_SET(VISIR_PARAM_NSAMPLES, "nsamples", CPL_TYPE_INT,
00374 "Number of samples for Read-Out Noise (RON) computation",
00375 100, "nsamples");
00376
00377
00378 VISIR_PARAMETER_SET(VISIR_PARAM_HALFSIZE, "hsize", CPL_TYPE_INT,
00379 "Half size of the window for Read-Out Noise (RON) "
00380 "computation", 2, "hsize");
00381
00382
00383
00384 VISIR_PARAMETER_SET(VISIR_PARAM_COMBINE, "comb_meth", CPL_TYPE_STRING,
00385 "Combine images using one of: 1) Onto the first image "
00386 "(first); 2) Their union (union); 3) Their intersection"
00387 " (inter). NB: Only the 'first'-method produces an "
00388 "image product with WCS coordinates. A successful "
00389 "'first'-method always produces a combined image with "
00390 "dimensions equal to those of the input images. "
00391 "For the 'union'-method the result image is at least "
00392 "as large as the input images while for the 'inter'-"
00393 "method the result image is at most as large as the "
00394 "input images", "union", "combine_method");
00395
00396 if (bitmask & VISIR_PARAM_STRIPNON) {
00397 bitmask ^= VISIR_PARAM_STRIPNON;
00398
00399
00400 dostrip = CPL_FALSE;
00401 }
00402
00403
00404 VISIR_PARAMETER_SET(VISIR_PARAM_STRIPITE, "nstripe",
00405 CPL_TYPE_INT, "Max number of destriping iterations "
00406 "(0 to disable destriping). Horizontal destriping is "
00407 "done first and if no horizontal striping is detected, "
00408 "vertical destriping is performed", dostrip ? 15 : 0,
00409 "destripe_iterations");
00410
00411
00412 VISIR_PARAMETER_SET(VISIR_PARAM_STRIPMOR, "mstripe", CPL_TYPE_BOOL,
00413 "Destripe with morphological cleaning", FALSE,
00414 "destripe_morpho");
00415
00416
00417 VISIR_PARAMETER_SET(VISIR_PARAM_REJLEFT, "reject_left", CPL_TYPE_INT,
00418 "Reject leftmost columns in spectrum extraction, zero "
00419 "means all columns on the left are used. In cross-"
00420 "dispersion mode a (small) negative number may be used "
00421 "[pixel]", 0, "rl");
00422
00423
00424 VISIR_PARAMETER_SET(VISIR_PARAM_REJRIGHT, "reject_right", CPL_TYPE_INT,
00425 "Reject rightmost columns in spectrum extraction, zero "
00426 "means all columns on the right are used. In cross-"
00427 "dispersion mode a (small) negative number may be used "
00428 "[pixel]", 0, "rr");
00429
00430 cpl_free(context);
00431
00432 cpl_ensure_code(!cpl_error_get_code(), cpl_error_get_code());
00433 cpl_ensure_code(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE);
00434
00435 return CPL_ERROR_NONE;
00436 }
00437
00438
00448
00449 cpl_boolean visir_parameterlist_get_bool(const cpl_parameterlist * self,
00450 const char * recipe,
00451 visir_parameter bitmask)
00452 {
00453
00454 int nbits = 0;
00455 cpl_boolean value = CPL_FALSE;
00456
00457
00458 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), CPL_FALSE);
00459 cpl_ensure(self, CPL_ERROR_NULL_INPUT, CPL_FALSE);
00460 cpl_ensure(recipe, CPL_ERROR_NULL_INPUT, CPL_FALSE);
00461
00462
00463 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_AUTOBPM, "auto_bpm");
00464
00465
00466 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_GLITCH, "rem_glitch");
00467
00468
00469 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_PURGE, "purge_bad");
00470
00471 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_REFINE, "refine");
00472
00473
00474 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_FIXCOMBI, "fixcombi");
00475
00476
00477 VISIR_PARAMETER_GET_BOOL(VISIR_PARAM_STRIPMOR, "mstripe");
00478
00479
00480 cpl_ensure(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE, CPL_FALSE);
00481 cpl_ensure(nbits == 1, CPL_ERROR_ILLEGAL_INPUT, CPL_FALSE);
00482
00483 return value;
00484
00485 }
00486
00487
00488
00498
00499 int visir_parameterlist_get_int(const cpl_parameterlist * self,
00500 const char * recipe,
00501 visir_parameter bitmask)
00502 {
00503
00504 int nbits = 0;
00505 int value = 0;
00506
00507
00508 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), 0);
00509 cpl_ensure(self, CPL_ERROR_NULL_INPUT, 0);
00510 cpl_ensure(recipe, CPL_ERROR_NULL_INPUT, 0);
00511
00512
00513
00514 VISIR_PARAMETER_GET_INT(VISIR_PARAM_PLOT, "plot");
00515
00516
00517 VISIR_PARAMETER_GET_INT(VISIR_PARAM_ORDEROFF, "orderoffset");
00518
00519
00520 VISIR_PARAMETER_GET_INT(VISIR_PARAM_NSAMPLES, "nsamples");
00521
00522
00523 VISIR_PARAMETER_GET_INT(VISIR_PARAM_HALFSIZE, "hsize");
00524
00525
00526 VISIR_PARAMETER_GET_INT(VISIR_PARAM_STRIPITE, "nstripe");
00527
00528
00529 VISIR_PARAMETER_GET_INT(VISIR_PARAM_REJLEFT, "reject_left");
00530
00531
00532 VISIR_PARAMETER_GET_INT(VISIR_PARAM_REJRIGHT, "reject_right");
00533
00534
00535 cpl_ensure(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE, 0);
00536 cpl_ensure(nbits == 1, CPL_ERROR_ILLEGAL_INPUT, 0);
00537
00538 return value;
00539
00540 }
00541
00542
00552
00553 double visir_parameterlist_get_double(const cpl_parameterlist * self,
00554 const char * recipe,
00555 visir_parameter bitmask)
00556 {
00557
00558 int nbits = 0;
00559 double value = DBL_MAX;
00560
00561
00562 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), 0.0);
00563 cpl_ensure(self, CPL_ERROR_NULL_INPUT, 0.0);
00564 cpl_ensure(recipe, CPL_ERROR_NULL_INPUT, 0.0);
00565
00566
00567 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_SLITSKEW, "phi");
00568
00569
00570 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_SPECSKEW, "ksi");
00571
00572
00573 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_VERTARC, "eps");
00574
00575
00576 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_HORIARC, "delta");
00577
00578
00579 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_JYVAL, "jy_val");
00580
00581
00582 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_LOWLIM, "low");
00583
00584
00585 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_HIGHLIM, "high");
00586
00587
00588 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_EMIS_TOL, "emis_tol");
00589
00590
00591 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_QEFF, "qeff");
00592
00593
00594 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_HOT_LIM, "hot_threshold");
00595
00596
00597 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_COLD_LIM, "cold_threshold");
00598
00599
00600 VISIR_PARAMETER_GET_DOUBLE(VISIR_PARAM_DEV_LIM, "dev_threshold");
00601
00602 cpl_ensure(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE, 0.0);
00603 cpl_ensure(nbits == 1, CPL_ERROR_ILLEGAL_INPUT, 0.0);
00604
00605 return value;
00606
00607 }
00608
00609
00610
00611
00620
00621 const char * visir_parameterlist_get_string(const cpl_parameterlist * self,
00622 const char * recipe,
00623 visir_parameter bitmask)
00624 {
00625
00626 int nbits = 0;
00627 const char * value = NULL;
00628 const cpl_boolean is_combine
00629 = bitmask & VISIR_PARAM_COMBINE ? CPL_TRUE : CPL_FALSE;
00630
00631 cpl_ensure(self, CPL_ERROR_NULL_INPUT, NULL);
00632 cpl_ensure(recipe, CPL_ERROR_NULL_INPUT, NULL);
00633
00634
00635 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_NODPOS, "nodding");
00636
00637
00638 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_REJECT, "rej");
00639
00640
00641 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_OFFSETS, "offsets");
00642
00643 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_REFINE, "refine");
00644
00645 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_OBJECTS, "objects");
00646
00647
00648 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_XCORR, "xcorr");
00649
00650
00651 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_RADII, "radii");
00652
00653
00654 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_REJBORD, "rej_bord");
00655
00656
00657 VISIR_PARAMETER_GET_STRING(VISIR_PARAM_COMBINE, "comb_meth");
00658
00659 cpl_ensure(bitmask == 0, CPL_ERROR_UNSUPPORTED_MODE, NULL);
00660 cpl_ensure(nbits == 1, CPL_ERROR_ILLEGAL_INPUT, NULL);
00661
00662 assert(value != NULL);
00663
00664
00665 if (is_combine)
00666 cpl_ensure(strcmp(value, "first") == 0 || strcmp(value, "union") == 0 ||
00667 strcmp(value, "intersect") == 0, CPL_ERROR_UNSUPPORTED_MODE,
00668 NULL);
00669
00670 return value;
00671
00672 }
00673