GRAVI Pipeline Reference Manual 1.9.0
Loading...
Searching...
No Matches
Functions | Variables
Miscellaneous Utilities

Functions

const char * gravi_get_license (void)
 Get the pipeline copyright and license.
 
cpl_error_code gravi_msg_warning (const char *component, const char *msg)
 
cpl_table * gravi_table_oi_create (int nwave, int nrow, const char *oi_name)
 Create the oi table (oi_vis, oi_vis2, oi_t3)
 
int gravi_region_get_base (cpl_table *imaging_detector, int region)
 Return the base of a region.
 
int gravi_region_get_base_sign (cpl_table *imaging_detector, int base)
 Return the sign of a base by looking at the PORT order.
 
int gravi_region_get_pol (cpl_table *imaging_detector, int region)
 Return the polarisation id of a region.
 
int gravi_region_get_phaseid (cpl_table *imaging_detector, int region)
 Return the phase id of a region.
 
int gravi_region_get_tel (cpl_table *imaging_detector, int region, int beam)
 Return the telescope id (0,1,2,3) in a beam of a region.
 
char gravi_region_get_phase (cpl_table *imaging_detector, int region)
 Return the phase character of a region.
 
int gravi_get_region (cpl_table *img_det, int base, char phase, int pol)
 Find the region matching base, phase and pol.
 
int gravi_wave_get_nlambda (cpl_table *wave_data, double lambda_min, double lambda_max)
 Get the number of spectral element between lambdamin et lambdamax.
 
int * gravi_image_extract_dimension (cpl_image *img_profile)
 Compute startx and nx of the illuminated part of the image.
 
short gravi_sta_index (int gravi_input, cpl_table *optical_train_table, cpl_table *array_geometry_table)
 Retrieve STA_INDEX corresponding to a given input.
 
int gravi_get_shutter (cpl_propertylist *header, int tel)
 
int gravi_check_shutter (cpl_propertylist *header, int t0, int t1, int t2, int t3)
 
int gravi_get_shutter_id (cpl_propertylist *header)
 
int gravi_get_shutter_baseid (cpl_propertylist *header)
 
int gravi_data_check_shutter_beam (gravi_data **datas, int nb_datas)
 
cpl_size gravi_spectrum_get_nwave (const cpl_table *table)
 
cpl_size gravi_spectrum_get_nregion (const cpl_table *table)
 
double gravi_spectrum_get_flux (const cpl_table *table)
 Return the total flux in DATA# regions.
 
cpl_vector * gravi_compute_envelope (const cpl_vector *opd, int wave, int nwave)
 Compute the envelope value.
 
double gravi_imagelist_get_flux (const cpl_imagelist *imglist)
 Return the total flux in imagelist.
 
cpl_error_code gravi_lkdt_get_sequence (cpl_table *oi_table, cpl_size ntel, cpl_size *first, cpl_size *nobs)
 Return the longuest sequence with constant LKDT.
 
int gravi_conf_get_iss (int gravi_beam, cpl_propertylist *header)
 
const char * gravi_conf_get_telname (int gravi_beam, cpl_propertylist *header)
 
cpl_error_code gravi_dump_the_boss (double ra, double dec)
 

Variables

int GRAVI_BASE_TEL [GRAVI_NBASE][2] = { {0,1}, {0,2}, {0,3}, {1,2}, {1,3}, {2,3} }
 
char GRAVI_BASE_NAME [6][3] = {"12","13","14","23","24","34"}
 
int GRAVI_TRI_BASE [GRAVI_NBASE][2][2] = { {{1,3},{2,4}}, {{0,3},{2,5}}, {{0,4},{1,5}}, {{0,1},{4,5}}, {{0,2},{3,5}}, {{1,2},{3,4}}}
 
int GRAVI_TRI_SIGN [GRAVI_NBASE][2][2] = { {{1,-1},{1,-1}}, {{1,1},{1,-1}}, {{1,1},{1,1}}, {{-1,1},{1,-1}}, {{-1,1},{1,1}}, {{-1,1},{-1,1}} }
 
int GRAVI_CLO_TEL [4][3] = {{0,1,2}, {0,1,3}, {0,2,3}, {1,2,3}}
 
char GRAVI_CLO_NAME [4][4] = {"123", "124", "134", "234"}
 
int GRAVI_CLO_BASE [4][3] = {{0,3,1}, {0,4,2}, {1,5,2}, {3,5,4}}
 
char GRAVI_DATA [50][7]
 
