|
GRAVI Pipeline Reference Manual
1.2.3
|
Functions | |
| cpl_array ** | gravi_array_new_list (int n, cpl_type type, int size) |
| Allocate a list of arrays, pre-filled with 0.0. | |
| cpl_error_code | gravi_table_set_string_fixlen (cpl_table *table, const char *name, int row, const char *value, int len) |
| Set string in table, ensuring fixed length (right space padding). see cpl_table_set_string. More... | |
| cpl_array * | gravi_array_cexp (double complex factor, const cpl_array *input) |
| Compute the complex exponention of an array: cexp (factor * input) | |
| cpl_error_code | gravi_array_multiply_phasor (cpl_array *input, double complex factor, cpl_array *phase) |
| Multiply a REAL phase to a COMPLEX array, in-place: input = input * cexp (factor * phase) | |
| cpl_error_code | gravi_array_add_phasor (cpl_array *input, double complex factor, cpl_array *phase) |
| Add a REAL phase to a COMPLEX array, in-place: input = input + cexp (factor * phase) | |
| cpl_error_code | gravi_array_add_phasors (cpl_array *input, cpl_array *add, cpl_array *sub) |
| Add a pair of COMPLEX arrays to a COMPLEX array, in-place: input = input + add*conj(sub) | |
| cpl_error_code | gravi_array_add_phase (cpl_array *input, double factor, cpl_array *phase) |
| Add a REAL phase to a REAL phase array, in-place: input = input + factor * phase. | |
| cpl_error_code | gravi_array_get_group_delay_loop (cpl_array **input, cpl_array *sigma, double *gd, cpl_size nrow, double max_width, int verbose) |
| Optimized computation of GDELAY for a list of arrays. More... | |
| int | gravi_table_are_equal (cpl_table *first, cpl_table *second) |
| Check if two tables have the same content. More... | |
| cpl_error_code | gravi_imagelist_unwrap_images (cpl_imagelist *imglist) |
| Unwrap an imagelist an all its images. More... | |
| cpl_imagelist * | gravi_imagelist_wrap_column (cpl_table *table_data, const char *data_x) |
| Wrap a column array of a table into an imagelist. More... | |
| double | gravi_image_get_noise_window (cpl_image *img, cpl_size llx, cpl_size lly, cpl_size urx, cpl_size ury) |
| Estimate the median noise in a window. This noise is estimated as the median{img**2}**0.5, so that it is a robust estimate. | |
| cpl_image * | gravi_image_from_column (cpl_table *table_data, const char *data_x, cpl_size row) |
| Create an image from a column array in table. More... | |
| cpl_imagelist * | gravi_imagelist_from_column (cpl_table *table_data, const char *data_x) |
| Create an imagelist from a column array in table. More... | |
| cpl_array * | gravi_table_get_column_dimension (const cpl_table *table, const char *name) |
| Return an array ready for cpl_table_set_column_dimension. More... | |
| cpl_array * | gravi_array_wrap_image (cpl_image *img) |
| Wrap the data of na image into an array. More... | |
| cpl_matrix * | get_matrix_from_vector (cpl_vector *vector1, cpl_vector *vector2) |
| Copy the content of two vector into a newly allocated 2D matrix. More... | |
| cpl_vector * | gravi_table_get_vector (cpl_table *spectrum_data, cpl_size index, const char *regname) |
Create a vector from the row index of the column regname. More... | |
| cpl_vector * | gravi_table_get_vector_diff (cpl_table *spectrum_data, int index, const char *regname1, const char *regname2) |
Create a vector from the row index of the column regname. More... | |
| cpl_error_code | gravi_image_fill (cpl_image *img, double value) |
| Fill entire image with value. | |
| cpl_image * | gravi_image_wrap_matrix (cpl_matrix *matrix) |
| Wrap matrix into an image (data not duplicated) | |
| cpl_image * | gravi_image_wrap_vector (cpl_vector *vector) |
| Wrap vector into an image (data not duplicated) | |
| double | gravi_image_get_quantile (const cpl_image *img, double thr) |
| Compute the quantile of an image. More... | |
| double | gravi_array_get_quantile (cpl_array *arr, double thr) |
| Compute the value of the vector corresponding to the quantile 'thr' (0 < thr < 1) More... | |
| cpl_size | gravi_vector_get_maxpos (cpl_vector *vector) |
| Return the index of maximum in a vector. If several indexes exists with the maximum value, the smallest index is returned. More... | |
| double | gravi_vector_get_mean_clip (cpl_vector *vector_in, double percent, double nsigma) |
| Return the mean of a vector after extrema and RMS clipping. More... | |
| cpl_vector * | gravi_vector_extract (const cpl_vector *vector, int start, int step) |
| Extract part of a vector. More... | |
| cpl_error_code | gravi_vector_unwrap_with_guess (cpl_vector *vector, cpl_vector *ref, double ref_to_phase) |
| Unwrap a phase vector following a guess vector. The difference is actually unwrap and shall thus be slowly evolving. The operration if performed in-place. More... | |
| cpl_error_code | gravi_table_multiply_scalar (cpl_table *table, const char *name, int base, int nbase, double value) |
| Multiply scalar or array column by scalar. More... | |
| cpl_error_code | gravi_table_add_scalar (cpl_table *table, const char *name, int base, int nbase, double value) |
| Multply scalar or array column by scalar. More... | |
| cpl_matrix * | gravi_matrix_interpolate_col (cpl_matrix *matrix, cpl_vector *xref, cpl_vector *xout) |
| Linear interpolation of matrix column. More... | |
| cpl_matrix * | gravi_matrix_invertSV_create (cpl_matrix *a_in) |
| Invers a matrix with singular value decomposition. More... | |
| cpl_table * | gravi_table_extract_time_interval (cpl_table *table, double start, double end) |
| Extract rows from table based on the TIME column. More... | |
This module implements some interactions with cpl objects to address specific gravity needs. The manipulated cpl object are cpl_matrix, cpl_array, cpl_table and cpl_image
| cpl_matrix* get_matrix_from_vector | ( | cpl_vector * | vector1, |
| cpl_vector * | vector2 | ||
| ) |
Copy the content of two vector into a newly allocated 2D matrix.
| vector1 | |
| vector2 |
Definition at line 1820 of file gravi_cpl.c.
Referenced by gravi_ellipse_phase_create().
| cpl_error_code gravi_array_get_group_delay_loop | ( | cpl_array ** | input, |
| cpl_array * | sigma, | ||
| double * | gd, | ||
| cpl_size | nrow, | ||
| double | max_width, | ||
| int | verbose | ||
| ) |
Optimized computation of GDELAY for a list of arrays.
| input | Pointer to arrays (complex coherent flux) |
| sigma | Array with the wavenumbers [m] |
| gd | Pointer to output GDELAYs [m] |
| nrow | Size of input and gd |
| max_width | Maximum opd to explore [m] |
| verbose | Flag to dump the computation time in log |
For each input array, the group-delay in [m] as the maximum of |Env(x)| where Env(x) = < visdata(lbd) * exp(2i.pi * x / lbd) > with <> sum over lbd
This is optimized to run on a column of arrays:
Definition at line 1187 of file gravi_cpl.c.
References gravi_array_get_group_delay_loop().
Referenced by gravi_array_get_group_delay_loop(), gravi_average_self_visphi(), gravi_compute_vis(), and gravi_p2vm_phase_correction().
| double gravi_array_get_quantile | ( | cpl_array * | arr, |
| double | thr | ||
| ) |
Compute the value of the vector corresponding to the quantile 'thr' (0 < thr < 1)
Definition at line 2146 of file gravi_cpl.c.
Referenced by gravi_p2vm_normalisation().
| cpl_array* gravi_array_wrap_image | ( | cpl_image * | img | ) |
Wrap the data of na image into an array.
| img | The image to wrap |
img. cpl_array_unwrap(). Definition at line 1776 of file gravi_cpl.c.
Referenced by gravi_compute_dark(), and gravi_compute_profile().
| cpl_image* gravi_image_from_column | ( | cpl_table * | table_data, |
| const char * | data_x, | ||
| cpl_size | row | ||
| ) |
Create an image from a column array in table.
| table_data | The input table |
| data_x | The column name |
| row | The row to extract |
The array is copied into image of same type. The returned pointer shall be deleted with cpl_image_delete
FIXME: to be optimized
Definition at line 1687 of file gravi_cpl.c.
References gravi_imagelist_unwrap_images(), and gravi_imagelist_wrap_column().
Referenced by gravi_compute_gain(), and gravi_compute_profile().
| double gravi_image_get_quantile | ( | const cpl_image * | img, |
| double | thr | ||
| ) |
Compute the quantile of an image.
| img | input image |
| thr | quantile fraction (0 < thr < 1) |
Compute the value of the image corresponding to the quantile fraction 'thr', that is such that their is nx*ny*thr pixels with values lower the returned value.
Definition at line 2112 of file gravi_cpl.c.
Referenced by gravi_compute_badpix(), and gravi_compute_biasmask().
| cpl_imagelist* gravi_imagelist_from_column | ( | cpl_table * | table_data, |
| const char * | data_x | ||
| ) |
Create an imagelist from a column array in table.
| table_data | The input table |
| data_x | The column name |
The array of each row are copied into image of their type, and append into the returned imagelist. The returned pointer shall be deleted with cpl_imagelist_delete
FIXME: to be optimized
Definition at line 1719 of file gravi_cpl.c.
References gravi_imagelist_unwrap_images(), and gravi_imagelist_wrap_column().
Referenced by gravi_compute_gain().
| cpl_error_code gravi_imagelist_unwrap_images | ( | cpl_imagelist * | imglist | ) |
Unwrap an imagelist an all its images.
| imglist | The imagelist to unwrap |
All the images of imaglist are unwrapped, that is the data remain allocated but the image structure is deleted (see cpl_image_unwrap). Then the imagelist structure itself is deleted with cpl_imagelist_delete.
Definition at line 1496 of file gravi_cpl.c.
Referenced by gravi_compute_dark(), gravi_compute_p2vm(), gravi_compute_profile(), gravi_image_from_column(), gravi_imagelist_from_column(), gravi_imglist_sc_collapse(), and gravi_wave_test_image().
| cpl_imagelist* gravi_imagelist_wrap_column | ( | cpl_table * | table_data, |
| const char * | data_x | ||
| ) |
Wrap a column array of a table into an imagelist.
| table_data | The input table |
| data_x | The column name |
The array of each row are wrapped into image of their type, and append into the returned imagelist. The returned pointer shall be deleted with gravi_imagelist_unwrap_images
Definition at line 1526 of file gravi_cpl.c.
Referenced by gravi_compute_dark(), gravi_compute_p2vm(), gravi_compute_profile(), gravi_image_from_column(), gravi_imagelist_from_column(), gravi_imglist_sc_collapse(), and gravi_wave_test_image().
| cpl_matrix* gravi_matrix_interpolate_col | ( | cpl_matrix * | matrix, |
| cpl_vector * | xref, | ||
| cpl_vector * | xout | ||
| ) |
Linear interpolation of matrix column.
| matrix | The input matrix to interpolate (size n,m) |
| xref | The vector of current x axis (size m) |
| xout | The vector of target x axis (size k) |
The routine interpolate each column of the matrix using cpl_bivector_interpolate_linear
Definition at line 2432 of file gravi_cpl.c.
| cpl_matrix* gravi_matrix_invertSV_create | ( | cpl_matrix * | a_in | ) |
Invers a matrix with singular value decomposition.
| a_in | The input matrix to invert |
Definition at line 2486 of file gravi_cpl.c.
Referenced by gravi_compute_p2vm(), and gravi_compute_p2vmred().
| cpl_error_code gravi_table_add_scalar | ( | cpl_table * | table, |
| const char * | name, | ||
| int | base, | ||
| int | nbase, | ||
| double | value | ||
| ) |
Multply scalar or array column by scalar.
| table | The table to modify in-place |
| name | The name of the column to modify |
| base | The starting row |
| nbase | The row increment |
| value | Value to add |
Each row in base::nbase (pythonic notation) of the column name is being added by value.
Definition at line 2381 of file gravi_cpl.c.
Referenced by gravi_opds_compute_guess().
| int gravi_table_are_equal | ( | cpl_table * | first, |
| cpl_table * | second | ||
| ) |
Check if two tables have the same content.
| first | table to compare |
| second | table to compare |
Definition at line 1358 of file gravi_cpl.c.
Referenced by gravi_data_append().
| cpl_table* gravi_table_extract_time_interval | ( | cpl_table * | table, |
| double | start, | ||
| double | end | ||
| ) |
Extract rows from table based on the TIME column.
| table | input table |
| start,end | max and min accepted time. |
Definition at line 2826 of file gravi_cpl.c.
Referenced by gravi_compute_vis().
| cpl_array* gravi_table_get_column_dimension | ( | const cpl_table * | table, |
| const char * | name | ||
| ) |
Return an array ready for cpl_table_set_column_dimension.
| table | The input table |
| name | The column name |
The return array (CPL_TYPE_INT) is of size the number returned by cpl_table_get_column_dimensions, and each values corresponds to the dimension returned by cpl_table_get_column_dimension
Definition at line 1749 of file gravi_cpl.c.
| cpl_vector* gravi_table_get_vector | ( | cpl_table * | spectrum_data, |
| cpl_size | index, | ||
| const char * | regname | ||
| ) |
Create a vector from the row index of the column regname.
| spectrum_table | The table loaded from the SPECTRUM_DATA field |
| regname | The column's name on the table |
| index | The index on the row (0 for a scalar column) |
Create a vector from the row index of the column regname The returned vector must be deallocated.
Definition at line 1870 of file gravi_cpl.c.
Referenced by gravi_compute_disp(), gravi_compute_p2vm(), gravi_ellipse_meanopd_create(), gravi_p2vm_normalisation(), and gravi_wave_fibre().
| cpl_vector* gravi_table_get_vector_diff | ( | cpl_table * | spectrum_data, |
| int | index, | ||
| const char * | regname1, | ||
| const char * | regname2 | ||
| ) |
Create a vector from the row index of the column regname.
| spectrum_table | The table loaded from the SPECTRUM_DATA field |
| index | The index on the row |
| regname1 | The column's name on the table |
| regname2 | The column's name on the table |
Create a vector from the row index of the column regname The returned vector must be deallocated.
Definition at line 1991 of file gravi_cpl.c.
| cpl_error_code gravi_table_multiply_scalar | ( | cpl_table * | table, |
| const char * | name, | ||
| int | base, | ||
| int | nbase, | ||
| double | value | ||
| ) |
Multiply scalar or array column by scalar.
| table | The table to modify in-place |
| name | The name of the column to modify |
| base | The starting row |
| nbase | The row increment |
| value | Value to multiply |
Each row in base::nbase (pythonic notation) of the column name is being multiplied by value.
Definition at line 2331 of file gravi_cpl.c.
Referenced by gravi_compute_disp().
| cpl_error_code gravi_table_set_string_fixlen | ( | cpl_table * | table, |
| const char * | name, | ||
| int | row, | ||
| const char * | value, | ||
| int | len | ||
| ) |
Set string in table, ensuring fixed length (right space padding). see cpl_table_set_string.
| len,the | specified maximum length of the string. |
Definition at line 605 of file gravi_cpl.c.
Referenced by gravi_create_oiarray_table(), and gravi_create_oitarget_table().
| cpl_vector* gravi_vector_extract | ( | const cpl_vector * | vector, |
| int | start, | ||
| int | step | ||
| ) |
Extract part of a vector.
| vector | Input vector (size) |
| start | Starting index (0...size-1) |
| step | Step index, so the returned values are every step |
Definition at line 2261 of file gravi_cpl.c.
Referenced by gravi_compute_disp().
| cpl_size gravi_vector_get_maxpos | ( | cpl_vector * | vector | ) |
Return the index of maximum in a vector. If several indexes exists with the maximum value, the smallest index is returned.
| vector | Input vector (size) |
Definition at line 2179 of file gravi_cpl.c.
Referenced by gravi_compute_disp().
| double gravi_vector_get_mean_clip | ( | cpl_vector * | vector_in, |
| double | percent, | ||
| double | nsigma | ||
| ) |
Return the mean of a vector after extrema and RMS clipping.
| vector_in | input vector |
| percent | 0-1, fraction of extremes values rejected |
| nsigma | sigma clipping |
Definition at line 2207 of file gravi_cpl.c.
Referenced by gravi_data_detector_cleanup().
| cpl_error_code gravi_vector_unwrap_with_guess | ( | cpl_vector * | vector, |
| cpl_vector * | ref, | ||
| double | ref_to_phase | ||
| ) |
Unwrap a phase vector following a guess vector. The difference is actually unwrap and shall thus be slowly evolving. The operration if performed in-place.
| vector | to unwrap [rad] |
| ref | is the guess |
| ref_to_phase | is the coefficient to convert ref into [rad] |
Definition at line 2284 of file gravi_cpl.c.
Referenced by gravi_ellipse_meanopd_create(), and gravi_wave_fibre().
1.8.11