GRAVI Pipeline Reference Manual  1.2.3
Functions
P2VM calibration

Functions

cpl_table * gravi_create_p2vm_table (cpl_table *detector_table, int nwave)
 Create a new p2vm table. More...
 
cpl_table * gravi_create_oiwave_table_sc (cpl_table *wave_table, cpl_propertylist *header, gravi_data *wave_param)
 Create a new oiwave table for SC. More...
 
cpl_table * gravi_create_oiwave_table_ft (cpl_table *wave_table, cpl_table *detector_table, int pol)
 Create a new oiwave table for FT. More...
 
gravi_data * gravi_create_p2vm (gravi_data *wave_map, gravi_data *wave_param)
 Create a new P2VM map. More...
 
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, phase and coherence extract using the p2vm matrix. More...
 
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, phase and coherence extract using the p2vm matrix so this function will normalise the p2vm map. More...
 
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. More...
 
cpl_error_code gravi_p2vm_transmission (gravi_data *p2vm_map, gravi_data *p2vmred_data)
 Compute the flux normalisation in the P2VM. More...
 

Detailed Description

This modules implements the calibration of the P2VM. The main functions are called by the gravity_p2vm recipe. After allocating the P2VM table with gravi_create_p2vm() each file of the P2VM data set with one or two shutters opened (FLAT and P2VM) are processed with gravi_compute_p2vm() to fill the TRANSMISSION, COHERENCE and PHASE columns of the P2VM table. Then the TRANSMISSION are normalized with gravi_p2vm_normalisation() and the file with 4 shutters opened (WAVE) is processed to calibrated the closure with gravi_p2vm_phase_correction().

The algorithms involved in this reduction are detailed in section Algorithms/Computation of the P2VM.

Function Documentation

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, phase and coherence extract using the p2vm matrix.

Parameters
p2vm_mapThe p2vm table with the values of the transmission, phase and coherence. The table must be allocated before using this
preproc_dataThe the raw data after preprocessing and will be identified to compute the p2vm
valid_transInteger array of 2 dimensions the first dimension represents the type of the data (SC = 0 or FT = 1) , it means that it has 2 elements. the second represents the information about the files witch compute the transmission of witch telescope, it means that it has 4 elements. (if the file has a shutter 3 open of the data SC valid_trans[0][2] = 1)
valid_pairInteger array of 2 dimensions the first dimension represents the type of the data (SC = 0 or FT = 1), it means that it has 2 elements. the second represents the information about the files witch compute the phase and coherence of witch base, it means that it has 4 elements. (if the file has a shutter 3 and 4 open of the data SC valid_pair[0][5] = 1)
det_typeThe detector to align. 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.
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing
CPL_ERROR_ILLEGAL_INPUTA table is missing in the input data, or is does not correspond with a file with one or 2 shutters opened.

The function will compute the transmission, phase and coherence and save them in the p2vm_map giving in the inputs (shall be initialized).

Definition at line 547 of file gravi_p2vm.c.

References gravi_compute_envelope(), gravi_data_get_oiwave_tables(), gravi_ellipse_meanopd_create(), gravi_imagelist_unwrap_images(), gravi_imagelist_wrap_column(), gravi_matrix_invertSV_create(), gravi_region_get_pol(), and gravi_table_get_vector().

cpl_table * gravi_create_oiwave_table_ft ( cpl_table *  wave_table,
cpl_table *  detector_table,
int  pol 
)

Create a new oiwave table for FT.

Parameters
wave_tableThe input wavelength of each region in WAVE map
detector_tableThe corresponding detector table
polThe selected polarisation
Returns
The oiwave table

The function returns a table with EFF_WAVE, EFF_BAND.

Definition at line 346 of file gravi_p2vm.c.

References gravi_region_get_pol().

Referenced by gravi_create_p2vm().

cpl_table * gravi_create_oiwave_table_sc ( cpl_table *  wave_table,
cpl_propertylist *  header,
gravi_data *  wave_param 
)

Create a new oiwave table for SC.

Parameters
wave_tableThe input wavelength of each region in WAVE map
headerThe mean header of WAVE map
paramsThe recipe parameters
Returns
The oiwave table

The function returns a table with EFF_WAVE, EFF_BAND.

Definition at line 198 of file gravi_p2vm.c.