char GRAVI_DATAERR [50][10]
 
int GRAVI_LABINPUT [4] = {7,5,3,1}
 

Detailed Description

This module contains some utilities to access to specific quantities.

Function Documentation

◆ gravi_check_shutter()

int gravi_check_shutter ( cpl_propertylist *  header,
int  t0,
int  t1,
int  t2,
int  t3 
)

◆ gravi_compute_envelope()

cpl_vector * gravi_compute_envelope ( const cpl_vector *  opd,
int  wave,
int  nwave 
)

Compute the envelope value.

Parameters
opdInput vector with GD in [m]
waveInput wave channel
nwaveNumber of wave channel (define spectral resolution)
Returns
A newly allocated vector with the computed envelope

The vector is filled with the envelope amplitude at each OPD_GD position for the spectral channel wave, assuming the K-band is split into n_wave channel. Thus n_wave defines the spectral resolution (coherence length). The enveloppe is modeled with a Gaussian function.

Assume wave are ordered increasingly.

Definition at line 1081 of file gravi_utils.c.

References CPLCHECK_NUL, and GRAVI_LBD_FTSC.

Referenced by gravi_compute_p2vm(), gravi_ellipse_meanopd_create(), gravi_wave_fibre(), and gravi_wave_scan().

◆ gravi_conf_get_iss()

int gravi_conf_get_iss ( int  gravi_beam,
cpl_propertylist *  header 
)

Definition at line 1170 of file gravi_utils.c.

References GRAVI_LABINPUT, and header.

◆ gravi_conf_get_telname()

const char * gravi_conf_get_telname ( int  gravi_beam,
cpl_propertylist *  header 
)

◆ gravi_data_check_shutter_beam()

int gravi_data_check_shutter_beam ( gravi_data **  datas,
int  nb_datas 
)

◆ gravi_dump_the_boss()

cpl_error_code gravi_dump_the_boss ( double  ra,
double  dec 
)

Definition at line 1217 of file gravi_utils.c.

References cpl_msg_info(), gravi_dec_to_rad(), and gravi_ra_to_rad().

Referenced by gravi_create_oitarget_table().

◆ gravi_get_license()

const char * gravi_get_license ( void  )

Get the pipeline copyright and license.

Returns
The copyright and license string

The function returns a pointer to the statically allocated license string. This string should not be modified using the returned pointer.

Definition at line 104 of file gravi_utils.c.

Referenced by cpl_plugin_get_info().

◆ gravi_get_region()

int gravi_get_region ( cpl_table *  img_det,
int  base,
char  phase,
int  pol 
)

Find the region matching base, phase and pol.

Parameters
imaging_detectorThe IMAGING_DETECTOR table
baseThe requested base (0..5)
phaseThe requested phase ('A','B','C' or 'D')
polThe requested pol (0 or 1)
Returns
The region id (or -1 on failure)

Definition at line 584 of file gravi_utils.c.

References gravi_region_get_base(), gravi_region_get_phase(), and gravi_region_get_pol().

Referenced by gravi_ellipse_meanopd_create(), gravi_p2vm_normalisation(), gravi_visdata_fromellipse(), gravi_wave_fibre(), gravi_wave_fit_2d(), and if().

◆ gravi_get_shutter()

int gravi_get_shutter ( cpl_propertylist *  header,
int  tel 
)

Definition at line 923 of file gravi_utils.c.

References GRAVI_SHUTTER_KEY, header, and SHUTTER_KEY.

Referenced by gravi_check_shutter().

◆ gravi_get_shutter_baseid()

int gravi_get_shutter_baseid ( cpl_propertylist *  header)

Definition at line 970 of file gravi_utils.c.

References gravi_check_shutter(), and header.

◆ gravi_get_shutter_id()

int gravi_get_shutter_id ( cpl_propertylist *  header)

Definition at line 956 of file gravi_utils.c.

References gravi_check_shutter(), and header.

Referenced by gravi_compute_profile().

◆ gravi_image_extract_dimension()

int * gravi_image_extract_dimension ( cpl_image *  img_profile)

Compute startx and nx of the illuminated part of the image.

Parameters
img_profileThe input image to look at
Returns
A pointer to int[2] with startx and nx

The function collapse the vertical (y) dimension and run a median filter over x. Then the limits are defined by the region when the the median filter is larger than 0.1 x MAX

Definition at line 727 of file gravi_utils.c.

Referenced by gravi_compute_profile().

◆ gravi_imagelist_get_flux()

