CR2RE Pipeline Reference Manual 1.6.10
hdrl_catalogue.c
1/*
2 * This file is part of the HDRL
3 * Copyright (C) 2016 European Southern Observatory
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifdef HAVE_CONFIG_H
21#include <config.h>
22#endif
23
24/*-----------------------------------------------------------------------------
25 Includes
26-----------------------------------------------------------------------------*/
27
28#include <assert.h>
29#include <math.h>
30#include <stdint.h>
31
32#include "hdrl_catalogue.h"
33#include "hdrl_image.h"
34#include "hdrl_types.h"
35#include "hdrl_utils.h"
36
37/*-----------------------------------------------------------------------------
38 Static
39 -----------------------------------------------------------------------------*/
40
41
42
43
64/*----------------------------------------------------------------------------*/
65
68/*-----------------------------------------------------------------------------
69 Catalogue parameters Definition
70 -----------------------------------------------------------------------------*/
71
74typedef struct {
75 HDRL_PARAMETER_HEAD;
76 int obj_min_pixels;
77 double obj_threshold;
78 cpl_boolean obj_deblending;
79 double obj_core_radius;
80 cpl_boolean bkg_estimate;
81 int bkg_mesh_size;
82 hdrl_catalogue_options resulttype;
83 double bkg_smooth_fwhm;
84 double det_eff_gain;
85 double det_saturation;
86} hdrl_catalogue_parameter;
87
88/* parameter type */
89static hdrl_parameter_typeobj hdrl_catalogue_parameter_type = {
90 HDRL_PARAMETER_CATALOGUE, /* type */
91 (hdrl_alloc *)&cpl_malloc, /* fp_alloc */
92 (hdrl_free *)&cpl_free, /* fp_free */
93 NULL, /* fp_destroy */
94 sizeof(hdrl_catalogue_parameter), /* obj_size */
95};
96
97static cpl_error_code hdrl_cleanup_qclist(cpl_propertylist * qclist);
98
99/*----------------------------------------------------------------------------*/
106/*----------------------------------------------------------------------------*/
107static cpl_error_code
108hdrl_catalogue_parameter_verify(const hdrl_parameter * param)
109{
110 cpl_error_ensure(param != NULL, CPL_ERROR_NULL_INPUT,
111 return CPL_ERROR_NULL_INPUT, "NULL Input Parameters");
112 cpl_error_ensure(hdrl_catalogue_parameter_check(param),
113 CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
114 "Expected catalogue parameter") ;
115
116 const hdrl_catalogue_parameter * param_loc = (const hdrl_catalogue_parameter *)param ;
117
118 cpl_error_ensure(param_loc->obj_min_pixels > 0, CPL_ERROR_ILLEGAL_INPUT,
119 return CPL_ERROR_ILLEGAL_INPUT, "obj.min-pixels > 0");
120
121 cpl_error_ensure(param_loc->obj_threshold > 0., CPL_ERROR_ILLEGAL_INPUT,
122 return CPL_ERROR_ILLEGAL_INPUT, "obj_threshold > 0.");
123
124 cpl_error_ensure(param_loc->obj_core_radius > 0., CPL_ERROR_ILLEGAL_INPUT,
125 return CPL_ERROR_ILLEGAL_INPUT, "obj_core_radius > 0.");
126
127 if (param_loc->bkg_estimate) {
128 cpl_error_ensure(param_loc->bkg_mesh_size > 2, CPL_ERROR_ILLEGAL_INPUT,
129 return CPL_ERROR_ILLEGAL_INPUT, "bkg_mesh_size > 2");
130
131 cpl_error_ensure(param_loc->bkg_smooth_fwhm >= 0., CPL_ERROR_ILLEGAL_INPUT,
132 return CPL_ERROR_ILLEGAL_INPUT, "bkg_mesh_size >= 0.");
133 }
134
135 cpl_error_ensure(param_loc->det_eff_gain > 0., CPL_ERROR_ILLEGAL_INPUT,
136 return CPL_ERROR_ILLEGAL_INPUT, "det_eff_gain > 0.");
137
138 cpl_error_ensure(param_loc->det_saturation > 0. ||
139 param_loc->det_saturation == HDRL_SATURATION_INIT,
140 CPL_ERROR_ILLEGAL_INPUT, return CPL_ERROR_ILLEGAL_INPUT,
141 "det_saturation > 0");
142
143 return CPL_ERROR_NONE ;
144
145}
146
149/*----------------------------------------------------------------------------*/
173/*----------------------------------------------------------------------------*/
174hdrl_parameter * hdrl_catalogue_parameter_create(int obj_min_pixels,
175 double obj_threshold, cpl_boolean obj_deblending,
176 double obj_core_radius,
177 cpl_boolean bkg_estimate, int bkg_mesh_size,
178 double bkg_smooth_fwhm, double det_eff_gain,
179 double det_saturation,
180 hdrl_catalogue_options resulttype)
181{
182 hdrl_catalogue_parameter * p = (hdrl_catalogue_parameter *)
183 hdrl_parameter_new(&hdrl_catalogue_parameter_type);
184
185 p->obj_min_pixels = obj_min_pixels;
186 p->obj_threshold = obj_threshold;
187 p->obj_deblending = obj_deblending;
188 p->obj_core_radius = obj_core_radius;
189 p->bkg_estimate = bkg_estimate;
190 p->bkg_mesh_size = bkg_mesh_size;
191 p->resulttype = resulttype;
192 p->bkg_smooth_fwhm = bkg_smooth_fwhm;
193 p->det_eff_gain = det_eff_gain;
194 p->det_saturation = det_saturation;
195
196 if (!bkg_estimate) {
197 p->resulttype &= ~(HDRL_CATALOGUE_BKG);
198 }
199
200 if (hdrl_catalogue_parameter_verify((hdrl_parameter *)p)) {
201 cpl_free(p);
202 return NULL;
203 }
204 return (hdrl_parameter *)p;
205
206}
207
208/*----------------------------------------------------------------------------*/
214/*----------------------------------------------------------------------------*/
215cpl_boolean hdrl_catalogue_parameter_check(const hdrl_parameter * self)
216{
217 return hdrl_parameter_check_type(self, &hdrl_catalogue_parameter_type);
218}
219
220/* ---------------------------------------------------------------------------*/
229/* ---------------------------------------------------------------------------*/
230cpl_error_code hdrl_catalogue_parameter_set_option(hdrl_parameter * par,
231 hdrl_catalogue_options opt)
232{
233 cpl_ensure_code(par, CPL_ERROR_NULL_INPUT);
234 cpl_error_code err = hdrl_catalogue_parameter_verify(par);
235 if (err != CPL_ERROR_NONE) {
236 return err;
237 }
238 hdrl_catalogue_parameter * par_ = (hdrl_catalogue_parameter*)par;
239 par_->resulttype = opt;
240 if (!par_->bkg_estimate) {
241 par_->resulttype &= ~(HDRL_CATALOGUE_BKG);
242 }
243 return hdrl_catalogue_parameter_verify(par);
244}
245
246/*----------------------------------------------------------------------------*/
268/*----------------------------------------------------------------------------*/
270 const char *base_context,
271 const char *prefix,
272 hdrl_parameter *defaults)
273{
274
275 cpl_ensure(prefix && base_context && defaults,
276 CPL_ERROR_NULL_INPUT, NULL);
277
278 cpl_ensure(hdrl_catalogue_parameter_check(defaults),
279 CPL_ERROR_INCOMPATIBLE_INPUT, NULL);
280
281 hdrl_catalogue_parameter *par = (hdrl_catalogue_parameter*)defaults;
282
283 cpl_parameterlist *parlist = cpl_parameterlist_new();
284
285 hdrl_setup_vparameter(parlist, prefix, ".", "obj.", "min-pixels",
286 base_context, "Minimum pixel area for each detected "
287 "object.", CPL_TYPE_INT, par->obj_min_pixels);
288
289 hdrl_setup_vparameter(parlist, prefix, ".", "obj.", "threshold",
290 base_context,
291 "Detection threshold in sigma above sky.",
292 CPL_TYPE_DOUBLE, par->obj_threshold);
293
294 hdrl_setup_vparameter(parlist, prefix, ".", "obj.", "deblending",
295 base_context, "Use deblending?.",
296 CPL_TYPE_BOOL, par->obj_deblending);
297
298 hdrl_setup_vparameter(parlist, prefix, ".", "obj.", "core-radius",
299 base_context, "Value of Rcore in pixels.",
300 CPL_TYPE_DOUBLE, par->obj_core_radius);
301
302 hdrl_setup_vparameter(parlist, prefix, ".", "bkg.", "estimate",
303 base_context, "Estimate background from input, if "
304 "false it is assumed input is already background "
305 "corrected with median 0",
306 CPL_TYPE_BOOL, par->bkg_estimate);
307
308 hdrl_setup_vparameter(parlist, prefix, ".", "bkg.", "mesh-size",
309 base_context, "Background smoothing box size.",
310 CPL_TYPE_INT, par->bkg_mesh_size);
311
312 /* --prefix.result-type not an cpl option*/
313
314 hdrl_setup_vparameter(parlist, prefix, ".", "bkg.", "smooth-gauss-fwhm",
315 base_context, "The FWHM of the Gaussian kernel used "
316 "in convolution for object detection.",
317 CPL_TYPE_DOUBLE, par->bkg_smooth_fwhm);
318
319 hdrl_setup_vparameter(parlist, prefix, ".", "det.", "effective-gain",
320 base_context, "Detector gain value to rescale "
321 "convert intensity to electrons",
322 CPL_TYPE_DOUBLE, par->det_eff_gain);
323
324 hdrl_setup_vparameter(parlist, prefix, ".", "det.", "saturation",
325 base_context, "Detector saturation value",
326 CPL_TYPE_DOUBLE, par->det_saturation);
327
328 if (cpl_error_get_code()) {
329 cpl_parameterlist_delete(parlist);
330 return NULL;
331 }
332
333 return parlist;
334}
335
336/*----------------------------------------------------------------------------*/
357/*----------------------------------------------------------------------------*/
359 const cpl_parameterlist * parlist,
360 const char * prefix)
361{
362 cpl_ensure(prefix && parlist, CPL_ERROR_NULL_INPUT, NULL);
363 char * name ;
364 const cpl_parameter * par;
365 int obj_min_pixels, bkg_mesh_size;
366 cpl_boolean obj_deblending, bkg_estimate;
367 double obj_threshold, obj_core_radius, bkg_smooth_fwhm, det_eff_gain,
368 det_saturation;
369
370
371 name = hdrl_join_string(".", 2, prefix, "obj.min-pixels");
372 par = cpl_parameterlist_find_const(parlist, name);
373 obj_min_pixels = cpl_parameter_get_int(par);
374 cpl_free(name) ;
375
376 name = hdrl_join_string(".", 2, prefix, "obj.threshold");
377 par = cpl_parameterlist_find_const(parlist, name);
378 obj_threshold = cpl_parameter_get_double(par);
379 cpl_free(name) ;
380
381 name = hdrl_join_string(".", 2, prefix, "obj.deblending");
382 par = cpl_parameterlist_find_const(parlist, name);
383 obj_deblending = cpl_parameter_get_bool(par);
384 cpl_free(name) ;
385
386 name = hdrl_join_string(".", 2, prefix, "obj.core-radius");
387 par=cpl_parameterlist_find_const(parlist, name);
388 obj_core_radius = cpl_parameter_get_double(par);
389 cpl_free(name) ;
390
391 name = hdrl_join_string(".", 2, prefix, "bkg.estimate");
392 par = cpl_parameterlist_find_const(parlist, name);
393 bkg_estimate = cpl_parameter_get_bool(par);
394 cpl_free(name) ;
395
396 name = hdrl_join_string(".", 2, prefix, "bkg.mesh-size");
397 par = cpl_parameterlist_find_const(parlist, name);
398 bkg_mesh_size = cpl_parameter_get_int(par);
399 cpl_free(name) ;
400
401 name = hdrl_join_string(".", 2, prefix, "bkg.smooth-gauss-fwhm");
402 par = cpl_parameterlist_find_const(parlist, name);
403 bkg_smooth_fwhm = cpl_parameter_get_double(par);
404 cpl_free(name) ;
405
406 name = hdrl_join_string(".", 2, prefix, "det.effective-gain");
407 par = cpl_parameterlist_find_const(parlist, name);
408 det_eff_gain = cpl_parameter_get_double(par);
409 cpl_free(name) ;
410
411 name = hdrl_join_string(".", 2, prefix, "det.saturation");
412 par = cpl_parameterlist_find_const(parlist, name);
413 det_saturation = cpl_parameter_get_double(par);
414 cpl_free(name) ;
415
416 if (cpl_error_get_code()) {
417 cpl_error_set_message(cpl_func, CPL_ERROR_DATA_NOT_FOUND,
418 "Error while parsing parameterlist with prefix %s", prefix);
419 return NULL;
420 } else {
421 return hdrl_catalogue_parameter_create(obj_min_pixels, obj_threshold,
422 obj_deblending, obj_core_radius,
423 bkg_estimate,
424 bkg_mesh_size, bkg_smooth_fwhm,
425 det_eff_gain, det_saturation,
426 HDRL_CATALOGUE_ALL);
427 }
428
429}
430
431/*----------------------------------------------------------------------------*/
438/*----------------------------------------------------------------------------*/
439void hdrl_catalogue_result_delete(hdrl_catalogue_result * result)
440{
441 if (result == NULL) {
442 return;
443 }
444 cpl_table_delete(result->catalogue);
445 cpl_image_delete(result->background);
446 cpl_image_delete(result->segmentation_map);
447 cpl_propertylist_delete(result->qclist);
448 cpl_free(result);
449}
450/*----------------------------------------------------------------------------*/
460/*----------------------------------------------------------------------------*/
461hdrl_catalogue_result *
462hdrl_catalogue_compute(const cpl_image * image_, const cpl_image * confidence_map,
463 const cpl_wcs * wcs, hdrl_parameter * param_)
464{
465 hdrl_casu_fits *inf,*inconf = NULL;
466 hdrl_casu_result * intres = NULL;
467 cpl_ensure(image_, CPL_ERROR_NULL_INPUT, NULL);
468 if (hdrl_catalogue_parameter_verify((hdrl_parameter *)param_)) {
469 return NULL;
470 }
471
472 CPL_DIAG_PRAGMA_PUSH_IGN(-Wcast-qual);
473
474 hdrl_catalogue_result * res = NULL;
475 const hdrl_catalogue_parameter * param = (hdrl_catalogue_parameter *)param_;
476 cpl_image * image = (cpl_image *)image_;
477 if (cpl_image_get_type(image) != CPL_TYPE_DOUBLE) {
478 image = cpl_image_cast(image, CPL_TYPE_DOUBLE);
479 }
480
481 inf = hdrl_casu_fits_wrap((cpl_image *)image);
482
483 cpl_image * conf_ = (cpl_image*)confidence_map;
484
485 CPL_DIAG_PRAGMA_POP;
486
487
488 if (confidence_map) {
489 if (cpl_image_get_min(confidence_map) < 0) {
490 cpl_error_set_message(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT,
491 "confidence_map must only contain "
492 "positive numbers");
493 goto cleanup;
494 }
495 }
496
497 if (cpl_image_get_bpm_const(image) != NULL) {
498 if (confidence_map) {
499 conf_ = cpl_image_cast(confidence_map, CPL_TYPE_DOUBLE);
500 }
501 else {
502 conf_ = cpl_image_new(cpl_image_get_size_x(image),
503 cpl_image_get_size_y(image), CPL_TYPE_DOUBLE);
504 cpl_image_add_scalar(conf_, 100);
505 }
506 cpl_image_reject_from_mask(conf_, cpl_image_get_bpm_const(image));
507 cpl_image_fill_rejected(conf_, 0);
508 cpl_image_accept_all(conf_);
509 }
510 else if (confidence_map &&
511 cpl_image_get_type(confidence_map) != CPL_TYPE_DOUBLE) {
512 conf_ = cpl_image_cast(confidence_map, CPL_TYPE_DOUBLE);
513 }
514 inconf = hdrl_casu_fits_wrap((cpl_image *)conf_);
515
516 /* Run catalogue */
517 res = cpl_calloc(sizeof(hdrl_catalogue_result), 1);
518 intres = cpl_calloc(sizeof(hdrl_casu_result), 1);
519 hdrl_casu_catalogue(inf, inconf, wcs,
520 param->obj_min_pixels, param->obj_threshold,
521 param->obj_deblending, param->obj_core_radius,
522 param->bkg_estimate,
523 param->bkg_mesh_size, (int)param->resulttype,
524 param->bkg_smooth_fwhm, param->det_eff_gain,
525 param->det_saturation, intres);
526
527 if (intres->catalogue) {
528 res->catalogue = cpl_table_duplicate( hdrl_casu_tfits_get_table(intres->catalogue));
529 res->qclist = cpl_propertylist_duplicate(hdrl_casu_tfits_get_ehu( intres->catalogue));
530 hdrl_cleanup_qclist(res->qclist);
531 }
532 res->segmentation_map = intres->segmentation_map;
533 res->background = intres->background;
534
535cleanup:
536 inf->image = NULL;
537 if (image_ != image) {
538 cpl_image_delete(image);
539 }
540 if (inconf && inconf->image == confidence_map) {
541 inconf->image = NULL;
542 }
544 if (intres) {
545 hdrl_casu_tfits_delete(intres->catalogue);
546 }
547 hdrl_casu_fits_delete(inconf);
548 cpl_free(intres);
549
550 return res;
551}
552
553/*----------------------------------------------------------------------------*/
560static cpl_error_code hdrl_cleanup_qclist(cpl_propertylist * qclist){
561
562 cpl_propertylist * qclocal = cpl_propertylist_duplicate(qclist);
563 cpl_propertylist_empty(qclist);
564
565 if (cpl_propertylist_has(qclocal, "APCOR1"))
566 cpl_propertylist_copy_property(qclist, qclocal, "APCOR1");
567 if (cpl_propertylist_has(qclocal, "APCOR2"))
568 cpl_propertylist_copy_property(qclist, qclocal, "APCOR2");
569 if (cpl_propertylist_has(qclocal, "APCOR3"))
570 cpl_propertylist_copy_property(qclist, qclocal, "APCOR3");
571 if (cpl_propertylist_has(qclocal, "APCOR4"))
572 cpl_propertylist_copy_property(qclist, qclocal, "APCOR4");
573 if (cpl_propertylist_has(qclocal, "APCOR5"))
574 cpl_propertylist_copy_property(qclist, qclocal, "APCOR5");
575 if (cpl_propertylist_has(qclocal, "APCOR6"))
576 cpl_propertylist_copy_property(qclist, qclocal, "APCOR6");
577 if (cpl_propertylist_has(qclocal, "APCOR7"))
578 cpl_propertylist_copy_property(qclist, qclocal, "APCOR7");
579 if (cpl_propertylist_has(qclocal, "APCORPK"))
580 cpl_propertylist_copy_property(qclist, qclocal, "APCORPK");
581 if (cpl_propertylist_has(qclocal, "SYMBOL1"))
582 cpl_propertylist_copy_property(qclist, qclocal, "SYMBOL1");
583 if (cpl_propertylist_has(qclocal, "SYMBOL2"))
584 cpl_propertylist_copy_property(qclist, qclocal, "SYMBOL2");
585 if (cpl_propertylist_has(qclocal, "SYMBOL3"))
586 cpl_propertylist_copy_property(qclist, qclocal, "SYMBOL3");
587 if (cpl_propertylist_has(qclocal, "SYMBOL4"))
588 cpl_propertylist_copy_property(qclist, qclocal, "SYMBOL4");
589 if (cpl_propertylist_has(qclocal, "SYMBOL5"))
590 cpl_propertylist_copy_property(qclist, qclocal, "SYMBOL5");
591 if (cpl_propertylist_has(qclocal, "SYMBOL6"))
592 cpl_propertylist_copy_property(qclist, qclocal, "SYMBOL6");
593 if (cpl_propertylist_has(qclocal, "SYMBOL7"))
594 cpl_propertylist_copy_property(qclist, qclocal, "SYMBOL7");
595 if (cpl_propertylist_has(qclocal, "SYMBOL8"))
596 cpl_propertylist_copy_property(qclist, qclocal, "SYMBOL8");
597 if (cpl_propertylist_has(qclocal, "SYMBOL9"))
598 cpl_propertylist_copy_property(qclist, qclocal, "SYMBOL9");
599
600/*
601 if (cpl_propertylist_has(qclocal, "ESO DRS CLASSIFD"))
602 cpl_propertylist_copy_property(qclist, qclocal, "ESO DRS CLASSIFD");
603 if (cpl_propertylist_has(qclocal, "ESO DRS CROWDED"))
604 cpl_propertylist_copy_property(qclist, qclocal, "ESO DRS CROWDED");
605 if (cpl_propertylist_has(qclocal, "ESO DRS FILTFWHM"))
606 cpl_propertylist_copy_property(qclist, qclocal, "ESO DRS FILTFWHM");
607 if (cpl_propertylist_has(qclocal, "ESO DRS MINPIX"))
608 cpl_propertylist_copy_property(qclist, qclocal, "ESO DRS MINPIX");
609 if (cpl_propertylist_has(qclocal, "ESO DRS NXOUT"))
610 cpl_propertylist_copy_property(qclist, qclocal, "ESO DRS NXOUT");
611 if (cpl_propertylist_has(qclocal, "ESO DRS NYOUT"))
612 cpl_propertylist_copy_property(qclist, qclocal, "ESO DRS NYOUT");
613 if (cpl_propertylist_has(qclocal, "ESO DRS RCORE"))
614 cpl_propertylist_copy_property(qclist, qclocal, "ESO DRS RCORE");
615 if (cpl_propertylist_has(qclocal, "ESO DRS SEEING"))
616 cpl_propertylist_copy_property(qclist, qclocal, "ESO DRS SEEING");
617 if (cpl_propertylist_has(qclocal, "ESO DRS THRESHOL"))
618 cpl_propertylist_copy_property(qclist, qclocal, "ESO DRS THRESHOL");
619 if (cpl_propertylist_has(qclocal, "ESO DRS XCOL"))
620 cpl_propertylist_copy_property(qclist, qclocal, "ESO DRS XCOL");
621 if (cpl_propertylist_has(qclocal, "ESO DRS YCOL"))
622 cpl_propertylist_copy_property(qclist, qclocal, "ESO DRS YCOL");
623 if (cpl_propertylist_has(qclocal, "ESO QC APERTURE_CORR"))
624 cpl_propertylist_copy_property(qclist, qclocal, "ESO QC APERTURE_CORR");
625 if (cpl_propertylist_has(qclocal, "ESO QC ELLIPTICITY"))
626 cpl_propertylist_copy_property(qclist, qclocal, "ESO QC ELLIPTICITY");
627 if (cpl_propertylist_has(qclocal, "ESO QC IMAGE_SIZE"))
628 cpl_propertylist_copy_property(qclist, qclocal, "ESO QC IMAGE_SIZE");
629 if (cpl_propertylist_has(qclocal, "ESO QC MEAN_SKY"))
630 cpl_propertylist_copy_property(qclist, qclocal, "ESO QC MEAN_SKY");
631 if (cpl_propertylist_has(qclocal, "ESO QC NOISE_OBJ"))
632 cpl_propertylist_copy_property(qclist, qclocal, "ESO QC NOISE_OBJ");
633 if (cpl_propertylist_has(qclocal, "ESO QC POSANG"))
634 cpl_propertylist_copy_property(qclist, qclocal, "ESO QC POSANG");
635 if (cpl_propertylist_has(qclocal, "ESO QC SATURATION"))
636 cpl_propertylist_copy_property(qclist, qclocal, "ESO QC SATURATION");
637 if (cpl_propertylist_has(qclocal, "ESO QC SKY_NOISE"))
638 cpl_propertylist_copy_property(qclist, qclocal, "ESO QC SKY_NOISE");
639 if (cpl_propertylist_has(qclocal, "HISTORY"))
640 cpl_propertylist_copy_property(qclist, qclocal, "HISTORY");
641
642*/
643
644 cpl_propertylist_delete(qclocal);
645
646 return cpl_error_get_code();
647}
hdrl_casu_fits * hdrl_casu_fits_wrap(cpl_image *im)
Wrap an image in a hdrl_casu_fits wrapper.
cpl_propertylist * hdrl_casu_tfits_get_ehu(hdrl_casu_tfits *p)
Get the propertylist for the extension header for a given hdrl_casu_tfits image.
Definition: hdrl_cat_casu.c:98
void hdrl_casu_tfits_delete(hdrl_casu_tfits *p)
Free all the workspace associated with a hdrl_casu_fits object.
void hdrl_casu_fits_delete(hdrl_casu_fits *p)
Free all the workspace associated with a hdrl_casu_fits object.
cpl_table * hdrl_casu_tfits_get_table(hdrl_casu_tfits *p)
Get the CPL table from the hdrl_casu_tfits object.
cpl_error_code hdrl_casu_catalogue(hdrl_casu_fits *infile, hdrl_casu_fits *conf, const cpl_wcs *wcs, cpl_size ipix, double threshold, cpl_size icrowd, double rcore, cpl_size bkg_subtr, cpl_size nbsize, hdrl_catalogue_options cattype, double filtfwhm, double gainloc, double saturation, hdrl_casu_result *res)
Generate object catalogues from input images.
hdrl_catalogue_result * hdrl_catalogue_compute(const cpl_image *image_, const cpl_image *confidence_map, const cpl_wcs *wcs, hdrl_parameter *param_)
build object catalog
void hdrl_catalogue_result_delete(hdrl_catalogue_result *result)
delete hdrl parameter result object
hdrl_parameter * hdrl_catalogue_parameter_create(int obj_min_pixels, double obj_threshold, cpl_boolean obj_deblending, double obj_core_radius, cpl_boolean bkg_estimate, int bkg_mesh_size, double bkg_smooth_fwhm, double det_eff_gain, double det_saturation, hdrl_catalogue_options resulttype)
Creates catalogue Parameters object.
cpl_boolean hdrl_catalogue_parameter_check(const hdrl_parameter *self)
Check that the parameter is a catalogue parameter.
hdrl_parameter * hdrl_catalogue_parameter_parse_parlist(const cpl_parameterlist *parlist, const char *prefix)
Parse parameter list to create input parameters for the catalogue.
cpl_parameterlist * hdrl_catalogue_parameter_create_parlist(const char *base_context, const char *prefix, hdrl_parameter *defaults)
Create parameter list for the catalogue computation.
cpl_error_code hdrl_catalogue_parameter_set_option(hdrl_parameter *par, hdrl_catalogue_options opt)
set result option of catalogue parameter
char * hdrl_join_string(const char *sep_, int n,...)
join strings together
Definition: hdrl_utils.c:812