30#include <hdrl_utils.h>
31#include <eris_ifu_dfs.h>
32#include <eris_ifu_strehl.h>
36#define HDRLDEMO_RAW_BPM "RAW_BPM"
37#define HDRLDEMO_RAW_ERROR "RAW_ERROR"
47#define RECIPE_NAME "eris_ifu_strehl"
49static char eris_ifu_strehl_description[] =
51"The recipe computes the Strehl on individual bias subtracted images. \n"
55" DO category: Explanation: Required: \n"
57" RAW_BPM Bad Pixel Mask No \n"
58" RAW_ERROR Associated Error No \n"
62" DO category: Explanation: \n"
63" ERIS_IFU_STREHL Fitsfile containing strehl as QC param \n"
65"Usage of the recipe: \n"
67"There is currently one method implemented: \n"
69"The recipe assumes that the input raw image contains a single object \n"
70"and it is already pre-processed. This means that the instrument \n"
71"signature has been removed and the contribute from the sky background \n"
72"subtracted. Additionally, it allows the user to correct a residual \n"
73"local sky background evaluated in an annular region centred on the \n"
74"peak of the object PSF, by setting the values of the corresponding \n"
75"parameters (--bkg-radius-low, and --bkg-radius-high in arcsec units). \n"
77"The PSF is identified and its integrated flux, whose determination is \n"
78"controlled by the parameter --flux-radius (in arcsec), is normalized \n"
79"to unity. Next the PSF barycentre is computed and used to generate the \n"
80"theoretical normalised PSF. This depends on i) the telescope pupil \n"
81"characteristics (telescope radius and central obstruction parameters, \n"
82"controlled by --m1, and --m2 in meter) ii) the wavelength (parameter \n"
83"--wavelength in meter) at which the image has been obtained and iii) \n"
84"the detector pixel scale on sky in arcsec (--pixel-scale-x, and \n"
87"Then the Strehl ratio is obtained by dividing the maximum intensity of \n"
88"the image PSF by the maximum intensity of the ideal PSF. \n"
90"Please note that if no error image is provided, the error is estimated \n"
91"by measuring the MAD (scaled to an rms) on the input image, i.e. each \n"
92"pixel has the same associated error. \n"
101cpl_recipe_define(eris_ifu_strehl, ERIS_BINARY_VERSION,
"Andrea Modigliani",
102 PACKAGE_BUGREPORT,
"2022",
"Computes Strehl",
103 eris_ifu_strehl_description);
113static cpl_error_code eris_ifu_strehl_fill_parameterlist(
114 cpl_parameterlist * self)
116 cpl_parameter * par ;
145 RECIPE_NAME,
"",
"region-", deflts);
147 for (cpl_parameter * p = cpl_parameterlist_get_first(reg_param) ;
148 p != NULL; p = cpl_parameterlist_get_next(reg_param))
149 cpl_parameterlist_append(self, cpl_parameter_duplicate(p));
150 cpl_parameterlist_delete(reg_param);
153 hdrl_parameter * s_def =
156 0.0165966, 0.0165966,
159 cpl_parameterlist * s_param =
162 for (cpl_parameter * p = cpl_parameterlist_get_first(s_param);
163 p != NULL; p = cpl_parameterlist_get_next(s_param))
164 cpl_parameterlist_append(self, cpl_parameter_duplicate(p));
165 cpl_parameterlist_delete(s_param);
167 return CPL_ERROR_NONE;
177static int eris_ifu_strehl(
178 cpl_frameset * frameset,
179 const cpl_parameterlist * parlist)
181 eris_ifu_strehl_compute(frameset, parlist, RECIPE_NAME);
183 return (
int)cpl_error_get_code();
void hdrl_parameter_delete(hdrl_parameter *obj)
shallow delete of a parameter
cpl_parameterlist * hdrl_strehl_parameter_create_parlist(const char *base_context, const char *prefix, hdrl_parameter *par)
Create parameter list for the Strehl computation.
hdrl_parameter * hdrl_strehl_parameter_create(double wavelength, double m1_radius, double m2_radius, double pixel_scale_x, double pixel_scale_y, double flux_radius, double bkg_radius_low, double bkg_radius_high)
Creates Strehl Parameters object.
cpl_parameterlist * hdrl_rect_region_parameter_create_parlist(const char *base_context, const char *prefix, const char *name_prefix, const hdrl_parameter *defaults)
Create parameter list for hdrl_rect_region.
hdrl_parameter * hdrl_rect_region_parameter_create(cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury)
Creates Rect Region Parameters object.