double gravi_imagelist_get_flux ( const cpl_imagelist *  imglist)

Return the total flux in imagelist.

Parameters
imglistThe input imagelist
Returns
The flux

Compute the total flux by looping on image.

Definition at line 1117 of file gravi_utils.c.

Referenced by gravi_extract_spectrum().

◆ gravi_lkdt_get_sequence()

cpl_error_code gravi_lkdt_get_sequence ( cpl_table *  oi_table,
cpl_size  ntel,
cpl_size *  first,
cpl_size *  nobs 
)

Return the longuest sequence with constant LKDT.

Parameters
oi_tableThe table to explore
ntelThe number of sample per obs (4 or 6)
firstReturn the first obs of the sequence
nobsReturn the nb of obs in the sequence

Search for the longuest sequence for which the LKDT_MET_FC are the same for the ntel beams. If several are of the same length, the first is returned.

Definition at line 1145 of file gravi_utils.c.

References ntel.

Referenced by gravi_disp_cleanup().

◆ gravi_msg_warning()

cpl_error_code gravi_msg_warning ( const char *  component,
const char *  msg 
)

◆ gravi_region_get_base()

int gravi_region_get_base ( cpl_table *  imaging_detector,
int  region 
)

Return the base of a region.

Parameters
imaging_detectorThe IMAGING_DETECTOR table
regionThe region (0..47)
Returns
The base corresponding to this region

The function returns a integer from 0 to 5 (or -1 on failure) If REGNAME is 12-A-C, the function returns 0 If REGNAME is 21-A-C, the function returns 0 If REGNAME is 23-A-C, the function returns 3 If REGNAME is 34-A-C, the function returns 5 ...

Definition at line 361 of file gravi_utils.c.

References GRAVI_NBASE.

Referenced by gravi_get_region(), gravi_p2vm_normalisation(), gravi_p2vm_phase_correction(), gravi_wave_fit_individual(), gravi_wave_scan(), and gravi_wave_test_image().

◆ gravi_region_get_base_sign()

int gravi_region_get_base_sign ( cpl_table *  imaging_detector,
int  base 
)

Return the sign of a base by looking at the PORT order.

Parameters
imaging_detectorThe IMAGING_DETECTOR table
baseThe base (0..5)
Returns
The sign of this base (-1/+1), or 0 or error

The sign is defined by the order of the beam in the PORT column. If the first PORT is the largest, the sign is -1. If the first port is the smallest, the sign is +1.

Definition at line 399 of file gravi_utils.c.

References GRAVI_BASE_NAME, and GRAVI_NBASE.

Referenced by gravi_ellipse_meanopd_create(), gravi_wave_fibre(), and gravi_wave_scan().

◆ gravi_region_get_phase()

char gravi_region_get_phase ( cpl_table *  imaging_detector,
int  region 
)

Return the phase character of a region.

Parameters
imaging_detectorThe IMAGING_DETECTOR table
regionThe region (0..47)
Returns
The phase char corresponding to this region

The function returns 'A', 'B', 'C' or 'D' If REGNAME is 12-A-C, the function returns 'A' If REGNAME is 12-B-C, the function returns 'B' If REGNAME is 12-C-C, the function returns 'C' If REGNAME is 12-D-C, the function returns 'D'

Definition at line 551 of file gravi_utils.c.

Referenced by gravi_get_region().

◆ gravi_region_get_phaseid()

int gravi_region_get_phaseid ( cpl_table *  imaging_detector,
int  region 
)

Return the phase id of a region.

Parameters
imaging_detectorThe IMAGING_DETECTOR table
regionThe region (0..47)
Returns
The phase id corresponding to this region

The function returns 0 to 3 (or -1 on failure). If REGNAME is 12-A-C, the function returns 0 If REGNAME is 12-B-C, the function returns 1 If REGNAME is 12-C-C, the function returns 2 If REGNAME is 12-D-C, the function returns 3

Definition at line 479 of file gravi_utils.c.

◆ gravi_region_get_pol()

int gravi_region_get_pol ( cpl_table *  imaging_detector,
int  region 
)

Return the polarisation id of a region.

Parameters
imaging_detectorThe IMAGING_DETECTOR table
regionThe region (0..47)
Returns
The polarisation id corresponding to this region

The function returns 0 or 1 (or -1 on failure). If REGNAME is 12-A-C, the function returns 0 If REGNAME is 12-A-S, the function returns 0 If REGNAME is 12-A-P, the function returns 1

