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 #include <cpl.h>
00036 #include "xsh_detmon.h"
00037 #include "xsh_detmon_lg.h"
00038
00039
00040
00041 #include "xsh_dfs.h"
00042 #include "xsh_drl.h"
00043 #include "xsh_msg.h"
00044 #include "xsh_error.h"
00045 #include "xsh_utils.h"
00046 #include <xsh_data_instrument.h>
00047 #include "xsh_parameters.h"
00048 #include "xsh_badpixelmap.h"
00049
00050
00051
00052 #define XSH_LINGAIN_ON_RAW(it) ((it) == 0 ? XSH_LINEARITY_UVB : \
00053 (it) == 1 ? XSH_LINEARITY_VIS : \
00054 (it) == 2 ? XSH_LINEARITY_NIR_ON : \
00055 "???")
00056
00057 #define XSH_LINGAIN_OFF_RAW(it) ((it) == 0 ? XSH_BIAS_UVB : \
00058 (it) == 1 ? XSH_BIAS_VIS : \
00059 (it) == 2 ? XSH_LINEARITY_NIR_OFF : \
00060 "???")
00061
00062 #define XSH_LINGAIN_DET_LIN_INFO(it) ((it) == 0 ? XSH_DET_LIN_INFO_UVB : \
00063 (it) == 1 ? XSH_DET_LIN_INFO_VIS : \
00064 (it) == 2 ? XSH_DET_LIN_INFO_NIR : \
00065 "???")
00066
00067 #define XSH_LINGAIN_GAIN_INFO(it) ((it) == 0 ? XSH_GAIN_INFO_UVB : \
00068 (it) == 1 ? XSH_GAIN_INFO_VIS : \
00069 (it) == 2 ? XSH_GAIN_INFO_NIR : \
00070 "???")
00071
00072 #define XSH_LINGAIN_COEFFS_CUBE(it) ((it) == 0 ? XSH_COEFFS_CUBE_UVB : \
00073 (it) == 1 ? XSH_COEFFS_CUBE_VIS : \
00074 (it) == 2 ? XSH_COEFFS_CUBE_NIR : \
00075 "???")
00076
00077 #define XSH_LINGAIN_BP_MAP_NL(it) ((it) == 0 ? XSH_BP_MAP_NL_UVB : \
00078 (it) == 1 ? XSH_BP_MAP_NL_VIS : \
00079 (it) == 2 ? XSH_BP_MAP_NL_NIR : \
00080 "???")
00081
00082 #define XSH_LINGAIN_RAW_BP_MAP_NL(it) ((it) == 0 ? XSH_RAW_BP_MAP_NL_UVB : \
00083 (it) == 1 ? XSH_RAW_BP_MAP_NL_VIS : \
00084 (it) == 2 ? XSH_RAW_BP_MAP_NL_NIR : \
00085 "???")
00086
00087 #define XSH_LINGAIN_AUTOCORR(it) ((it) == 0 ? XSH_AUTOCORR_UVB : \
00088 (it) == 1 ? XSH_AUTOCORR_VIS : \
00089 (it) == 2 ? XSH_AUTOCORR_NIR : \
00090 "???")
00091
00092 #define XSH_LINGAIN_DIFF_FLAT(it) ((it) == 0 ? XSH_DIFF_FLAT_UVB : \
00093 (it) == 1 ? XSH_DIFF_FLAT_VIS : \
00094 (it) == 2 ? XSH_DIFF_FLAT_NIR : \
00095 "???")
00096
00097 #define RECIPE_ID "xsh_lingain"
00098 #define RECIPE_AUTHOR "Lander de Bilbao,A.Modigliani"
00099 #define RECIPE_CONTACT "amodigli@eso.org"
00100
00101
00102 #define INSTREGEXP "ESO INS SETUP ID"
00103
00104 #define PAFREGEXP "^(" REGEXP "|" INSTREGEXP ")$"
00105 #define NIR TRUE
00106 #define OPT FALSE
00107 #define XSH_PIX2PIX CPL_TRUE
00108 #define XSH_EXTS_RED -1
00109 #define XSH_BPMBIN 1
00110 #define XSH_TOL 0.1
00111
00112
00113
00114 static int xsh_lingain_create(cpl_plugin *);
00115 static int xsh_lingain_exec(cpl_plugin *);
00116 static int xsh_lingain_destroy(cpl_plugin *);
00117 static int
00118 xsh_lingain(cpl_frameset * frameset,
00119 cpl_parameterlist * parlist);
00120
00121 cpl_error_code
00122 xsh_lingain_fill_parlist_default_opt(cpl_parameterlist * parlist);
00123 cpl_error_code
00124 xsh_lingain_fill_parlist_default_nir(cpl_parameterlist * parlist);
00125
00126 static cpl_error_code
00127 xsh_lingain_pre_format(const cpl_frameset* raws,
00128 xsh_instrument* instrument,
00129 cpl_frame* bpmap,
00130 const int arm_id,
00131 cpl_frameset** frameset);
00132
00133
00134
00135
00136 static char xsh_lingain_description_short[] = "Computes detector's gain/linearity-map";
00137
00138 static char xsh_lingain_description[] =
00139 "This recipe computes detector linearity coefficients and gain\n\
00140 Input Frames : \n\
00141 arm = UVB-VIS: \n\
00142 - A set of n RAW linearity frames (Format=RAW, n >=8, Tag = LINEARITY_arm)\n\
00143 - A set of n RAW bias frames (Format=RAW, n >=1, Tag = BIAS_arm)\n\
00144 arm = NIR:\n\
00145 - A set of n RAW linearity on frames (Format=RAW, n >=8, Tag = LINEARITY_arm_ON)\n\
00146 - A set of n RAW linearity off frames (Format=RAW, n >=8, Tag = LINEARITY_arm_OFF)\n\
00147 - [OPTIONAL] a static bad pixel map (PRO.CATG=BADPIXEL_MAP_arm) \n\
00148 Note: on and off frames are taken in pairs sequence: OFF-ON-ON-OFF, \n\
00149 at least 16 frames.\n\
00150 Products : \n\
00151 - A linearity map table, PRO.CATG = BP_MAP_LIN_NIR\n\
00152 - A gain table, PRO.CATG = GAIN_INFO\n\
00153 - A cube cointaining the linearity coefficients, PRO.CATG = COEFFS_CUBE\n\
00154 - A linearity map image (RAW format), PRO.CATG = RAW_BP_MAP_NL\n\
00155 - A linearity map image (PRE format), PRO.CATG = BP_MAP_NL\n\
00156 - If an input static bad pixel map is provided \n\
00157 - If BADPIXEL_MAP_arm is provided this is updated with non linear pixels\n";
00158
00159
00160
00161
00162
00171
00172
00173 int cpl_plugin_get_info(cpl_pluginlist * list)
00174 {
00175 cpl_recipe *recipe = NULL;
00176 cpl_plugin *plugin = NULL;
00177
00178 recipe = cpl_calloc(1, sizeof(*recipe));
00179 if (recipe == NULL) {
00180 return -1;
00181 }
00182
00183 plugin = &recipe->interface;
00184
00185 cpl_plugin_init(plugin, CPL_PLUGIN_API,
00186 XSH_BINARY_VERSION,
00187 CPL_PLUGIN_TYPE_RECIPE,
00188 RECIPE_ID,
00189 xsh_lingain_description_short,
00190 xsh_lingain_description,
00191 RECIPE_AUTHOR,
00192 RECIPE_CONTACT,
00193 xsh_get_license(),
00194 xsh_lingain_create,
00195 xsh_lingain_exec,
00196 xsh_lingain_destroy);
00197
00198 cpl_pluginlist_append(list, plugin);
00199
00200 return (cpl_error_get_code() != CPL_ERROR_NONE);
00201 }
00202
00203
00213
00214
00215 static int xsh_lingain_create(cpl_plugin * plugin)
00216 {
00217 cpl_recipe *recipe = NULL;
00218
00219 xsh_init();
00220
00221
00222 assure(plugin != NULL, CPL_ERROR_NULL_INPUT, "Null plugin");
00223
00224
00225 assure(cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE,
00226 CPL_ERROR_TYPE_MISMATCH, "Plugin is not a recipe");
00227
00228 recipe = (cpl_recipe *) plugin;
00229
00230
00231 recipe->parameters = cpl_parameterlist_new();
00232 assure(recipe->parameters != NULL,
00233 CPL_ERROR_ILLEGAL_OUTPUT, "Memory allocation failed!");
00234
00235
00236 check( xsh_parameters_generic( RECIPE_ID, recipe->parameters ) ) ;
00237
00238 check(xsh_lingain_fill_parlist_default_opt(recipe->parameters));
00239
00240 cleanup:
00241 if (cpl_error_get_code() != CPL_ERROR_NONE) {
00242 xsh_error_dump(CPL_MSG_ERROR);
00243 return 1;
00244 } else {
00245 return 0;
00246 }
00247 }
00248
00249
00250
00256
00257
00258 static int xsh_lingain_exec(cpl_plugin * plugin)
00259 {
00260 cpl_recipe *recipe = NULL;
00261
00262
00263 assure(plugin != NULL, CPL_ERROR_NULL_INPUT, "Null plugin");
00264
00265
00266 assure(cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE,
00267 CPL_ERROR_TYPE_MISMATCH, "Plugin is not a recipe");
00268
00269 recipe = (cpl_recipe *) plugin;
00270
00271
00272 xsh_lingain(recipe->frames,recipe->parameters);
00273
00274 cleanup:
00275 if (cpl_error_get_code() != CPL_ERROR_NONE) {
00276 xsh_error_dump(CPL_MSG_ERROR);
00277 cpl_error_reset();
00278 return 1;
00279 } else {
00280 return 0;
00281 }
00282 }
00283
00284
00290
00291 static int xsh_lingain_destroy(cpl_plugin * plugin)
00292 {
00293 cpl_recipe *recipe = NULL;
00294
00295 xsh_error_reset();
00296
00297 assure(plugin != NULL, CPL_ERROR_NULL_INPUT, "Null plugin");
00298
00299
00300 assure(cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE,
00301 CPL_ERROR_TYPE_MISMATCH, "Plugin is not a recipe");
00302
00303 recipe = (cpl_recipe *) plugin;
00304
00305 xsh_free_parameterlist(&recipe->parameters);
00306
00307 cleanup:
00308 if (cpl_error_get_code() != CPL_ERROR_NONE) {
00309 return 1;
00310 } else {
00311 return 0;
00312 }
00313 }
00314
00315 static cpl_error_code
00316 xsh_params_set_defaults(cpl_parameterlist* pars,
00317 xsh_instrument* inst)
00318 {
00319 cpl_parameter* p=NULL;
00320
00321 if (xsh_instrument_get_arm(inst) == XSH_ARM_UVB){
00322 check(p=xsh_parameters_find(pars,RECIPE_ID,"kappa"));
00323 if(xsh_parameter_get_default_flag(p) == 0) {
00324
00325 cpl_parameter_set_double(p,5.);
00326 }
00327 }
00328
00329
00330 cleanup:
00331
00332 return cpl_error_get_code();
00333
00334 }
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345 static int
00346 xsh_lingain(cpl_frameset * frameset,
00347 cpl_parameterlist * parlist)
00348 {
00349
00350 const char* recipe_tags[2] = {XSH_LINEARITY,XSH_BIAS};
00351 int recipe_tags_size = 2;
00352
00353 cpl_error_code error=0;
00354 int processed=0;
00355 cpl_parameterlist* plist=NULL;
00356 xsh_instrument* instrument=NULL;
00357 cpl_frameset* raws=NULL;
00358 cpl_frameset* calib=NULL;
00359 cpl_frameset* pros=NULL;
00360
00361 cpl_propertylist * lintbl = NULL;
00362 cpl_propertylist * gaintbl = NULL;
00363 cpl_propertylist * coeffscube = NULL;
00364 cpl_propertylist * bpm = NULL;
00365 cpl_propertylist * corr = NULL;
00366 cpl_propertylist * diff_flat =NULL;
00367 cpl_frame* bpmap_nl=NULL;
00368 cpl_image* ima=NULL;
00369 char name[80];
00370 cpl_propertylist* head=NULL;
00371 cpl_frame *bpmap = NULL;
00372 const char* pro_catg=NULL;
00373 cpl_frame* coadd_bp_map=NULL;
00374 cpl_image* crox=NULL;
00375
00376
00377 char* bp_nl_tag=NULL;
00378 char* bp_nl_name=NULL;
00379 xsh_pre* pre_bp_nl = NULL;
00380 cpl_frame* bp_nl_frame = NULL;
00381
00382
00383
00384
00385
00386 check( xsh_begin( frameset, parlist, &instrument, &raws, &calib,
00387 recipe_tags, recipe_tags_size,
00388 RECIPE_ID, XSH_BINARY_VERSION,
00389 xsh_lingain_description_short ) ) ;
00390 if((bpmap=xsh_find_frame_with_tag(calib,XSH_BP_MAP_RP,instrument))==NULL) {
00391 xsh_msg("%s not provided",XSH_BP_MAP_RP);
00392 }
00393 check(plist=xsh_parameterlist_duplicate(parlist));
00394
00395 if ( xsh_instrument_get_arm(instrument) == XSH_ARM_NIR){
00396
00397
00398
00399 xsh_lingain_fill_parlist_default_nir(plist);
00400
00401 processed++;
00402
00403 lintbl=xsh_detmon_fill_prolist("DET_LIN_INFO_NIR","TYPE","TECH",CPL_FALSE);
00404
00405 gaintbl=xsh_detmon_fill_prolist("GAIN_INFO_NIR","TYPE","TECH",CPL_FALSE);
00406
00407 coeffscube=xsh_detmon_fill_prolist("COEFFS_CUBE_NIR","TYPE","TECH",CPL_FALSE);
00408
00409 bpm=xsh_detmon_fill_prolist("RAW_BP_MAP_NL_NIR","TYPE","TECH",CPL_FALSE);
00410
00411 corr=xsh_detmon_fill_prolist("AUTOCORR_NIR","TYPE","TECH",CPL_FALSE);
00412
00413 diff_flat=xsh_detmon_fill_prolist("DIFF_FLAT_NIR","TYPE","TECH",CPL_FALSE);
00414
00415 check(error = xsh_detmon_lg(raws,
00416 plist,
00417 XSH_LINEARITY_NIR_ON,
00418 XSH_LINEARITY_NIR_OFF,
00419 RECIPE_ID,
00420 "xsh",
00421 PAFREGEXP,
00422 lintbl,
00423 gaintbl,
00424 coeffscube,
00425 bpm,
00426 corr,
00427 diff_flat,
00428 PACKAGE "/" PACKAGE_VERSION,
00429 NULL, NULL, NIR));
00430
00431 } else if ( xsh_instrument_get_arm(instrument) == XSH_ARM_UVB){
00432
00433
00434
00435 xsh_lingain_fill_parlist_default_opt(plist);
00436 check(xsh_params_set_defaults(parlist,instrument));
00437
00438 processed++;
00439
00440 lintbl=xsh_detmon_fill_prolist("DET_LIN_INFO_UVB","TYPE","TECH",CPL_FALSE);
00441
00442 gaintbl=xsh_detmon_fill_prolist("GAIN_INFO_UVB","TYPE","TECH",CPL_FALSE);
00443
00444 coeffscube=xsh_detmon_fill_prolist("COEFFS_CUBE_UVB","TYPE","TECH",CPL_FALSE);
00445
00446 bpm=xsh_detmon_fill_prolist("RAW_BP_MAP_NL_UVB","TYPE","TECH",CPL_FALSE);
00447
00448 corr=xsh_detmon_fill_prolist("AUTOCORR_UVB","TYPE","TECH",CPL_FALSE);
00449
00450 diff_flat=xsh_detmon_fill_prolist("DIFF_FLAT_UVB","TYPE","TECH",CPL_FALSE);
00451 check(error = xsh_detmon_lg(raws,
00452 plist,
00453 XSH_LINEARITY_UVB,
00454 XSH_BIAS_UVB,
00455 RECIPE_ID,
00456 "xsh",
00457 PAFREGEXP,
00458 lintbl,
00459 gaintbl,
00460 coeffscube,
00461 bpm,
00462 corr,
00463 diff_flat,
00464 PACKAGE "/" PACKAGE_VERSION,
00465 NULL, NULL, OPT));
00466
00467
00468
00469 } else if ( xsh_instrument_get_arm(instrument) == XSH_ARM_VIS) {
00470
00471
00472
00473 xsh_lingain_fill_parlist_default_opt(plist);
00474
00475
00476 processed++;
00477
00478 lintbl=xsh_detmon_fill_prolist("DET_LIN_INFO_VIS","TYPE","TECH",CPL_FALSE);
00479
00480 gaintbl=xsh_detmon_fill_prolist("GAIN_INFO_VIS","TYPE","TECH",CPL_FALSE);
00481
00482 coeffscube=xsh_detmon_fill_prolist("COEFFS_CUBE_VIS","TYPE","TECH",CPL_FALSE);
00483
00484 bpm=xsh_detmon_fill_prolist("RAW_BP_MAP_NL_VIS","TYPE","TECH",CPL_FALSE);
00485
00486 corr=xsh_detmon_fill_prolist("AUTOCORR_VIS","TYPE","TECH",CPL_FALSE);
00487
00488 diff_flat=xsh_detmon_fill_prolist("DIFF_FLAT_VIS","TYPE","TECH",CPL_FALSE);
00489 check(error = xsh_detmon_lg(raws,
00490 plist,
00491 XSH_LINEARITY_VIS,
00492 XSH_BIAS_VIS,
00493 RECIPE_ID,
00494 "xsh",
00495 PAFREGEXP,
00496 lintbl,
00497 gaintbl,
00498 coeffscube,
00499 bpm,
00500 corr,
00501 diff_flat,
00502 PACKAGE "/" PACKAGE_VERSION,
00503 NULL, NULL, OPT));
00504
00505
00506
00507 }
00508
00509 pros=cpl_frameset_new();
00510 check(xsh_dfs_extract_pro_frames(raws,pros));
00511 check(xsh_frameset_merge(frameset,pros));
00512 xsh_free_frameset(&pros);
00513 check(bpmap_nl=xsh_find_frame_with_tag(frameset,XSH_RAW_BP_MAP_NL,instrument));
00514
00515
00516 check( pre_bp_nl = xsh_pre_create(bpmap_nl , NULL, NULL, instrument,0));
00517 bp_nl_tag=cpl_sprintf("%s_%s",XSH_BP_MAP_NL,
00518 xsh_instrument_arm_tostring( instrument ));
00519 bp_nl_name=cpl_sprintf("%s.fits",bp_nl_tag);
00520 check( bp_nl_frame = xsh_pre_save( pre_bp_nl, bp_nl_name,bp_nl_tag,1 ));
00521 cpl_frameset_insert(frameset, bp_nl_frame);
00522 check(sprintf(name,cpl_frame_get_filename(bp_nl_frame)));
00523
00524
00525 check(ima=cpl_image_load(name,CPL_TYPE_FLOAT,0,0));
00526 check(head=cpl_propertylist_load(name,0));
00527 check(xsh_bpmap_bitwise_to_flag(ima,QFLAG_NON_LINEAR_PIXEL));
00528 check(crox=xsh_image_flag_bptype_with_crox(ima));
00529 xsh_free_image(&ima);
00530 check(cpl_image_save(crox,name,CPL_BPP_IEEE_FLOAT,head,CPL_IO_DEFAULT));
00531 xsh_free_image(&crox);
00532 xsh_free_propertylist(&head);
00533 if(bpmap!=NULL) {
00534
00535
00536 xsh_msg( "Coadd non-lin and static bp map frames" ) ;
00537 check(coadd_bp_map=cpl_frame_duplicate(bpmap));
00538 sprintf(name,cpl_frame_get_filename(bpmap));
00539 check(ima=cpl_image_load(name,CPL_TYPE_FLOAT,0,0));
00540 check(head=cpl_propertylist_load(name,0));
00541 check(pro_catg=XSH_GET_TAG_FROM_ARM(XSH_MASTER_BP_MAP,instrument));
00542 sprintf(name,"%s.fits",pro_catg);
00543 check(cpl_image_save(ima,name,CPL_BPP_IEEE_FLOAT,head,CPL_IO_DEFAULT));
00544 check(cpl_frame_set_filename(coadd_bp_map,name));
00545 check(cpl_frame_set_tag(coadd_bp_map,pro_catg));
00546 check(xsh_badpixelmap_coadd(coadd_bp_map,bp_nl_frame));
00547 check( xsh_add_product_bpmap(coadd_bp_map, frameset, parlist,
00548 RECIPE_ID, instrument, pro_catg ));
00549 xsh_free_frame(&coadd_bp_map);
00550 xsh_free_image(&ima);
00551 xsh_free_propertylist(&head);
00552
00553 }
00554
00555 if(processed>0) {
00556
00557 cpl_ensure_code(!error, error);
00558 } else {
00559 xsh_msg("No data has been processed.");
00560 xsh_msg("Pls check if input frame set contains valid tags");
00561 }
00562
00563
00564 cleanup:
00565
00566 xsh_free_frame(&coadd_bp_map);
00567 xsh_free_frameset(&pros);
00568 xsh_free_image(&ima);
00569 xsh_free_propertylist(&head);
00570 xsh_free_propertylist(&lintbl);
00571 xsh_free_propertylist(&gaintbl);
00572 xsh_free_propertylist(&coeffscube);
00573 xsh_free_propertylist(&bpm);
00574 xsh_free_propertylist(&corr);
00575 xsh_free_propertylist(&diff_flat);
00576
00577 return CPL_ERROR_NONE;
00578 }
00579
00580
00581 static cpl_error_code
00582 xsh_lingain_pre_format(const cpl_frameset* raws,
00583 xsh_instrument* instrument,
00584 cpl_frame* bpmap,
00585 const int arm_id,
00586 cpl_frameset** frameset)
00587 {
00588
00589 cpl_frameset* lin_pre_set=NULL;
00590 cpl_frameset* bias_pre_set=NULL;
00591 cpl_frameset* bias_set=NULL;
00592 cpl_frameset* lin_set=NULL;
00593
00594 cpl_frame* frm=NULL;
00595 int pre_overscan_corr=0;
00596
00597
00598 int i=0;
00599 int n=0;
00600
00601
00602 check(bias_set=xsh_frameset_extract(*frameset,XSH_LINGAIN_OFF_RAW(arm_id)));
00603 check(lin_set=xsh_frameset_extract(raws,XSH_LINGAIN_ON_RAW(arm_id)));
00604
00605 check(xsh_prepare(lin_set, bpmap, NULL, XSH_LINEARITY, instrument,pre_overscan_corr));
00606 check(lin_pre_set=xsh_frameset_extract_pre(lin_set,XSH_LINEARITY));
00607 xsh_free_frameset(&lin_set);
00608
00609 check(xsh_prepare(bias_set, bpmap, NULL, XSH_BIAS, instrument,pre_overscan_corr));
00610 check(bias_pre_set=xsh_frameset_extract_pre(bias_set,XSH_BIAS));
00611 xsh_free_frameset(&bias_set);
00612
00613 check(n=cpl_frameset_get_size(bias_pre_set));
00614 xsh_free_frameset(frameset);
00615 *frameset=cpl_frameset_new();
00616 for(i=0;i<n;i++) {
00617 check(frm=cpl_frameset_get_frame(bias_pre_set,i));
00618 check(cpl_frameset_insert(*frameset,cpl_frame_duplicate(frm)));
00619 }
00620
00621 check(n=cpl_frameset_get_size(lin_pre_set));
00622 for(i=0;i<n;i++) {
00623 check(frm=cpl_frameset_get_frame(lin_pre_set,i));
00624 check(cpl_frameset_insert(*frameset,cpl_frame_duplicate(frm)));
00625 }
00626
00627 cleanup:
00628
00629 xsh_free_frameset(&bias_set);
00630 xsh_free_frameset(&lin_set);
00631
00632 xsh_free_frameset(&bias_pre_set);
00633 xsh_free_frameset(&lin_pre_set);
00634
00635 return cpl_error_get_code();
00636
00637 }
00638 cpl_error_code
00639 xsh_lingain_fill_parlist_default_opt(cpl_parameterlist * parlist)
00640 {
00641
00642 cpl_error_code error =
00643 xsh_detmon_lg_fill_parlist_opt_default(parlist, RECIPE_ID, PACKAGE);
00644 cpl_parameter * p;
00645
00646 cpl_ensure_code(!error, error);
00647
00648
00649
00650 p = cpl_parameterlist_find(parlist, PACKAGE "." RECIPE_ID ".pix2pix");
00651
00652 cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
00653
00654 error = cpl_parameter_set_default_bool(p, XSH_PIX2PIX);
00655
00656
00657 p = cpl_parameterlist_find(parlist, PACKAGE "." RECIPE_ID ".tolerance");
00658
00659 cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
00660
00661 error = cpl_parameter_set_default_double(p, XSH_TOL);
00662
00663
00664 cpl_ensure_code(!error, error);
00665
00666 return CPL_ERROR_NONE;
00667 }
00668
00669
00670 cpl_error_code
00671 xsh_lingain_fill_parlist_default_nir(cpl_parameterlist * parlist)
00672 {
00673
00674
00675
00676 cpl_error_code error =
00677 xsh_detmon_lg_fill_parlist_nir_default(parlist,RECIPE_ID,
00678 PACKAGE_TARNAME);
00679 cpl_parameter * p;
00680
00681 cpl_ensure_code(!error, error);
00682
00683
00684 p = cpl_parameterlist_find(parlist, PACKAGE_TARNAME "." RECIPE_ID ".bpmbin");
00685
00686 cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
00687
00688 error = cpl_parameter_set_default_bool(p, XSH_BPMBIN);
00689
00690
00691 cpl_ensure_code(!error, error);
00692
00693
00694 return CPL_ERROR_NONE;
00695
00696 }
00697