GRAVI Pipeline Reference Manual 1.7.2
Loading...
Searching...
No Matches
Functions
Compute the visibilities

Functions

cpl_table * gravi_create_oitarget_table (const cpl_propertylist *header, const char *mode)
 Create the OI_TARGET table from the main header.
 
cpl_table * gravi_create_oiarray_table (const cpl_table *array_geometry, int is_cal)
 Create the OI_ARRAY table from the ARRAY_GEOMETRY.
 
gravi_datagravi_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.
 
cpl_error_code gravi_compute_opdc_state (gravi_data *p2vmred_data)
 Compute the real-time tracking state from OPDC.
 
cpl_error_code gravi_compute_tau0 (gravi_data *data)
 Compute the QC TAU0 parameter.
 
cpl_error_code gravi_compute_qc_injection (gravi_data *data)
 Compute the QC for the injection stability.
 
cpl_error_code gravi_compute_qc_ft_opd_estimator (gravi_data *p2vmred_data)
 Compute the QC for the FT linearity.
 

Detailed Description

This module implement the functions to compute the coherent flux of all the frames of the beam combiners (FT and SC). The main function is gravi_compute_p2vmred(). The algorithms involved in these fonction are description in the sections :

Function Documentation

◆ gravi_compute_opdc_state()

cpl_error_code gravi_compute_opdc_state ( gravi_data p2vmred_data)

Compute the real-time tracking state from OPDC.

Parameters
p2vmred_dataThe input/output gravi_data

Compute the FT tracking state per baseline (saved in the existing OI_VIS extension) and telescope (saved in the existing OI_FLUX table). It also computes the the target phase of the OPDC per baeline (saved in the existing OI_VIS table). Compute various QC parameters related to tracking quality.

Definition at line 941 of file gravi_p2vmred.c.

References cpl_msg_debug(), cpl_propertylist_update_double(), CPLCHECK_MSG, FREE, GRAVI_BASE_TEL, gravi_bit_get, gravi_data_get_header, gravi_data_get_oi_flux, gravi_data_get_oi_vis, gravi_data_get_table(), GRAVI_FT, gravi_msg_function_exit, gravi_msg_function_start, GRAVI_NBASE, GRAVI_OPDC_EXT, gravi_pfits_get_pola_num(), gravi_table_new_column(), GRAVI_TRI_BASE, header, and ntel.

Referenced by gravity_disp(), and gravity_vis().

◆ gravi_compute_p2vmred()

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.

Parameters
preproc_dataThe spectrum data input
p2vm_mapThe p2vm table with with the values of the transmission, phase and coherence
modegravi_single / gravi_dual
parlistThe parameter list containing the variables defining the size of the profile
det_typeThe detector to process. If GRAVI_DET_SC, then only the science detector extensions will be processed. GRAVI_DET_FT will do the same for FT detector and GRAVI_DET_ALL will do it for both.
Returns
The data containing the OI_FLUX and OI_VIS tables who compute the visibilies of each acquisition.
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing
CPL_ERROR_ILLEGAL_INPUTinput data are not compatible

It inverts the v2pm with a singular value decomposition, and compute the product spectrum_values*p2vm. The P2VM algorithm is applied for each SPECTRUM DIT and each wavelength. The coherence fluxes are saved in OI_VIS tables, and the photometric fluxes are saved in OI_FLUX tables. This function also computes the u,v vectors, TIME... This function also creates the OI_TARGET and OI_ARRAY tables.

IMPORTANT NOTE: To save memory space, the data in preproc_data are deleted by the routine, while looping on the rows.

Definition at line 330 of file gravi_p2vmred.c.

References COHERENCE, cpl_msg_debug(), cpl_msg_info(), cpl_propertylist_update_double(), CPLCHECK_NUL, FREE, FREELOOP, GRAVI_ARRAY_GEOMETRY_EXT, GRAVI_BASE_TEL, GRAVI_CLO_TEL, gravi_convert_to_mjd(), gravi_create_oiarray_table(), gravi_create_oitarget_table(), GRAVI_DATA, gravi_data_add_table(), gravi_data_copy_ext(), gravi_data_get_header, gravi_data_get_imaging_detector, gravi_data_get_p2vm_data, gravi_data_get_plist(), gravi_data_get_spectrum_data, gravi_data_get_table(), gravi_data_has_extension(), gravi_data_new(), GRAVI_DATAERR, GRAVI_EXTVER, GRAVI_FT, GRAVI_INSNAME, GRAVI_LABINPUT_1, GRAVI_LABINPUT_2, GRAVI_LABINPUT_3, GRAVI_LABINPUT_4, gravi_matrix_invertSV_create(), GRAVI_METROLOGY_EXT, gravi_msg_function_exit, gravi_msg_function_start, GRAVI_NBASE, GRAVI_OI_ARRAY_EXT, GRAVI_OI_FLUX_EXT, GRAVI_OI_T3_EXT, GRAVI_OI_TARGET_EXT, GRAVI_OI_VIS_EXT, GRAVI_OI_WAVELENGTH_EXT, GRAVI_OPTICAL_TRAIN_EXT, gravi_param_get_bool(), gravi_pfits_ensure_double(), gravi_pfits_get_dit, gravi_pfits_get_met_wavelength_mean(), gravi_pfits_get_start_prcacq(), gravi_pfits_is_calib(), gravi_pow2, gravi_region_get_pol(), GRAVI_SC, GRAVI_SPECTRUM_DATA_EXT, gravi_spectrum_get_nwave(), gravi_sta_index(), gravi_table_new_column_array(), gravi_table_oi_create(), GRAVI_TYPE, ntel, PHASE, and TRANSMISSION.