References gravi_data_get_plist(), gravi_data_get_table(), and gravi_wave_get_nlambda().

Referenced by gravi_create_p2vm().

gravi_data* gravi_create_p2vm ( gravi_data *  wave_map,
gravi_data *  wave_param 
)

Create a new P2VM map.

Parameters
preproc_dataone of the loaded data of this P2VM calibration
wave_mapthe WAVE calibration map of this P2VM
Returns
a p2vm_map

Create the P2VM map, including the P2VM_SC table, the P2VM_FT table and a copy of the P2VM_MET table from wave_map. It also creates the necessary OI_WAVELENGTHs table in the P2VM map.

Definition at line 414 of file gravi_p2vm.c.

References gravi_create_oiwave_table_ft(), gravi_create_oiwave_table_sc(), gravi_create_p2vm_table(), gravi_data_add_table(), gravi_data_copy_ext(), and gravi_data_new().

cpl_table * gravi_create_p2vm_table ( cpl_table *  detector_table,
int  nwave 
)

Create a new p2vm table.

Parameters
n_regionThe number of region
nwaveThe number of wavelength channels
ntelThe number of telescopes
Returns
The p2vm table who must contain all of values of the p2vm

The function returns a table with regname, transmission, coherence and phase columns. All columns are initialized with valid zero values.

REGNAME

Transmission

Coherence

Phase

C_matrix

Definition at line 110 of file gravi_p2vm.c.

Referenced by gravi_create_p2vm().

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, phase and coherence extract using the p2vm matrix so this function will normalise the p2vm map.

Parameters
p2vm_mapThe given P2VM calibration already computed using the function gravi_compute_p2vm
valid_transInteger array of 2 dimensions the first dimension representes the type of the data (SC = 0 or FT = 1) , it means that it has 2 elements. the second representes the information about the files witch compute the transmission of witch telescope, it means that it has 4 elements. (if the file has a shutter 3 open of the data SC valid_trans[0][2] = 1). This array will be useful to check witch par of the p2vm map in the transmission must be normalised
valid_pairInteger array of 2 dimensions the first dimension representes the type of the data (SC = 0 or FT = 1), it means that it has 2 elements. the second representes the information about the files witch compute the phase and coherence of witch base, it means that it has 4 elements. (if the file has a shutter 3 and 4 open of the data SC valid_pair[0][5] = 1)This array will be useful to check witch par of the p2vm map in the phase and coherence must be normalised
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing
CPL_ERROR_ILLEGAL_INPUTCannot retrieve the number of wavelength

The function normalises the given p2vm map

Definition at line 836 of file gravi_p2vm.c.

References gravi_array_get_quantile(), gravi_get_region(), gravi_region_get_base(), and gravi_table_get_vector().

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.

Parameters
p2vm_mapThe given P2VM already computed using the function gravi_compute_p2vm
p2vmred_dataThe P2VMRED of the 4-shutter open file
full_phase0: Force phiA(lbd) to be zero for baselines (01,02,03) = keep only closures 1: Force phiA(lbd) to have zero mean and minimum GD for baselines (01,02,03) 2: Force phiA(lbd) to have zero-GD for baselines (01,02,03)
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing
CPL_ERROR_ILLEGAL_INPUTfull_phase parameter out of range

The p2vmreduced of a 4-shutter open observation (generally the WAVE) can be used to compute the p2vm closure phase and chromatic phase, which are then removed from the P2VM phases.

Definition at line 1195 of file gravi_p2vm.c.

References gravi_array_cexp(), gravi_array_get_group_delay_loop(), gravi_array_multiply_phasor(), gravi_region_get_base(), and gravi_region_get_pol().

cpl_error_code gravi_p2vm_transmission ( gravi_data *  p2vm_map,
gravi_data *  p2vmred_data 
)

Compute the flux normalisation in the P2VM.

Parameters
p2vm_mapThe given p2vm map already computed using the function gravi_compute_p2vm
p2vmred_dataThe P2VMREDUCED of the 4-shutter open file
Exceptions
CPL_ERROR_NULL_INPUTinput data is missing

Compute the mean OI_FLUX from the p2vmreduced data. Normalize to mean=1.0 and store it into the p2vm_map.

Definition at line 1416 of file gravi_p2vm.c.

References gravi_data_add_table(), and gravi_table_oi_create().