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 <cpl.h>
00037 #include <math.h>
00038
00039 #include "irplib_utils.h"
00040
00041 #include "isaac_utils.h"
00042 #include "isaac_pfits.h"
00043 #include "isaac_dfs.h"
00044
00045
00046
00047
00048
00049 #define ISAAC_DARK_HSIZE_SW_DEF 6
00050 #define ISAAC_DARK_HSIZE_LW_DEF 2
00051
00052
00053
00054
00055
00056 static int isaac_img_dark_create(cpl_plugin *);
00057 static int isaac_img_dark_exec(cpl_plugin *);
00058 static int isaac_img_dark_destroy(cpl_plugin *);
00059 static int isaac_img_dark(cpl_parameterlist *, cpl_frameset *);
00060
00061 static int isaac_img_dark_avg_reduce(cpl_frameset *, cpl_image **);
00062 static cpl_matrix * isaac_img_dark_ron_reduce(cpl_frameset *);
00063 static int isaac_img_dark_compare(const cpl_frame *, const cpl_frame *);
00064 static int isaac_img_dark_save(cpl_image *, cpl_matrix *, int, cpl_frameset *,
00065 cpl_parameterlist *, cpl_frameset *);
00066
00067
00068
00069
00070
00071 static struct {
00072
00073 int hsize;
00074 int nsamples;
00075
00076 double dark_med;
00077 double dark_stdev;
00078 } isaac_img_dark_config;
00079
00080 static char isaac_img_dark_description[] =
00081 "isaac_img_dark -- ISAAC imaging dark recipe.\n"
00082 "The files listed in the Set Of Frames (sof-file) must be tagged:\n"
00083 "raw-file.fits "ISAAC_IMG_DARK_RAW"\n";
00084
00085
00086
00087
00088
00089
00097
00098 int cpl_plugin_get_info(cpl_pluginlist * list)
00099 {
00100 cpl_recipe * recipe = cpl_calloc(1, sizeof(*recipe));
00101 cpl_plugin * plugin = &recipe->interface;
00102
00103 cpl_plugin_init(plugin,
00104 CPL_PLUGIN_API,
00105 ISAAC_BINARY_VERSION,
00106 CPL_PLUGIN_TYPE_RECIPE,
00107 "isaac_img_dark",
00108 "Dark recipe",
00109 isaac_img_dark_description,
00110 "Lars Lundin",
00111 PACKAGE_BUGREPORT,
00112 isaac_get_license(),
00113 isaac_img_dark_create,
00114 isaac_img_dark_exec,
00115 isaac_img_dark_destroy);
00116
00117 cpl_pluginlist_append(list, plugin);
00118
00119 return 0;
00120 }
00121
00122
00131
00132 static int isaac_img_dark_create(cpl_plugin * plugin)
00133 {
00134 cpl_recipe * recipe;
00135 cpl_parameter * p;
00136
00137
00138 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00139 recipe = (cpl_recipe *)plugin;
00140 else return -1;
00141
00142
00143 recipe->parameters = cpl_parameterlist_new();
00144
00145
00146
00147 p = cpl_parameter_new_value("isaac.isaac_img_dark.nsamples",
00148 CPL_TYPE_INT, "number of samples for RON computation",
00149 "isaac.isaac_img_dark", 100);
00150 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "nsamples");
00151 cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
00152 cpl_parameterlist_append(recipe->parameters, p);
00153
00154 p = cpl_parameter_new_value("isaac.isaac_img_dark.hsize",
00155 CPL_TYPE_INT, "half size of the window for RON computation",
00156 "isaac.isaac_img_dark", -1);
00157 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, "hsize");
00158 cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
00159 cpl_parameterlist_append(recipe->parameters, p);
00160
00161
00162 return 0;
00163 }
00164
00165
00171
00172 static int isaac_img_dark_exec(cpl_plugin * plugin)
00173 {
00174 cpl_recipe * recipe;
00175
00176
00177 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00178 recipe = (cpl_recipe *)plugin;
00179 else return -1;
00180
00181 return isaac_img_dark(recipe->parameters, recipe->frames);
00182 }
00183
00184
00190
00191 static int isaac_img_dark_destroy(cpl_plugin * plugin)
00192 {
00193 cpl_recipe * recipe;
00194
00195
00196 if (cpl_plugin_get_type(plugin) == CPL_PLUGIN_TYPE_RECIPE)
00197 recipe = (cpl_recipe *)plugin;
00198 else return -1;
00199
00200 cpl_parameterlist_delete(recipe->parameters);
00201 return 0;
00202 }
00203
00204
00211
00212 static int isaac_img_dark(
00213 cpl_parameterlist * parlist,
00214 cpl_frameset * framelist)
00215 {
00216 cpl_parameter * par;
00217 cpl_size nsets;
00218 cpl_size * selection;
00219 cpl_frameset * f_one;
00220 cpl_image * avg;
00221 cpl_matrix * rons;
00222 cpl_boolean did_reduce = CPL_FALSE;
00223 int i;
00224
00225
00226 par = cpl_parameterlist_find(parlist, "isaac.isaac_img_dark.hsize");
00227 isaac_img_dark_config.hsize = cpl_parameter_get_int(par);
00228 par = cpl_parameterlist_find(parlist, "isaac.isaac_img_dark.nsamples");
00229 isaac_img_dark_config.nsamples = cpl_parameter_get_int(par);
00230
00231
00232 if (isaac_dfs_set_groups(framelist)) {
00233 cpl_msg_error(cpl_func, "Cannot identify RAW and CALIB frames");
00234 return -1;
00235 }
00236
00237
00238 cpl_msg_info(cpl_func, "Identify the different settings");
00239 selection=cpl_frameset_labelise(framelist, isaac_img_dark_compare, &nsets);
00240 if (selection == NULL) {
00241 cpl_msg_error(cpl_func, "Cannot labelise input frames");
00242 return -1;
00243 }
00244
00245
00246 for (i=0; i<nsets; i++) {
00247
00248 isaac_img_dark_config.dark_med = -1.0;
00249 isaac_img_dark_config.dark_stdev = -1.0;
00250 avg = NULL;
00251
00252
00253 cpl_msg_info(cpl_func, "Reduce data set no %d out of %d", i+1,
00254 (int)nsets);
00255 cpl_msg_indent_more();
00256 f_one = cpl_frameset_extract(framelist, selection, i);
00257
00258
00259 if (cpl_frameset_get_size(f_one) < 2) {
00260 cpl_msg_warning(cpl_func, "Setting %d skipped (not enough frames)",
00261 i+1);
00262 } else {
00263
00264 cpl_msg_info(cpl_func, "Compute the master dark");
00265 cpl_msg_indent_more();
00266 if (isaac_img_dark_avg_reduce(f_one, &avg)) {
00267 cpl_msg_warning(cpl_func, "Cannot reduce set number %d", i+1);
00268 }
00269 cpl_msg_indent_less();
00270
00271 cpl_msg_info(cpl_func, "Compute the read-out noise");
00272 cpl_msg_indent_more();
00273 if ((rons = isaac_img_dark_ron_reduce(f_one)) == NULL) {
00274 cpl_msg_warning(cpl_func, "Cannot reduce set number %d", i+1);
00275 }
00276 cpl_msg_indent_less();
00277
00278 if (isaac_img_dark_save(avg, rons, i+1, f_one, parlist,
00279 framelist) !=0 ){
00280 cpl_msg_error(cpl_func, "Cannot save the products");
00281 if (avg) cpl_image_delete(avg);
00282 if (rons) cpl_matrix_delete(rons);
00283 return -1;
00284 }
00285 if (rons) cpl_matrix_delete(rons);
00286 if (!cpl_error_get_code()) did_reduce = CPL_TRUE;
00287 }
00288 if (avg) cpl_image_delete(avg);
00289 cpl_frameset_delete(f_one);
00290 cpl_msg_indent_less();
00291 }
00292
00293
00294 cpl_free(selection);
00295
00296 cpl_ensure_code(did_reduce, CPL_ERROR_ILLEGAL_INPUT);
00297
00298 return cpl_error_set_where(cpl_func);
00299 }
00300
00301
00308
00309 static int isaac_img_dark_avg_reduce(
00310 cpl_frameset * framelist,
00311 cpl_image ** avg)
00312 {
00313 cpl_imagelist * iset;
00314 cpl_vector * medians;
00315 cpl_image * image;
00316 int i;
00317
00318
00319 if (framelist == NULL) return -1;
00320
00321
00322 if ((iset = cpl_imagelist_load_frameset(framelist, CPL_TYPE_FLOAT, 1,
00323 0)) == NULL) {
00324 cpl_msg_error(cpl_func, "Cannot load the data");
00325 return -1;
00326 }
00327
00328
00329 if ((*avg = cpl_imagelist_collapse_create(iset)) == NULL) {
00330 cpl_msg_error(cpl_func, "Cannot average the data set");
00331 cpl_imagelist_delete(iset);
00332 return -1;
00333 }
00334
00335
00336 medians = cpl_vector_new(cpl_imagelist_get_size(iset));
00337 for (i=0; i<cpl_imagelist_get_size(iset); i++) {
00338 image = cpl_imagelist_get(iset, i);
00339 cpl_vector_set(medians, i, cpl_image_get_median(image));
00340 }
00341 cpl_imagelist_delete(iset);
00342 isaac_img_dark_config.dark_med = cpl_vector_get_mean(medians);
00343 isaac_img_dark_config.dark_stdev = cpl_vector_get_stdev(medians);
00344
00345
00346 cpl_vector_delete(medians);
00347 return 0;
00348 }
00349
00350
00361
00362 static cpl_matrix * isaac_img_dark_ron_reduce(cpl_frameset * framelist)
00363 {
00364 cpl_frame * cur_frame;
00365 cpl_propertylist * plist;
00366 char arm;
00367 const char * sval;
00368 cpl_imagelist * iset;
00369 cpl_matrix * rons;
00370 cpl_image * tmp_im;
00371 double rms;
00372 double norm;
00373 int ndit;
00374 cpl_size zone_def[4];
00375 int i;
00376
00377
00378 if (framelist == NULL) return NULL;
00379
00380
00381 rons = NULL;
00382
00383
00384 if (cpl_error_get_code()) return NULL;
00385 cur_frame = cpl_frameset_get_frame(framelist, 0);
00386 plist = cpl_propertylist_load(cpl_frame_get_filename(cur_frame), 0);
00387 sval = isaac_pfits_get_arm(plist);
00388 if (cpl_error_get_code()) {
00389 cpl_msg_error(cpl_func, "Cannot get the used arm");
00390 cpl_propertylist_delete(plist);
00391 return NULL;
00392 }
00393 arm = (int)(sval[0]);
00394 cpl_propertylist_delete(plist);
00395
00396
00397 if ((iset = cpl_imagelist_load_frameset(framelist, CPL_TYPE_FLOAT, 1,
00398 0)) == NULL) {
00399 cpl_msg_error(cpl_func, "Cannot load the data");
00400 return NULL;
00401 }
00402
00403
00404 switch (arm) {
00405 case 'S':
00406
00407 rons = cpl_matrix_new(cpl_imagelist_get_size(iset)-1, 4);
00408 if (isaac_img_dark_config.hsize < 0)
00409 isaac_img_dark_config.hsize = ISAAC_DARK_HSIZE_SW_DEF;
00410
00411
00412 for (i=0; i<cpl_imagelist_get_size(iset)-1; i++) {
00413 cpl_msg_info(cpl_func, "Pair number %d", i+1);
00414
00415 if (cpl_error_get_code()) {
00416 cpl_matrix_delete(rons);
00417 cpl_imagelist_delete(iset);
00418 return NULL;
00419 }
00420 cur_frame = cpl_frameset_get_frame(framelist, i);
00421 plist = cpl_propertylist_load(cpl_frame_get_filename(cur_frame),
00422 0);
00423 ndit = isaac_pfits_get_ndit(plist);
00424 cpl_propertylist_delete(plist);
00425 if (cpl_error_get_code()) {
00426 cpl_msg_error(cpl_func, "Cannot get the NDIT");
00427 cpl_matrix_delete(rons);
00428 cpl_imagelist_delete(iset);
00429 return NULL;
00430 }
00431 norm = 0.5 * ndit;
00432 norm = sqrt(norm);
00433
00434
00435 if ((tmp_im = cpl_image_subtract_create(
00436 cpl_imagelist_get(iset, i),
00437 cpl_imagelist_get(iset, i+1))) == NULL) {
00438 cpl_msg_error(cpl_func, "Cannot subtract the images");
00439 cpl_imagelist_delete(iset);
00440 cpl_matrix_delete(rons);
00441 return NULL;
00442 }
00443
00444
00445 zone_def[0] = 1;
00446 zone_def[1] = cpl_image_get_size_x(tmp_im)/2;
00447 zone_def[2] = 1;
00448 zone_def[3] = cpl_image_get_size_y(tmp_im)/2;
00449 cpl_flux_get_noise_window(tmp_im, zone_def,
00450 isaac_img_dark_config.hsize,
00451 isaac_img_dark_config.nsamples, &rms, NULL);
00452 cpl_matrix_set(rons, i, 0, rms * norm);
00453 cpl_msg_info(cpl_func, "RON in LL quadrant: %g", rms * norm);
00454
00455
00456 zone_def[0] = cpl_image_get_size_x(tmp_im)/2 + 1;
00457 zone_def[1] = cpl_image_get_size_x(tmp_im);
00458 zone_def[2] = 1;
00459 zone_def[3] = cpl_image_get_size_y(tmp_im)/2;
00460 cpl_flux_get_noise_window(tmp_im, zone_def,
00461 isaac_img_dark_config.hsize,
00462 isaac_img_dark_config.nsamples, &rms, NULL);
00463 cpl_matrix_set(rons, i, 1, rms * norm);
00464 cpl_msg_info(cpl_func, "RON in LR quadrant: %g", rms * norm);
00465
00466
00467 zone_def[0] = 1;
00468 zone_def[1] = cpl_image_get_size_x(tmp_im)/2;
00469 zone_def[2] = cpl_image_get_size_y(tmp_im)/2 + 1;
00470 zone_def[3] = cpl_image_get_size_y(tmp_im);
00471 cpl_flux_get_noise_window(tmp_im, zone_def,
00472 isaac_img_dark_config.hsize,
00473 isaac_img_dark_config.nsamples, &rms, NULL);
00474 cpl_matrix_set(rons, i, 2, rms * norm);
00475 cpl_msg_info(cpl_func, "RON in UL quadrant: %g", rms * norm);
00476
00477
00478 zone_def[0] = cpl_image_get_size_x(tmp_im)/2 + 1;
00479 zone_def[1] = cpl_image_get_size_x(tmp_im);
00480 zone_def[2] = cpl_image_get_size_y(tmp_im)/2 + 1;
00481 zone_def[3] = cpl_image_get_size_y(tmp_im);
00482 cpl_flux_get_noise_window(tmp_im, zone_def,
00483 isaac_img_dark_config.hsize,
00484 isaac_img_dark_config.nsamples, &rms, NULL);
00485 cpl_matrix_set(rons, i, 3, rms * norm);
00486 cpl_msg_info(cpl_func, "RON in UR quadrant: %g", rms * norm);
00487 cpl_image_delete(tmp_im);
00488 }
00489 break;
00490 case 'L':
00491
00492 rons = cpl_matrix_new(cpl_imagelist_get_size(iset)-1, 1);
00493 if (isaac_img_dark_config.hsize < 0)
00494 isaac_img_dark_config.hsize = ISAAC_DARK_HSIZE_LW_DEF;
00495
00496
00497 for (i=0; i<cpl_imagelist_get_size(iset)-1; i++) {
00498 cpl_msg_info(cpl_func, "Pair number %d", i+1);
00499
00500 if (cpl_error_get_code()) {
00501 cpl_matrix_delete(rons);
00502 cpl_imagelist_delete(iset);
00503 return NULL;
00504 }
00505 cur_frame = cpl_frameset_get_frame(framelist, i);
00506 plist = cpl_propertylist_load(cpl_frame_get_filename(cur_frame),
00507 0);
00508 ndit = isaac_pfits_get_ndit(plist);
00509 cpl_propertylist_delete(plist);
00510 if (cpl_error_get_code()) {
00511 cpl_msg_error(cpl_func, "Cannot get the NDIT");
00512 cpl_matrix_delete(rons);
00513 cpl_imagelist_delete(iset);
00514 return NULL;
00515 }
00516 norm = 0.5 * ndit;
00517 norm = sqrt(norm);
00518
00519
00520 if ((tmp_im = cpl_image_subtract_create(
00521 cpl_imagelist_get(iset, i),
00522 cpl_imagelist_get(iset, i+1))) == NULL) {
00523 cpl_msg_error(cpl_func, "Cannot subtract the images");
00524 cpl_imagelist_delete(iset);
00525 cpl_matrix_delete(rons);
00526 return NULL;
00527 }
00528
00529
00530 cpl_flux_get_noise_window(tmp_im, NULL,
00531 isaac_img_dark_config.hsize,
00532 isaac_img_dark_config.nsamples, &rms, NULL);
00533 cpl_matrix_set(rons, i, 0, rms * norm);
00534 cpl_msg_info(cpl_func, "RON: %g", rms * norm);
00535 cpl_image_delete(tmp_im);
00536 }
00537 break;
00538 default:
00539 cpl_msg_error(cpl_func, "Unsupported arm");
00540 cpl_imagelist_delete(iset);
00541 cpl_matrix_delete(rons);
00542 return NULL;
00543 break;
00544 }
00545
00546
00547 cpl_imagelist_delete(iset);
00548 return rons;
00549 }
00550
00551
00562
00563 static int isaac_img_dark_save(
00564 cpl_image * avg,
00565 cpl_matrix * rons,
00566 int set_nb,
00567 cpl_frameset * set,
00568 cpl_parameterlist * parlist,
00569 cpl_frameset * set_tot)
00570 {
00571 cpl_propertylist * plist;
00572 cpl_propertylist * qclist;
00573 cpl_propertylist * paflist;
00574 const cpl_frame * ref_frame;
00575 char * filename;
00576 char qc_str[128];
00577 int i;
00578
00579
00580 qclist = cpl_propertylist_new();
00581 cpl_propertylist_append_double(qclist, "ESO QC DARKMED",
00582 isaac_img_dark_config.dark_med);
00583 cpl_propertylist_append_double(qclist, "ESO QC DARKSTDEV",
00584 isaac_img_dark_config.dark_stdev);
00585 if (rons != NULL) {
00586 switch (cpl_matrix_get_ncol(rons)) {
00587 case 1:
00588 for (i=0; i<cpl_matrix_get_nrow(rons); i++) {
00589 sprintf(qc_str, "ESO QC RON%d", i+1);
00590 cpl_propertylist_append_double(qclist, qc_str,
00591 cpl_matrix_get(rons, i, 0));
00592 }
00593 break;
00594 case 4:
00595 for (i=0; i<cpl_matrix_get_nrow(rons); i++) {
00596 sprintf(qc_str, "ESO QC LL RON%d", i+1);
00597 cpl_propertylist_append_double(qclist, qc_str,
00598 cpl_matrix_get(rons, i, 0));
00599 sprintf(qc_str, "ESO QC LR RON%d", i+1);
00600 cpl_propertylist_append_double(qclist, qc_str,
00601 cpl_matrix_get(rons, i, 1));
00602 sprintf(qc_str, "ESO QC UL RON%d", i+1);
00603 cpl_propertylist_append_double(qclist, qc_str,
00604 cpl_matrix_get(rons, i, 2));
00605 sprintf(qc_str, "ESO QC UR RON%d", i+1);
00606 cpl_propertylist_append_double(qclist, qc_str,
00607 cpl_matrix_get(rons, i, 3));
00608 }
00609 break;
00610 default:
00611 cpl_msg_error(cpl_func, "Invalid RONs matrix format");
00612 break;
00613 }
00614 }
00615
00616
00617 filename = cpl_sprintf("isaac_img_dark_set%02d_avg.fits", set_nb);
00618 irplib_dfs_save_image(set_tot,
00619 parlist,
00620 set,
00621 avg,
00622 CPL_BPP_IEEE_FLOAT,
00623 "isaac_img_dark",
00624 ISAAC_IMG_DARK_AVG,
00625 qclist,
00626 NULL,
00627 PACKAGE "/" PACKAGE_VERSION,
00628 filename);
00629 cpl_free(filename);
00630
00631
00632 ref_frame = irplib_frameset_get_first_from_group(set, CPL_FRAME_GROUP_RAW);
00633
00634
00635 if ((plist=cpl_propertylist_load(cpl_frame_get_filename(ref_frame),
00636 0)) == NULL) {
00637 cpl_msg_error(cpl_func, "getting header from reference frame");
00638 cpl_propertylist_delete(qclist);
00639 return -1;
00640 }
00641
00642
00643 paflist = cpl_propertylist_new();
00644 cpl_propertylist_copy_property_regexp(paflist, plist,
00645 "^(ARCFILE|MJD-OBS|ESO TPL ID|ESO DPR TECH|DATE-OBS|ESO DET DIT|"
00646 "ESO DET NDIT|ESO DET NCORRS|ESO DET NDSAMPLES|ESO DET MODE NAME)$", 0);
00647 cpl_propertylist_delete(plist);
00648
00649
00650 cpl_propertylist_copy_property_regexp(paflist, qclist, "", 0);
00651 cpl_propertylist_delete(qclist);
00652
00653
00654 cpl_propertylist_update_string(paflist, CPL_DFS_PRO_CATG,
00655 ISAAC_IMG_DARK_AVG);
00656
00657
00658 filename = cpl_sprintf("isaac_img_dark_set%02d.paf", set_nb);
00659 cpl_dfs_save_paf("ISAAC",
00660 "isaac_img_dark",
00661 paflist,
00662 filename);
00663 cpl_free(filename);
00664 cpl_propertylist_delete(paflist);
00665 return 0;
00666 }
00667
00668
00675
00676 static int isaac_img_dark_compare(
00677 const cpl_frame * frame1,
00678 const cpl_frame * frame2)
00679 {
00680 int comparison;
00681 cpl_propertylist * plist1;
00682 cpl_propertylist * plist2;
00683 double dval1, dval2;
00684 int ival1, ival2;
00685
00686
00687 if (frame1==NULL || frame2==NULL) return -1;
00688
00689
00690 if ((plist1=cpl_propertylist_load(cpl_frame_get_filename(frame1),
00691 0)) == NULL) {
00692 cpl_msg_error(cpl_func, "getting header from reference frame");
00693 return -1;
00694 }
00695 if ((plist2=cpl_propertylist_load(cpl_frame_get_filename(frame2),
00696 0)) == NULL) {
00697 cpl_msg_error(cpl_func, "getting header from reference frame");
00698 cpl_propertylist_delete(plist1);
00699 return -1;
00700 }
00701
00702
00703 if (cpl_error_get_code()) {
00704 cpl_propertylist_delete(plist1);
00705 cpl_propertylist_delete(plist2);
00706 return -1;
00707 }
00708
00709
00710 comparison = 1;
00711 dval1 = isaac_pfits_get_dit(plist1);
00712 dval2 = isaac_pfits_get_dit(plist2);
00713 if (cpl_error_get_code()) {
00714 cpl_msg_error(cpl_func, "cannot get exposure time");
00715 cpl_propertylist_delete(plist1);
00716 cpl_propertylist_delete(plist2);
00717 return -1;
00718 }
00719 if (fabs(dval1-dval2) > 1e-5) comparison = 0;
00720
00721
00722 ival1 = isaac_pfits_get_ndit(plist1);
00723 ival2 = isaac_pfits_get_ndit(plist2);
00724 if (cpl_error_get_code()) {
00725 cpl_msg_error(cpl_func, "cannot get NDIT");
00726 cpl_propertylist_delete(plist1);
00727 cpl_propertylist_delete(plist2);
00728 return -1;
00729 }
00730 if (ival1 != ival2) comparison = 0;
00731
00732
00733 ival1 = isaac_pfits_get_rom(plist1);
00734 ival2 = isaac_pfits_get_rom(plist2);
00735 if (cpl_error_get_code()) {
00736 cpl_msg_error(cpl_func, "cannot get read-out mode");
00737 cpl_propertylist_delete(plist1);
00738 cpl_propertylist_delete(plist2);
00739 return -1;
00740 }
00741 if (ival1 != ival2) comparison = 0;
00742
00743
00744 cpl_propertylist_delete(plist1);
00745 cpl_propertylist_delete(plist2);
00746 return comparison;
00747 }
00748