Definition at line 445 of file gravi_utils.c.

Referenced by gravi_compute_p2vm(), gravi_compute_p2vmred(), gravi_create_oiwave_table_ft(), gravi_get_region(), gravi_interpolate_spectrum_table(), gravi_p2vm_phase_correction(), gravi_wave_fit_2d(), and gravi_wave_test_image().

◆ gravi_region_get_tel()

int gravi_region_get_tel ( cpl_table *  imaging_detector,
int  region,
int  beam 
)

Return the telescope id (0,1,2,3) in a beam of a region.

Parameters
imaging_detectorThe table IMAGING_DETECTOR
regionThe region to query
beamThe beam to query (0 or 1)

If REGNAME is 34-A-C, the function return 2 for beam 0 and 3 for beam 1 If REGNAME is 21-B-S, the function return 1 for beam 0 and 0 for beam 1 ...

Definition at line 512 of file gravi_utils.c.

Referenced by gravi_compute_profile().

◆ gravi_spectrum_get_flux()

double gravi_spectrum_get_flux ( const cpl_table *  table)

Return the total flux in DATA# regions.

Parameters
tableThe input table
Returns
The flux

Compute the total flux on DATA# regions by looping on regions and rows.

Definition at line 1042 of file gravi_utils.c.

References GRAVI_DATA, and gravi_spectrum_get_nregion().

Referenced by gravi_align_spectrum(), and gravi_extract_spectrum().

◆ gravi_spectrum_get_nregion()

cpl_size gravi_spectrum_get_nregion ( const cpl_table *  table)

◆ gravi_spectrum_get_nwave()

cpl_size gravi_spectrum_get_nwave ( const cpl_table *  table)

◆ gravi_sta_index()

short gravi_sta_index ( int  gravi_input,
cpl_table *  optical_train_table,
cpl_table *  array_geometry_table 
)

Retrieve STA_INDEX corresponding to a given input.

Parameters
gravi_inputGRAVITY input index (1..4)
Returns
STA_INDEX

Definition at line 828 of file gravi_utils.c.

References cpl_msg_debug(), FREE, GRAVI_LABINPUT_1, GRAVI_LABINPUT_2, GRAVI_LABINPUT_3, GRAVI_LABINPUT_4, gravi_msg_function_exit, and gravi_msg_function_start.

Referenced by gravi_compute_p2vmred().

◆ gravi_table_oi_create()

cpl_table * gravi_table_oi_create ( int  nwave,
int  nrow,
const char *  oi_name 
)

Create the oi table (oi_vis, oi_vis2, oi_t3)

Parameters
nwaveThe size of the wavelength
nrowThe number of acquisitions or of the file using to compute the visibilities
oi_nameThe name of the table to create
Returns
The oi table needed with the number of acquisitions and size of the wavelength of each spectrum

The function returns a cpl_table

Definition at line 153 of file gravi_utils.c.

References CPLCHECK_NUL, gravi_msg_function_exit, gravi_msg_function_start, GRAVI_OI_FLUX_EXT, GRAVI_OI_T3_EXT, GRAVI_OI_VIS2_EXT, and GRAVI_OI_VIS_EXT.

Referenced by gravi_compute_p2vmred(), gravi_compute_vis(), and gravi_p2vm_transmission().

◆ gravi_wave_get_nlambda()

int gravi_wave_get_nlambda ( cpl_table *  wave_data,
double  lambda_min,
double  lambda_max 
)

Get the number of spectral element between lambdamin et lambdamax.

Parameters
wave_tableThe table loaded from the IMAGING_DETECTOR field
lambda_minThe number of the first telescope
lambda_maxThe number of the second telescope
Returns
the number of spectral element

The function returns a integer

Definition at line 611 of file gravi_utils.c.

References cpl_msg_info(), CPLCHECK_INT, FREE, GRAVI_DATA, and wave_data.

Referenced by gravi_create_oiwave_table_sc().

Variable Documentation

◆ GRAVI_BASE_NAME

char GRAVI_BASE_NAME[6][3] = {"12","13","14","23","24","34"}

◆ GRAVI_BASE_TEL

int GRAVI_BASE_TEL[GRAVI_NBASE][2] = { {0,1}, {0,2}, {0,3}, {1,2}, {1,3}, {2,3} }

◆ GRAVI_CLO_BASE

int GRAVI_CLO_BASE[4][3] = {{0,3,1}, {0,4,2}, {1,5,2}, {3,5,4}}

Definition at line 68 of file gravi_utils.c.

