40#include "eris_nix_dfs.h"
41#include "eris_nix_scired.h"
49static const char eris_nix_img_hdrl_stack_description[] =
50"This recipe uses HDRL functions to rebin and stack a set of calibrated \n"
51"ERIS/NIX jitter frames.\n"
55" DO CATG Explanation Req. #Frames\n"
56" ------- ----------- --- -------\n"
57" "ERIS_NIX_CAL_PHOT_OBJECT_JITTER_PRO_CATG
58 " calibrated frames Y 1-n\n"
61" "ERIS_NIX_CAL_PHOT_STD_JITTER_PRO_CATG
62 " calibrated standard Y 1-n\n"
63" frames to be stacked.\n"
67" DO CATG Explanation \n"
68" ------- ----------- \n"
69" "ERIS_NIX_IMG_OBS_COMBINED_PRO_CATG
70 " the stacked image of the target.\n"
72" "ERIS_NIX_IMG_STD_COMBINED_PRO_CATG
73 " the stacked image of the standard.\n"
74" "ERIS_NIX_IMG_CATALOGUE_PRO_CATG
75 " catalogue of sources in the\n"
78" The output image will be in a FITS file named \n"
79" 'stack.<first input filename>', with extensions:\n"
80" - DATA, with the stacked target or standard data.\n"
81" - ERR, with the error plane.\n"
82" - DQ, with the stacked image quality\n"
83" - CONFIDENCE, with the target confidence plane.\n"
84" A catalogue of sources in the image will be written to FITS file \n"
85" 'cat.stack.<first input filename>'.\n"
88"Notes on the method.\n"
89" The stacking uses hdrl_resample_compute to combine all jitter\n"
90" images in a single cloud of points. When creating the resampled \n"
91" output image all information is used in a single interpolation \n"
92" step, i.e. no image-by-image interpolation is done.\n"
95#define RECIPE_NAME "eris_nix_img_hdrl_stack"
96#define CONTEXT "eris."RECIPE_NAME
101cpl_recipe_define(eris_nix_img_hdrl_stack, ERIS_BINARY_VERSION,
105 "Stack calibrated ERIS/NIX jitter frames using HDRL",
106 eris_nix_img_hdrl_stack_description);
122static cpl_error_code eris_nix_img_hdrl_stack_fill_parameterlist(
123 cpl_parameterlist * self) {
125 if (cpl_error_get_code() != CPL_ERROR_NONE)
return cpl_error_get_code();
127 hdrl_parameter * catalogue_defaults = NULL;
128 cpl_parameterlist * catalogue_parlist = NULL;
129 cpl_parameter * p = NULL;
149 eris_nix_hdrl_stack_param_set(CONTEXT, self);
155 10.0, CPL_TRUE, 64, 2.0, 3.0,
156 ERIS_NIX_SATURATION_DEFAULT, HDRL_CATALOGUE_ALL);
158 "catalogue", catalogue_defaults);
162 for (p = cpl_parameterlist_get_first(catalogue_parlist);
164 p = cpl_parameterlist_get_next(catalogue_parlist)) {
166 const char * pname = cpl_parameter_get_name(p);
167 if (strstr(pname,
"minmax") == NULL) {
168 cpl_parameter * duplicate = cpl_parameter_duplicate(p);
169 cpl_parameterlist_append(self, duplicate);
175 p = cpl_parameter_new_enum(CONTEXT
".catalogue.ao-params",
177 "Default catalogue.core-radius and "
178 "catalogue.mesh-size depending on "
181 "auto", 2,
"auto",
"user");
182 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"catalogue.ao-params");
183 cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
184 cpl_parameterlist_append(self, p);
186 p = cpl_parameter_new_value(CONTEXT
".debug-data",
187 CPL_TYPE_BOOL,
"true to save interim results",
189 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"debug-data");
190 cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
191 cpl_parameterlist_append(self, p);
196 cpl_parameterlist_delete(catalogue_parlist);
210static int eris_nix_img_hdrl_stack(cpl_frameset * frameset,
211 const cpl_parameterlist * parlist) {
216 return (
int)cpl_error_get_code();
cpl_error_code eris_nix_scired_hdrl_stack(cpl_frameset *frameset, const cpl_parameterlist *parlist, const char *recipe_name, const char *context)
This rebin and stack a set of calibrated ERIS/NIX jitter frames.
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_parameterlist * hdrl_catalogue_parameter_create_parlist(const char *base_context, const char *prefix, hdrl_parameter *defaults)
Create parameter list for the catalogue computation.
void hdrl_parameter_delete(hdrl_parameter *obj)
shallow delete of a parameter