46#include "eris_nix_dfs.h"
51#include "eris_nix_scired.h"
60static const char eris_nix_cal_det_description[] =
61"This recipe removes the detector signature from "
62ERIS_NIX_RAW_OBJECT_JITTER_DO_CATG
",\n"
63ERIS_NIX_RAW_SKY_JITTER_DO_CATG
" and "
64ERIS_NIX_RAW_STD_JITTER_DO_CATG
" frames. "
65"This comprises dark subtraction,\n"
66"linearization, flat-fielding, association with the master \n"
67"bad-pixel mask, and correction of image rotation.\n"
71" DO CATG Explanation Req. #Frames\n"
72" ------- ----------- --- -------\n"
73" "ERIS_NIX_RAW_OBJECT_JITTER_DO_CATG
74 " object jitter frames N 0-n\n"
75" "ERIS_NIX_RAW_SKY_JITTER_DO_CATG
76 " offset sky jitter N 0-n\n"
78" "ERIS_NIX_RAW_STD_JITTER_DO_CATG
79 " standard jitter N 0-n\n"
81" "ERIS_NIX_RAW_OBJECT_LSS_JITTER_DO_CATG
82 " object LSS jitter N 0-n\n"
84" "ERIS_NIX_RAW_SKY_LSS_JITTER_DO_CATG
85 " sky LSS jitter N 0-n\n"
87" "ERIS_NIX_RAW_STD_LSS_JITTER_DO_CATG
88 " standard LSS jitter N 0-n\n"
90" "ERIS_NIX_MASTER_DARK_IMG_PRO_CATG
91 " a MASTER_DARK with Y 1\n"
92" matching detector \n"
94" "ERIS_NIX_MASTER_BPM_LAMP_PRO_CATG
95 " a lamp MASTER_BPM Y 1\n"
97" "ERIS_NIX_MASTER_BPM_SKY_PRO_CATG
98 " a sky MASTER_BPM Y 1\n"
99" "ERIS_NIX_MASTER_FLAT_LAMP_HIFREQ_PRO_CATG
100 " a lamp hifreq flat N 0 or 1\n"
101" matching observing \n"
103" "ERIS_NIX_MASTER_FLAT_SKY_HIFREQ_PRO_CATG
104 " a sky hifreq flat N 0 or 1\n"
105" matching observing \n"
107" "ERIS_NIX_MASTER_FLAT_LAMP_LOFREQ_PRO_CATG
108 " a lamp hifreq flat N 0 or 1\n"
109" matching observing \n"
111" "ERIS_NIX_MASTER_FLAT_SKY_LOFREQ_PRO_CATG
112 " a sky hifreq flat N 0 or 1\n"
113" matching observing \n"
115" "ERIS_NIX_MASTER_FLAT_TWILIGHT_LOFREQ_PRO_CATG
"\n"
116" a twilight lofreq flat N 0 or 1\n"
117" matching observing \n"
118" configuration (preferred\n"
119" over the LAMP version\n"
121" "ERIS_NIX_GAIN_PRO_CATG
122 " DETMON gain information N 0 or 1\n"
124" detmon_ir_lg_gain_table.fits\n"
125" "ERIS_NIX_COEFFS_CUBE_PRO_CATG
126 " DETMON linearity curves N 0 or 1\n"
128" detmon_ir_coeffs_cube.fits\n"
129" "ERIS_NIX_NL_BPM_PRO_CATG
130 " DETMON non-linear bpm N 0 or 1\n"
132" detmon_ir_lg_bpm.fits\n"
133" "ERIS_NIX_WCS_REFINE_PRO_CATG
134 " NIX wcs refinement file N 0 or 1\n"
135" with updated CD-matrix\n"
136" to correct image \n"
141" DO CATG Explanation \n"
142" ------- ----------- \n"
143" "ERIS_NIX_CAL_DET_OBJECT_JITTER_PRO_CATG
144 " Calibrated results.\n"
145" or "ERIS_NIX_CAL_DET_SKY_JITTER_PRO_CATG
"\n"
146" or "ERIS_NIX_CAL_DET_STD_JITTER_PRO_CATG
"\n"
147" or "ERIS_NIX_CAL_DET_OBJECT_LSS_JITTER_PRO_CATG
"\n"
148" or "ERIS_NIX_CAL_DET_SKY_LSS_JITTER_PRO_CATG
"\n"
149" or "ERIS_NIX_CAL_DET_STD_LSS_JITTER_PRO_CATG
"\n"
151" The output will be a FITS file named 'cal_det_<inputname>.fits',\n"
153" - DATA the result data.\n"
154" - ERR the result error plane.\n"
155" - DQ the result data quality plane.\n"
156" - CONFIDENCE the result confidence plane.\n"
159#define RECIPE_NAME "eris_nix_cal_det"
160#define CONTEXT "eris."RECIPE_NAME
165cpl_recipe_define(eris_nix_cal_det, ERIS_BINARY_VERSION,
167 PACKAGE_BUGREPORT,
"2017",
168 "Remove detector signature from frames",
169 eris_nix_cal_det_description);
185static cpl_error_code eris_nix_cal_det_fill_parameterlist(
186 cpl_parameterlist * self) {
188 if (cpl_error_get_code() != CPL_ERROR_NONE)
return cpl_error_get_code();
192 p = cpl_parameter_new_enum(CONTEXT
".fill-rejected",
194 "how to treat reject pixel",
200 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"fill-rejected");
201 cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
202 cpl_parameterlist_append(self, p);
204 p = cpl_parameter_new_value(CONTEXT
".fill-value",
206 "value to use in 'set_value' case",
208 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"fill-value");
209 cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
210 cpl_parameterlist_append(self, p);
214 p = cpl_parameter_new_value(CONTEXT
".cd_matrix_modify",
216 "TRUE to insert corrected CD-matrix",
218 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"cd-matrix-modify");
219 cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
220 cpl_parameterlist_append(self, p);
223 eris_nix_pixel_coord_diagnostic_param_set(CONTEXT, self);
225 p = cpl_parameter_new_range(CONTEXT
".collapse_cube", CPL_TYPE_INT,
226 "May collapse cube if DET.FRAM.FORMAT is cube. Possible values: "
227 "0, no collapse; 1, mean collapse; 2, median collapse;"
230 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"collapse-cube");
231 cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
232 cpl_parameterlist_append(self, p);
247static int eris_nix_cal_det(cpl_frameset * frameset,
248 const cpl_parameterlist * parlist) {
252 return (
int) cpl_error_get_code();
cpl_error_code eris_nix_scired_cal_det(cpl_frameset *frameset, const cpl_parameterlist *parlist, const char *recipe_name, const char *context)
This function removes the detector signature from science frames.