Referenced by gravi_opds_correct_closures(), and gravi_t3_average_bootstrap().

◆ GRAVI_CLO_NAME

char GRAVI_CLO_NAME[4][4] = {"123", "124", "134", "234"}

Definition at line 65 of file gravi_utils.c.

Referenced by gravi_compute_signals(), and gravi_compute_vis_qc().

◆ GRAVI_CLO_TEL

int GRAVI_CLO_TEL[4][3] = {{0,1,2}, {0,1,3}, {0,2,3}, {1,2,3}}

◆ GRAVI_DATA

char GRAVI_DATA[50][7]
Initial value:
=
{"DATA1", "DATA2", "DATA3", "DATA4", "DATA5", "DATA6", "DATA7", "DATA8", "DATA9", "DATA10",
"DATA11","DATA12","DATA13","DATA14","DATA15","DATA16","DATA17","DATA18","DATA19","DATA20",
"DATA21","DATA22","DATA23","DATA24","DATA25","DATA26","DATA27","DATA28","DATA29","DATA30",
"DATA31","DATA32","DATA33","DATA34","DATA35","DATA36","DATA37","DATA38","DATA39","DATA40",
"DATA41","DATA42","DATA43","DATA44","DATA45","DATA46","DATA47","DATA48","DATA49","DATA50"}

Definition at line 71 of file gravi_utils.c.

Referenced by gravi_compute_argon_pos(), gravi_compute_argon_wave(), gravi_compute_p2vm(), gravi_compute_p2vmred(), gravi_compute_profile(), gravi_create_oiwave_table_ft(), gravi_ellipse_meanopd_create(), gravi_extract_spectrum(), gravi_imglist_sc_collapse(), gravi_interpolate_spectrum_table(), gravi_p2vm_mean_spectrum(), gravi_smooth_preproc(), gravi_spectrum_get_flux(), gravi_spectrum_get_nregion(), gravi_table_ft_format(), gravi_visdata_fromellipse(), gravi_wave_fibre(), gravi_wave_fit_2d(), gravi_wave_fit_individual(), gravi_wave_get_nlambda(), gravi_wave_qc(), gravi_wave_scan(), gravi_wave_test_image(), and if().

◆ GRAVI_DATAERR

char GRAVI_DATAERR[50][10]
Initial value:
=
{"DATAERR1", "DATAERR2", "DATAERR3", "DATAERR4", "DATAERR5", "DATAERR6", "DATAERR7", "DATAERR8", "DATAERR9", "DATAERR10",
"DATAERR11","DATAERR12","DATAERR13","DATAERR14","DATAERR15","DATAERR16","DATAERR17","DATAERR18","DATAERR19","DATAERR20",
"DATAERR21","DATAERR22","DATAERR23","DATAERR24","DATAERR25","DATAERR26","DATAERR27","DATAERR28","DATAERR29","DATAERR30",
"DATAERR31","DATAERR32","DATAERR33","DATAERR34","DATAERR35","DATAERR36","DATAERR37","DATAERR38","DATAERR39","DATAERR40",
"DATAERR41","DATAERR42","DATAERR43","DATAERR44","DATAERR45","DATAERR46","DATAERR47","DATAERR48","DATAERR49","DATAERR50"}

Definition at line 79 of file gravi_utils.c.

Referenced by gravi_compute_p2vm(), gravi_compute_p2vmred(), gravi_extract_spectrum(), gravi_imglist_sc_collapse(), gravi_interpolate_spectrum_table(), gravi_p2vm_mean_spectrum(), and gravi_table_ft_format().

◆ GRAVI_LABINPUT

int GRAVI_LABINPUT[4] = {7,5,3,1}

Definition at line 88 of file gravi_utils.c.

Referenced by gravi_conf_get_iss(), and gravi_conf_get_telname().

◆ GRAVI_TRI_BASE

int GRAVI_TRI_BASE[GRAVI_NBASE][2][2] = { {{1,3},{2,4}}, {{0,3},{2,5}}, {{0,4},{1,5}}, {{0,1},{4,5}}, {{0,2},{3,5}}, {{1,2},{3,4}}}

◆ GRAVI_TRI_SIGN

int GRAVI_TRI_SIGN[GRAVI_NBASE][2][2] = { {{1,-1},{1,-1}}, {{1,1},{1,-1}}, {{1,1},{1,1}}, {{-1,1},{1,-1}}, {{-1,1},{1,1}}, {{-1,1},{-1,1}} }