46#include "eris_nix_dfs.h"
51#include "eris_nix_scired.h"
60static const char eris_nix_pupil_description[] =
61"This recipe performs QC on "
62ERIS_NIX_RAW_PUPIL_LAMP_OPEN_DO_CATG
",\n"
63ERIS_NIX_RAW_PUPIL_LAMP_MASK_DO_CATG
" and "
64ERIS_NIX_RAW_PUPIL_SKY_OPEN_DO_CATG
" and "
65ERIS_NIX_RAW_PUPIL_SKY_MASK_DO_CATG
" and "
66ERIS_NIX_RAW_PUPIL_BKG_OPEN_DO_CATG
" and "
67ERIS_NIX_RAW_PUPIL_BKG_MASK_DO_CATG
" and "
68ERIS_NIX_RAW_PUPIL_DARK_OPEN_DO_CATG
" and"
69ERIS_NIX_RAW_PUPIL_DARK_MASK_DO_CATG
" frames. "
70"This comprises dark subtraction,\n"
71"linearization, flat-fielding, association with the master \n"
72"bad-pixel mask, and correction of image rotation.\n"
76" DO CATG Explanation Req. #Frames\n"
77" ------- ----------- --- -------\n"
78" "ERIS_NIX_RAW_PUPIL_LAMP_DO_CATG
79 " pupil lamp frames N 0-n\n"
80" "ERIS_NIX_RAW_PUPIL_SKY_DO_CATG
81 " pupil sky frames N 0-n\n"
82" "ERIS_NIX_RAW_PUPIL_BKG_DO_CATG
83 " pupil bkg frames N 0-n\n"
84" "ERIS_NIX_RAW_PUPIL_DARK_DO_CATG
85 " pupil dark frames N 0-n\n"
87" "ERIS_NIX_MASTER_DARK_IMG_PRO_CATG
88 " a MASTER_DARK with Y 1\n"
89" matching detector \n"
91" "ERIS_NIX_MASTER_BPM_LAMP_PRO_CATG
92 " a lamp MASTER_BPM Y 1\n"
94" "ERIS_NIX_MASTER_BPM_SKY_PRO_CATG
95 " a sky MASTER_BPM Y 1\n"
96" "ERIS_NIX_MASTER_FLAT_LAMP_HIFREQ_PRO_CATG
97 " a lamp hifreq flat N 0 or 1\n"
98" matching observing \n"
100" "ERIS_NIX_MASTER_FLAT_SKY_HIFREQ_PRO_CATG
101 " a sky hifreq flat N 0 or 1\n"
102" matching observing \n"
104" "ERIS_NIX_MASTER_FLAT_LAMP_LOFREQ_PRO_CATG
105 " a lamp hifreq flat N 0 or 1\n"
106" matching observing \n"
108" "ERIS_NIX_MASTER_FLAT_SKY_LOFREQ_PRO_CATG
109 " a sky hifreq flat N 0 or 1\n"
110" matching observing \n"
112" "ERIS_NIX_MASTER_FLAT_TWILIGHT_LOFREQ_PRO_CATG
"\n"
113" a twilight lofreq flat N 0 or 1\n"
114" matching observing \n"
115" configuration (preferred\n"
116" over the LAMP version\n"
118" "ERIS_NIX_GAIN_PRO_CATG
119 " DETMON gain information N 0 or 1\n"
121" detmon_ir_lg_gain_table.fits\n"
122" "ERIS_NIX_COEFFS_CUBE_PRO_CATG
123 " DETMON linearity curves N 0 or 1\n"
125" detmon_ir_coeffs_cube.fits\n"
126" "ERIS_NIX_NL_BPM_PRO_CATG
127 " DETMON non-linear bpm N 0 or 1\n"
129" detmon_ir_lg_bpm.fits\n"
130" "ERIS_NIX_WCS_REFINE_PRO_CATG
131 " NIX wcs refinement file N 0 or 1\n"
132" with updated CD-matrix\n"
133" to correct image \n"
138" DO CATG Explanation \n"
139" ------- ----------- \n"
140" PREF_OPEN, PREF_JHK, PREF_CROSS, PREF_SAM (PREF=PUPIL_LAMP, PUPIL_SKY_PUPIL_DARK or PUPIL_BKG)"
141 " Calibrated results (detector signature removed).\n"
143" The output will be a FITS file named 'cal_det_<inputname>.fits',\n"
145" - DATA the result data.\n"
146" - ERR the result error plane.\n"
147" - DQ the result data quality plane.\n"
148" - CONFIDENCE the result confidence plane.\n"
151#define RECIPE_NAME "eris_nix_pupil"
152#define CONTEXT "eris."RECIPE_NAME
157cpl_recipe_define(eris_nix_pupil, ERIS_BINARY_VERSION,
158 "Andrea Modigliani, John Lightfoot",
159 PACKAGE_BUGREPORT,
"2017",
160 "Remove detector signature from PUPIL frames",
161 eris_nix_pupil_description);
177static cpl_error_code eris_nix_pupil_fill_parameterlist(
178 cpl_parameterlist * self) {
180 if (cpl_error_get_code() != CPL_ERROR_NONE)
return cpl_error_get_code();
184 p = cpl_parameter_new_enum(CONTEXT
".fill-rejected",
186 "how to treat reject pixel",
192 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"fill-rejected");
193 cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
194 cpl_parameterlist_append(self, p);
196 p = cpl_parameter_new_value(CONTEXT
".fill-value",
198 "value to use in 'set_value' case",
200 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"fill-value");
201 cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
202 cpl_parameterlist_append(self, p);
206 p = cpl_parameter_new_value(CONTEXT
".cd_matrix_modify",
208 "TRUE to insert corrected CD-matrix",
210 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"cd-matrix-modify");
211 cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
212 cpl_parameterlist_append(self, p);
215 eris_nix_pixel_coord_diagnostic_param_set(CONTEXT, self);
217 p = cpl_parameter_new_range(CONTEXT
".collapse_cube", CPL_TYPE_INT,
218 "May collapse cube if DET.FRAM.FORMAT is cube. Possible values: "
219 "0, no collapse; 1, mean collapse; 2, median collapse;"
222 cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI,
"collapse-cube");
223 cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV);
224 cpl_parameterlist_append(self, p);
239static int eris_nix_pupil(cpl_frameset * frameset,
240 const cpl_parameterlist * parlist) {
244 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.