GRAVI Pipeline Reference Manual 1.9.3
Loading...
Searching...
No Matches
Functions
Phase and OPD estimation with ellipse

Functions

static int ellipse (const double x_in[], const double v[], double *result)
 
static int dfda_ellipse (const double x_in[], const double v[], double result[])
 
cpl_vector * gravi_ellipse_phase_create (cpl_vector *vectCA, cpl_vector *vectDB, cpl_vector *envelope)
 Compute the phase atan{X',Y'}, unwraped from first sample.
 
cpl_vector * gravi_ellipse_phase_create_fast (cpl_vector *vectCA, cpl_vector *vectDB)
 
cpl_vector * gravi_ellipse_meanopd_create (cpl_table *spectrum_table, cpl_table *detector_table, cpl_table **oiwave_tables, cpl_vector *guess_vector, int base)
 Compute the OPD modulation of a baseline from spectrum.
 

Detailed Description

This module implements the computation of the phase with the ellipse methode. See gravi_ellipse_phase_create(). It also implement the function gravi_ellipse_meanopd_create() to compute the OPD estimated overs the bandpass.

Function Documentation

◆ dfda_ellipse()

static int dfda_ellipse ( const double  x_in[],
const double  v[],
double  result[] 
)
static

Definition at line 68 of file gravi_ellipse.c.

Referenced by gravi_ellipse_phase_create().

◆ ellipse()

static int ellipse ( const double  x_in[],
const double  v[],
double *  result 
)
static

Definition at line 59 of file gravi_ellipse.c.

Referenced by gravi_ellipse_phase_create().

◆ gravi_ellipse_meanopd_create()

cpl_vector * gravi_ellipse_meanopd_create ( cpl_table *  spectrum_table,
cpl_table *  detector_table,
cpl_table **  oiwave_tables,
cpl_vector *  guess_vector,
int  base 
)

Compute the OPD modulation of a baseline from spectrum.

Parameters
spectrum_tableThe input spectrum
detector_tableThe corresponding detector_table
oiwave_tablesThe wavelength tables(s)
guess_vectorAn optional vector with guess [m]

The routine compute the OPD of each spectral channel with the ellipse. These are averaged over channel and polarisations to provide a single value per baseline and per DIT.

The group-delay is also computed internally, to then ensure that the returned OPD = 0 [m] corresponds to group-delay = 0 [m].

If a guess is provided (shall be in [m]), the phase of each channel is first unwrap following this guess before averaging.

Definition at line 351 of file gravi_ellipse.c.

References cpl_msg_debug(), cpl_msg_info(), CPLCHECK_NUL, FREE, gravi_compute_envelope(), GRAVI_DATA, gravi_ellipse_phase_create(), gravi_get_region(), GRAVI_LBD_FTSC, gravi_msg_function_exit, gravi_msg_function_start, gravi_region_get_base_sign(), gravi_spectrum_get_nwave(), gravi_table_get_vector(), and gravi_vector_unwrap_with_guess().

Referenced by gravi_compute_p2vm(), and gravi_opds_calibration().

◆ gravi_ellipse_phase_create()

cpl_vector * gravi_ellipse_phase_create ( cpl_vector *  vectCA,
cpl_vector *  vectDB,
cpl_vector *  envelope 
)

Compute the phase atan{X',Y'}, unwraped from first sample.

Parameters
vectCAInput vector
vectCAInput vector
envelopeInput vector
Returns
A newly allocated vector with the computed unwrapped phase [rad]

The quantities vectCA and vectDB are fitted with an ellipse of amplitude envelope, and converted into X' and Y' (see pipeline design document). Then the phase is computed and unwrapped.

If the variable USE_LINEAR_ELLIPSE is 1, the functions uses a linear fit. Otherwise it uses a longuer and possibly less stable minimisation.

vectCA, vectDB and envelope shall have the same size and ideally shall modulate over several fringes with good phase diversity in order for the ellipse fit to be well defined.

Definition at line 107 of file gravi_ellipse.c.

References dfda_ellipse(), ellipse(), FREE, get_matrix_from_vector(), gravi_msg_function_exit, gravi_msg_function_start, and USE_LINEAR_ELLIPSE.

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

◆ gravi_ellipse_phase_create_fast()

cpl_vector * gravi_ellipse_phase_create_fast ( cpl_vector *  vectCA,
cpl_vector *  vectDB 
)

Definition at line 287 of file gravi_ellipse.c.

References gravi_msg_function_exit, and gravi_msg_function_start.