Referenced by gravity_disp(), gravity_p2vm(), and gravity_vis().

◆ gravi_compute_qc_ft_opd_estimator()

cpl_error_code gravi_compute_qc_ft_opd_estimator ( gravi_data p2vmred_data)

Compute the QC for the FT linearity.

Parameters
dataThe input data, shall contain an OI_VIS and OPDC table

For each baseline, the linearity is calculated between the OPD measured by the P2VM (from the pipeline), and the OPD measured by the FT (in the OPDC table). Biases as a function of OPD phase is measured and stored as QC parameters

Definition at line 1349 of file gravi_p2vmred.c.

References cpl_msg_info(), cpl_propertylist_update_double(), CPLCHECK_MSG, gravi_data_get_header, gravi_data_get_oi_vis, gravi_data_get_table(), GRAVI_FT, gravi_msg_function_exit, gravi_msg_function_start, GRAVI_NBASE, GRAVI_OPDC_EXT, gravi_pfits_get_pola_num(), and header.

Referenced by gravity_vis().

◆ gravi_compute_qc_injection()

cpl_error_code gravi_compute_qc_injection ( gravi_data data)

Compute the QC for the injection stability.

Parameters
dataThe input data, shall contain an OI_FLUX table

For each telescope, the injection stability is calculated as the ratio between the polarisation-averaged 9 percentile and 95 percentile of the inejcted flux for each telescope.

Definition at line 1245 of file gravi_p2vmred.c.

References cpl_msg_info(), cpl_propertylist_update_double(), gravi_data_get_header, gravi_data_get_oi_flux, GRAVI_FT, gravi_msg_function_exit, gravi_msg_function_start, gravi_pfits_get_pola_num(), header, and ntel.

Referenced by gravity_vis().

◆ gravi_compute_tau0()

cpl_error_code gravi_compute_tau0 ( gravi_data data)

Compute the QC TAU0 parameter.

Parameters
dataThe input gravi_data, shall contain an OPDC table

This function computes the QC TAU0 OPDC## parameters from the PIEZO signal stored in the OPDC table. The parameter are added to the main primary header of the data.

Definition at line 1165 of file gravi_p2vmred.c.

References cpl_msg_info(), cpl_propertylist_update_double(), CPLCHECK_MSG, FREE, GRAVI_BASE_TEL, gravi_data_get_header, gravi_data_get_table(), gravi_msg_function_exit, gravi_msg_function_start, GRAVI_NAN_DOUBLE, GRAVI_NBASE, GRAVI_OPDC_EXT, gravi_table_get_data_array_float(), and header.

Referenced by gravity_vis().

◆ gravi_create_oiarray_table()

cpl_table * gravi_create_oiarray_table ( const cpl_table *  array_geometry,
int  is_cal 
)

Create the OI_ARRAY table from the ARRAY_GEOMETRY.

Parameters
array_geometryThe input ARRAY_GEOMETRY table
is_cal0/1, to select the verbosity level

This function duplicate the ARRAY_GEOMETRY table into a OI_ARRAY table and makes several checks of OIFITS standart. It also ensures that the constructed OI_ARRAY has four rows, one per beam. Missing beam are built as T1, T2...

Definition at line 238 of file gravi_p2vmred.c.

References cpl_msg_info(), CPLCHECK_NUL, FREE, gravi_array_init_double(), gravi_msg_function_exit, gravi_msg_function_start, and gravi_table_set_string_fixlen().

Referenced by gravi_compute_p2vmred().

◆ gravi_create_oitarget_table()

cpl_table * gravi_create_oitarget_table ( const cpl_propertylist *  header,
const char *  mode 
)

Create the OI_TARGET table from the main header.

Parameters
headerMain header of an observation
Returns
The OI_TARGET table.

The SC refers to TARGET_ID 1 is mode 'single' and to TARGET_ID 2 in mode 'dual'. The FT refers to TARGET_ID 1 is all cases.

Definition at line 90 of file gravi_p2vmred.c.

References cpl_msg_info(), CPLCHECK_NUL, gravi_dump_the_boss(), gravi_msg_function_exit, gravi_msg_function_start, gravi_pfits_get_double_silentdefault(), gravi_pfits_get_plx(), gravi_pfits_get_pmdec(), gravi_pfits_get_pmra(), gravi_pfits_get_robj(), gravi_pfits_get_robj_decep(), gravi_pfits_get_robj_raep(), gravi_pfits_get_sobj(), gravi_pfits_get_sobj_decep, gravi_pfits_get_sobj_raep, gravi_table_set_string_fixlen(), and header.

Referenced by gravi_compute_p2vmred().