43#if defined(__linux__) && defined(__GLIBC__)
69static int gravity_p2vm(cpl_frameset *,
const cpl_parameterlist *);
75static char gravity_p2vm_short[] =
"Calibrate the instrument bad pixels, wavelength table, interferometric contrast and phase.";
77"This recipe reduces the internal calibrations. As a special sequence of shutter opening is required, it is advised to always build the SOF with a complete sequence of files obtained within a single execution of the p2vm calibration template. However it is still possible to input a SOF with DARK_RAW only, or DARK_RAW and FLAT_RAW only. It is also possible to input a SOF with some already processed calibration (e.g WAVE).\n"
79 "* Compute the dark, write product\n"
80 "* Compute the flat, write product\n"
81 "* Compute the badpixels, write product\n"
82 "* Compute the spectral calibration, write product\n"
83 "* Compute the p2vm, write product\n"
86 GRAVI_FLAT_RAW" x4 : raw flats, one shutter open (DPR.TYPE=FLAT)\n"
87 GRAVI_P2VM_RAW" x6 : raw p2vms, two shutters open (DPR.TYPE=P2VM)\n"
88 GRAVI_WAVE_RAW" : raw wavelength calibration for FT (DPR.TYPE=WAVE)\n"
115 cpl_recipe * recipe = cpl_calloc(1,
sizeof *recipe );
116 cpl_plugin * plugin = &recipe->interface;
118 if (cpl_plugin_init(plugin,
120 GRAVI_BINARY_VERSION,
121 CPL_PLUGIN_TYPE_RECIPE,
125 "Nabih Azouaoui, Vincent Lapeyrere, JB. Le Bouquin",
131 cpl_msg_error(cpl_func,
"Plugin initialization failed");
132 (void)cpl_error_set_where(cpl_func);
136 if (cpl_pluginlist_append(list, plugin)) {
137 cpl_msg_error(cpl_func,
"Error adding plugin to list");
138 (void)cpl_error_set_where(cpl_func);
160 if (cpl_error_get_code() != CPL_ERROR_NONE) {
161 cpl_msg_error(cpl_func,
"%s():%d: An error is already set: %s",
162 cpl_func, __LINE__, cpl_error_get_where());
163 return (
int)cpl_error_get_code();
166 if (plugin == NULL) {
167 cpl_msg_error(cpl_func,
"Null plugin");
168 cpl_ensure_code(0, (
int)CPL_ERROR_NULL_INPUT);
172 if (cpl_plugin_get_type(plugin) != CPL_PLUGIN_TYPE_RECIPE) {
173 cpl_msg_error(cpl_func,
"Plugin is not a recipe");
174 cpl_ensure_code(0, (
int)CPL_ERROR_TYPE_MISMATCH);
178 recipe = (cpl_recipe *)plugin;
181 recipe->parameters = cpl_parameterlist_new();
182 if (recipe->parameters == NULL) {
183 cpl_msg_error(cpl_func,
"Parameter list allocation failed");
184 cpl_ensure_code(0, (
int)CPL_ERROR_ILLEGAL_OUTPUT);
214 p = cpl_parameter_new_enum (
"gravity.calib.phase-calibration", CPL_TYPE_STRING,
215 "This option changes the phase reference of the P2VM:\n "
216 "NONE defines phiA(lbd) at zero for all baselines "
217 "(P2VM calibrates only the internal phase-shift of the beam combiner);\n "
218 "CLOSURE defines phiA(lbd) at zero for baselines 01, 02 and 03 "
219 "(P2VM calibrates the phase-shift and the closure-phase of the beam combiner);\n "
220 "DISP defines phiA(lbd) to have zero mean and minimum GD for baselines (01,02,03); "
221 "(P2VM calibrates the phase-shift, the closure-phase and the "
222 "spectral-dispersion of the beam combiner);\n "
223 "FULL defines phiA(lbd) to have zero-GD for baselines (01,02,03)",
224 "(P2VM calibrates the full phase with respect to zero-astrometry);\n "
225 "gravi.p2vm",
"FULL", 4,
"NONE",
"CLOSURE",
"DISP",
"FULL");
226 cpl_parameter_set_alias (p, CPL_PARAMETER_MODE_CLI,
"phase-calibration");
227 cpl_parameter_disable (p, CPL_PARAMETER_MODE_ENV);
228 cpl_parameterlist_append (recipe->parameters, p);
245 cpl_errorstate initial_errorstate = cpl_errorstate_get();
248 if (cpl_error_get_code() != CPL_ERROR_NONE) {
249 cpl_msg_error(cpl_func,
"%s():%d: An error is already set: %s",
250 cpl_func, __LINE__, cpl_error_get_where());
251 return (
int)cpl_error_get_code();
254 if (plugin == NULL) {
255 cpl_msg_error(cpl_func,
"Null plugin");
256 cpl_ensure_code(0, (
int)CPL_ERROR_NULL_INPUT);
260 if (cpl_plugin_get_type(plugin) != CPL_PLUGIN_TYPE_RECIPE) {
261 cpl_msg_error(cpl_func,
"Plugin is not a recipe");
262 cpl_ensure_code(0, (
int)CPL_ERROR_TYPE_MISMATCH);
266 recipe = (cpl_recipe *)plugin;
269 if (recipe->parameters == NULL) {
270 cpl_msg_error(cpl_func,
"Recipe invoked with NULL parameter list");
271 cpl_ensure_code(0, (
int)CPL_ERROR_NULL_INPUT);
273 if (recipe->frames == NULL) {
274 cpl_msg_error(cpl_func,
"Recipe invoked with NULL frame set");
275 cpl_ensure_code(0, (
int)CPL_ERROR_NULL_INPUT);
279 recipe_status =
gravity_p2vm(recipe->frames, recipe->parameters);
282 if (cpl_dfs_update_product_header(recipe->frames)) {
283 if (!recipe_status) recipe_status = (int)cpl_error_get_code();
286 if (!cpl_errorstate_is_equal(initial_errorstate)) {
289 cpl_errorstate_dump(initial_errorstate, CPL_FALSE, NULL);
292 return recipe_status;
306 if (plugin == NULL) {
307 cpl_msg_error(cpl_func,
"Null plugin");
308 cpl_ensure_code(0, (
int)CPL_ERROR_NULL_INPUT);
312 if (cpl_plugin_get_type(plugin) != CPL_PLUGIN_TYPE_RECIPE) {
313 cpl_msg_error(cpl_func,
"Plugin is not a recipe");
314 cpl_ensure_code(0, (
int)CPL_ERROR_TYPE_MISMATCH);
318 recipe = (cpl_recipe *)plugin;
320 cpl_parameterlist_delete(recipe->parameters);
335 const cpl_parameterlist * parlist)
337 cpl_frameset * p2vm_frameset=NULL, * wavecalib_frameset=NULL, * darkcalib_frameset=NULL,
338 * flatcalib_frameset=NULL, * dark_frameset=NULL, * wave_frameset=NULL, * wavesc_frameset=NULL,
339 * badcalib_frameset=NULL, * flat_frameset=NULL, * used_frameset=NULL, * current_frameset=NULL,
340 * wave_param_frameset=NULL;
342 cpl_frame * frame=NULL, * frame_p2vm=NULL;
344 gravi_data * p2vm_map=NULL, * data=NULL, * dark_map=NULL, * wave_map=NULL,
345 * profile_map=NULL, * badpix_map=NULL, * wave_param=NULL;
351 int nb_frame, nb_frame_gain = 0;
353 cpl_propertylist * met_plist=NULL;
354 int ** valid_trans = cpl_malloc (2 *
sizeof (
int*));
355 int ** valid_CP = cpl_malloc (2 *
sizeof (
int*));
356 char ext_regexp[500];
359 for (
int i = 0 ; i < 2; i++){
360 valid_trans[i] = cpl_calloc (4,
sizeof (
int));
361 valid_CP[i] = cpl_calloc (6,
sizeof (
int));
373 used_frameset = cpl_frameset_new ();
378 if ( cpl_frameset_get_size (dark_frameset) +
379 cpl_frameset_get_size (darkcalib_frameset) !=1) {
380 cpl_error_set_message (cpl_func, CPL_ERROR_ILLEGAL_INPUT,
381 "Either a single DARK or DARK_RAW needs to be in the frameset");
387 if ( cpl_frameset_is_empty (badcalib_frameset) && cpl_frameset_is_empty (dark_frameset) &&
388 cpl_frameset_is_empty (darkcalib_frameset) ) {
389 cpl_error_set_message (cpl_func, CPL_ERROR_ILLEGAL_INPUT,
"Missing DARK or BAD on the frameset");
396 if ( cpl_frameset_is_empty (flat_frameset) &&
397 cpl_frameset_is_empty (flatcalib_frameset) ) {
398 cpl_error_set_message (cpl_func, CPL_ERROR_ILLEGAL_INPUT,
"Missing FLAT on the frameset");
406 if ( cpl_frameset_is_empty (wave_frameset) &&
407 cpl_frameset_is_empty (wavecalib_frameset) ) {
408 cpl_error_set_message (cpl_func, CPL_ERROR_ILLEGAL_INPUT,
"Missing WAVE on the frameset");
414 if ( cpl_frameset_get_size (p2vm_frameset) !=6) {
415 cpl_error_set_message (cpl_func, CPL_ERROR_ILLEGAL_INPUT,
"Illegal number of P2VM on the frameset");
421 if ( cpl_frameset_is_empty (wave_param_frameset) ) {
422 cpl_error_set_message (cpl_func, CPL_ERROR_ILLEGAL_INPUT,
"Missing WAVE_PARAM static calibration file");
430 if (!cpl_frameset_is_empty (dark_frameset)) {
431 cpl_msg_info (cpl_func,
" ***** Compute DARK map ***** ");
434 frame = cpl_frameset_get_position (dark_frameset, 0);
446 NULL, frame,
"gravity_p2vm",
451 else if (!cpl_frameset_is_empty (darkcalib_frameset)) {
455 frame = cpl_frameset_get_position (darkcalib_frameset, 0);
461 cpl_frameset_insert (dark_frameset, cpl_frame_duplicate (frame));
469 if (!cpl_frameset_is_empty (badcalib_frameset)) {
470 cpl_msg_info (cpl_func,
" ***** Get BAD pixel map ***** ");
473 frame = cpl_frameset_get_position (badcalib_frameset, 0);
476 else if (!cpl_frameset_is_empty (dark_frameset) &&
477 !cpl_frameset_is_empty (flat_frameset)) {
478 cpl_msg_info (cpl_func,
" ***** Compute BAD pixel map from DARK and FLAT_RAW ***** ");
481 nb_frame_gain = cpl_frameset_get_size (flat_frameset);
482 raw_data = cpl_calloc (nb_frame_gain,
sizeof(
gravi_data *));
485 for (
int i = 0; i < nb_frame_gain; i++) {
486 frame = cpl_frameset_get_position (flat_frameset, i);
493 nb_frame_gain, parlist);
495 CPLCHECK_CLEAN(
"Cannot compute the BAD pixel from DARK and FLAT");
498 frame = cpl_frameset_get_position (dark_frameset, 0);
500 NULL, frame,
"gravity_p2vm",
512 if (!cpl_frameset_is_empty(flatcalib_frameset)) {
516 frame = cpl_frameset_get_position (flatcalib_frameset, 0);
519 else if (!cpl_frameset_is_empty (flat_frameset)) {
520 cpl_msg_info (cpl_func,
" ***** Compute FLAT map ***** ");
524 if (!badpix_map || !dark_map) {
525 ERROR_CLEAN (CPL_ERROR_ILLEGAL_INPUT,
"Missing DARK or BAD in frameset");
529 nb_frame_gain = cpl_frameset_get_size (flat_frameset);
530 raw_data = cpl_malloc (nb_frame_gain *
sizeof(
gravi_data *));
533 for (
int i = 0; i < nb_frame_gain; i++) {
534 frame = cpl_frameset_get_position (flat_frameset, i);
545 cpl_propertylist * gain_header;
551 cpl_propertylist_append (profile_header, gain_header);
552 FREE (cpl_propertylist_delete, gain_header);
555 frame = cpl_frameset_get_position (flat_frameset, 0);
558 used_frameset, frame,
"gravity_p2vm",
571 if (!cpl_frameset_is_empty (wave_param_frameset)) {
572 frame = cpl_frameset_get_position (wave_param_frameset, 0);
576 cpl_msg_error (cpl_func,
"There is no WAVE_PARAM in the frameset (did you forget the static calibration files?)");
578 if (!cpl_frameset_is_empty (wavecalib_frameset)) {
582 frame = cpl_frameset_get_position (wavecalib_frameset, 0);
585 else if (!cpl_frameset_is_empty (wave_frameset)) {
586 cpl_msg_info (cpl_func,
" ***** Process the WAVE_RAW ***** ");
589 if ( !badpix_map || !profile_map || !dark_map) {
590 ERROR_CLEAN (CPL_ERROR_ILLEGAL_INPUT,
"Missing DARK, FLAT, or BAD in frameset");
597 frame = cpl_frameset_get_position (wave_frameset, 0);
605 cpl_msg_info (cpl_func,
"Extract SC SPECTRUM for WAVE_RAW");
615 cpl_msg_info (cpl_func,
"Extract FT SPECTRUM for WAVE_RAW");
632 cpl_msg_info (cpl_func,
"Compute the P2VM_MET from WAVE_RAW");
654 used_frameset, frame,
"gravity_p2vm",
664 if (!cpl_frameset_is_empty (wavesc_frameset)) {
669 cpl_msg_info (cpl_func,
" ***** Process the WAVESC_RAW ***** ");
672 frame = cpl_frameset_get_position (wavesc_frameset, 0);
679 cpl_msg_info (cpl_func,
"Extract SC SPECTRUM for WAVESC_RAW");
689 cpl_msg_info (cpl_func,
"Extract FT SPECTRUM for WAVESC_RAW");
717 parlist, used_frameset, frame,
"gravity_p2vm",
722 cpl_msg_warning (cpl_func,
"No WAVESC_RAW in the SOF:"
723 " SC wavelength will be inaccurate");
739 used_frameset, frame,
"gravity_p2vm",
750 if ( cpl_frameset_is_empty (p2vm_frameset) ) {
751 cpl_msg_info (cpl_func,
"All RAW data reduced... stop recipe");
756 if ( !badpix_map || !profile_map || !wave_map || !dark_map) {
757 ERROR_CLEAN (CPL_ERROR_ILLEGAL_INPUT,
"Missing DARK, FLAT, BAD, or WAVE in frameset");
761 if ( !cpl_frameset_is_empty (flat_frameset) )
762 cpl_frameset_join (p2vm_frameset, flat_frameset);
764 if ( !cpl_frameset_is_empty (wave_frameset) )
765 cpl_frameset_join (p2vm_frameset, wave_frameset);
768 nb_frame = cpl_frameset_get_size (p2vm_frameset);
771 if (nb_frame != 11) {
772 ERROR_CLEAN (CPL_ERROR_ILLEGAL_INPUT,
"Missing P2VM in frameset");
782 cpl_msg_info (cpl_func,
" ***** Create the P2VM ***** ");
787 for (
int i = 0; i < nb_frame; i++) {
789 cpl_msg_info (cpl_func,
" ***** file %d over %d ***** ", i+1, nb_frame );
790 current_frameset = cpl_frameset_duplicate (used_frameset);
793 frame = cpl_frameset_get_position (p2vm_frameset, i);
794 cpl_frameset_insert (used_frameset, cpl_frame_duplicate (frame));
809 cpl_msg_info (cpl_func,
"Use this frame for the P2VM product");
819 cpl_msg_info (cpl_func,
"Nothing to be done with the file... yet.");
822 FREE (cpl_frameset_delete, current_frameset);
874 current_frameset, frame,
"gravity_p2vm",
881 cpl_msg_info(cpl_func,
"Execution time to delete preproc_data : %f s",
882 (clock() - start) / (
double)CLOCKS_PER_SEC);
885 FREE (cpl_frameset_delete, current_frameset);
902 cpl_msg_info (cpl_func,
" ***** Analyse the WAVE file to calibrate the internal closure and transmission ***** ");
905 if (!cpl_frameset_is_empty (wavesc_frameset)) {
907 frame = cpl_frameset_get_position (wave_frameset, 0);
909 frame = cpl_frameset_get_position (wave_frameset, 0);
959 p2vm_map,
"gravi_single", parlist);
981 cpl_msg_info (cpl_func,
"P2VM phases are kept to zero (option phase-calibration=NONE)");
994 cpl_msg_info(cpl_func,
"storing bad pixel mask for TAC");
1005 used_frameset, frame_p2vm,
"gravity_p2vm",
1017 FREE (cpl_frameset_delete, dark_frameset);
1018 FREE (cpl_frameset_delete, darkcalib_frameset);
1019 FREE (cpl_frameset_delete, badcalib_frameset);
1025 FREE (cpl_propertylist_delete, met_plist);
1026 FREE (cpl_frameset_delete, wavecalib_frameset);
1027 FREE (cpl_frameset_delete, flatcalib_frameset);
1028 FREE (cpl_frameset_delete, flat_frameset);
1029 FREE (cpl_frameset_delete, wave_frameset);
1030 FREE (cpl_frameset_delete, wavesc_frameset);
1031 FREE (cpl_frameset_delete, used_frameset);
1038 FREELOOP (cpl_free, valid_trans, 2);
1040 FREE (cpl_frameset_delete, p2vm_frameset);
1041 FREE (cpl_frameset_delete, current_frameset);
1042 FREE (cpl_frameset_delete, wave_param_frameset);
1053#if defined(__linux__) && defined(__GLIBC__)
1058 return (
int)cpl_error_get_code();
typedefCPL_BEGIN_DECLS struct _gravi_data_ gravi_data
#define gravi_data_get_header(data)
#define GRAVI_RECIPE_OUTPUT
#define GRAVI_RECIPE_FLOW
#define GRAVI_RECIPE_INPUT
cpl_msg_info(cpl_func, "Compute WAVE_SCAN for %s", GRAVI_TYPE(type_data))
#define GRAVI_IMAGING_DETECTOR_FT_EXT
#define GRAVI_IMAGING_DATA_FT_EXT
#define GRAVI_OI_FLUX_EXT
#define GRAVI_IMAGING_DATA_SC_EXT
#define GRAVI_SPECTRUM_DATA_FT_EXT
#define GRAVI_P2VM_MET_EXT
#define GRAVI_ARRAY_GEOMETRY_EXT
#define GRAVI_IMAGING_DETECTOR_SC_EXT
#define GRAVI_METROLOGY_EXT
#define GRAVI_OI_WAVELENGTH_EXT
#define GRAVI_OPTICAL_TRAIN_EXT
#define gravi_data_check_shutter(data, t0, t1, t2, t3)
#define CPLCHECK_CLEAN(msg)
#define gravi_msg_function_exit(flag)
#define FREE(function, variable)
#define ERROR_CLEAN(code, msg)
#define gravi_msg_function_start(flag)
#define gravi_data_get_shutter(data, tel)
#define FREELOOP(function, variable, n)
static char gravity_p2vm_short[]
static char gravity_p2vm_description[]
int cpl_plugin_get_info(cpl_pluginlist *list)
Build the list of available plugins, for this module.
static int gravity_p2vm_destroy(cpl_plugin *)
Destroy what has been created by the 'create' function.
static int gravity_p2vm_exec(cpl_plugin *)
Execute the plugin instance given by the interface.
static int gravity_p2vm(cpl_frameset *, const cpl_parameterlist *)
Compute the DARK, BAD, FLAT, WAVE, P2VM from a list of calibration set.
static int gravity_p2vm_create(cpl_plugin *)
Setup the recipe options
cpl_propertylist * gravi_compute_gain(gravi_data **flats_data, int nrawgain, gravi_data *dark_map)
Compute mean detector gain.
gravi_data * gravi_compute_profile(gravi_data **flats_data, gravi_data *dark_map, gravi_data *bad_map, int nflat, const cpl_parameterlist *params)
Computes the spatial profile of each spectrum for optimal extraction purpose.
gravi_data * gravi_compute_dark(gravi_data *raw_data)
Compute the DARK calibration map.
gravi_data * gravi_compute_badpix(gravi_data *dark_map, gravi_data **flats_data, int nflat, const cpl_parameterlist *params)
Identify the bad pixels in the DARK map and create the BAD map.
gravi_data * gravi_data_new(int nb_ext)
Create an empty gravi_data.
cpl_error_code gravi_data_add_table(gravi_data *self, cpl_propertylist *plist, const char *extname, cpl_table *table)
Add a BINTABLE extension in gravi_data.
gravi_data * gravi_data_load_frame(cpl_frame *frame, cpl_frameset *used_frameset)
Load a FITS file and create a gravi_data.
cpl_error_code gravi_data_detector_cleanup(gravi_data *data, const cpl_parameterlist *parlist)
Perform self-bias correction to the SC raw data.
cpl_table * gravi_data_get_table(gravi_data *self, const char *extname)
Return a pointer on a table extension by its EXTNAME.
gravi_data * gravi_data_load_rawframe(cpl_frame *frame, cpl_frameset *used_frameset)
Load a RAW FITS file and create a gravi_data.
cpl_error_code gravi_data_move_ext(gravi_data *output, gravi_data *input, const char *name)
Move extensions from one data to another.
cpl_error_code gravi_data_save_new(gravi_data *self, cpl_frameset *allframes, const char *filename, const char *suffix, const cpl_parameterlist *parlist, cpl_frameset *usedframes, cpl_frame *frame, const char *recipe, cpl_propertylist *applist, const char *proCatg)
Save a gravi data in a CPL-complian FITS file.
cpl_error_code gravi_data_copy_ext(gravi_data *output, gravi_data *input, const char *name)
Copy extensions from one data to another.
gravi_data * gravi_data_load_rawframe_ext(cpl_frame *frame, cpl_frameset *used_frameset, const char *extensions_regexp)
Load a RAW FITS file and create a gravi_data from specified extensions.
void gravi_data_delete(gravi_data *self)
Delete a gravi data.
cpl_parameter * gravi_parameter_add_debug_file(cpl_parameterlist *self)
cpl_frameset * gravi_frameset_extract_wavesc_data(cpl_frameset *frameset)
cpl_parameter * gravi_parameter_add_profile(cpl_parameterlist *self)
Add profile parameters to the input parameter list.
int gravi_param_get_bool(const cpl_parameterlist *parlist, const char *name)
cpl_parameter * gravi_parameter_add_static_name(cpl_parameterlist *self)
cpl_parameter * gravi_parameter_add_metrology(cpl_parameterlist *self)
cpl_parameter * gravi_parameter_add_extract(cpl_parameterlist *self)
cpl_parameter * gravi_parameter_add_biasmethod(cpl_parameterlist *self)
cpl_frameset * gravi_frameset_extract_wave_map(cpl_frameset *frameset)
const char * gravi_param_get_string(const cpl_parameterlist *parlist, const char *name)
cpl_parameter * gravi_parameter_add_wave(cpl_parameterlist *self)
Add wavelength calibration parameters to the input parameter list.
cpl_frameset * gravi_frameset_extract_bad_map(cpl_frameset *frameset)
cpl_frameset * gravi_frameset_extract_flat_data(cpl_frameset *frameset)
cpl_frameset * gravi_frameset_extract_wave_data(cpl_frameset *frameset)
cpl_frameset * gravi_frameset_extract_dark_map(cpl_frameset *frameset)
cpl_frameset * gravi_frameset_extract_p2vm_data(cpl_frameset *frameset)
Extract P2VM_RAW frame from the input frameset.
cpl_error_code gravi_dfs_set_groups(cpl_frameset *set)
Set the group as RAW or CALIB in a frameset.
cpl_parameter * gravi_parameter_add_preproc_file(cpl_parameterlist *self)
cpl_parameter * gravi_parameter_add_badpix(cpl_parameterlist *self)
Add badpix parameters to the input parameter list.
cpl_frameset * gravi_frameset_extract_wave_param(cpl_frameset *frameset)
cpl_frameset * gravi_frameset_extract_flat_map(cpl_frameset *frameset)
void gravity_print_banner(void)
cpl_frameset * gravi_frameset_extract_dark_data(cpl_frameset *frameset)
Extract DARK_RAW frame from the input frameset.
cpl_table * gravi_metrology_compute_p2vm(cpl_table *metrology_table, double wave_met)
Calibrate the P2VM of the metrology.
cpl_error_code gravi_p2vm_phase_correction(gravi_data *p2vm_map, gravi_data *p2vmred_data, int full_phase)
Correct the phase of the P2VM from internal closure-phases.
cpl_error_code gravi_p2vm_normalisation(gravi_data *p2vm_map, int **valid_trans, int **valid_pair)
The given output FITS file contain a p2vm table with the values of the transmission,...
cpl_error_code gravi_compute_p2vm(gravi_data *p2vm_map, gravi_data *preproc_data, int **valid_trans, int **valid_pair, enum gravi_detector_type det_type)
The given output FITS file contain a p2vm table with the values of the transmission,...
cpl_error_code gravi_p2vm_transmission(gravi_data *p2vm_map, gravi_data *p2vmred_data)
Compute the flux normalisation in the P2VM.
gravi_data * gravi_create_p2vm(gravi_data *wave_map, gravi_data *wave_param)
Create a new P2VM map.
gravi_data * gravi_compute_p2vmred(gravi_data *preproc_data, gravi_data *p2vm_map, const char *mode, const cpl_parameterlist *parlist)
Converts preprocessed data into coherent fluxes using the P2VM.
double gravi_pfits_get_met_wavelength_mean(const cpl_propertylist *plist, cpl_table *met_table)
cpl_error_code gravi_align_spectrum(gravi_data *spectrum_data, gravi_data *wave_map, gravi_data *p2vm_map, enum gravi_detector_type det_type)
Regrid the regions into a common wavelength (in-place)
gravi_data * gravi_extract_spectrum(gravi_data *raw_data, gravi_data *profile_map, gravi_data *dark_map, gravi_data *bad_map, gravi_data *sky_map, const cpl_parameterlist *parlist, enum gravi_detector_type det_type)
Create the SPECTRUM gravi_data with extracted spectrum per region.
const char * gravi_get_license(void)
Get the pipeline copyright and license.
cpl_error_code gravi_wave_compute_opds(gravi_data *spectrum_data, cpl_table *met_table, const cpl_parameterlist *parlist)
Recover the OPD modulation from a spectrum_data and vismet_table.
cpl_error_code gravi_compute_wave(gravi_data *wave_map, gravi_data *spectrum_data, int type_data, const cpl_parameterlist *parlist, gravi_data *wave_param)
Create the WAVE calibration map.
cpl_error_code gravi_wave_qc(gravi_data *wave_map, gravi_data *profile_map)
Compute the QC parameters of the WAVE product.