|
GRAVI Pipeline Reference Manual
1.2.3
|
Functions | |
| cpl_error_code | gravi_fit_profile (cpl_vector *values_x0, cpl_vector *values_y0, cpl_vector *values_sigma, cpl_image *mean_img, int ref_x, int ref_y, int size_profile, const char *resolution) |
| Fit the profile parameters in an image. More... | |
| cpl_image * | gravi_create_profile_image (cpl_image *mean_img, cpl_vector *values_x0, cpl_vector *values_y0, cpl_vector *values_sigma, cpl_size iy_min, cpl_size iy_max, const char *mode) |
| Create the profile image from image and/or fitted params. More... | |
| gravi_data * | gravi_compute_dark (gravi_data *raw_data) |
| Compute the DARK calibration map. More... | |
| gravi_data * | gravi_average_dark (gravi_data **data, cpl_size ndata) |
| Average several DARK calibration map. More... | |
| gravi_data * | gravi_compute_profile (gravi_data **flats_data, gravi_data *dark_map, gravi_data *bad_map, int nflat, const cpl_parameterlist *params) |
| Computes the spatial profile of each spectrum for optimal extraction purpose. More... | |
| cpl_propertylist * | gravi_compute_gain (gravi_data **flats_data, int nrawgain, gravi_data *dark_map) |
| Compute mean detector gain. More... | |
| gravi_data * | gravi_compute_badpix (gravi_data *dark_map, gravi_data **flats_data, int nflat, const cpl_parameterlist *params) |
| Identify the bad pixels in the DARK map and create the BAD map. More... | |
| gravi_data * | gravi_compute_biasmask (gravi_data *dark_map, gravi_data **flats_data, int nflat, const cpl_parameterlist *params) |
| Create BIASMASK for SC from raw FLATs and raw DARK. More... | |
| gravi_data * | gravi_compute_piezotf (gravi_data *data, const cpl_parameterlist *params) |
| Create piezo transfer function for Kalman Calibration & monitoring. More... | |
This module contains the functions that are used to calibrate the detector. These functions characterize the pixels of the detectors. They are call by the recipe gravity_dark or gravity_p2vm.
gravi_compute_dark(), gravi_average_dark() gravi_compute_profile(), gravi_fit_profile(), gravi_create_profile_image() gravi_compute_gain() gravi_compute_badpix() | gravi_data* gravi_average_dark | ( | gravi_data ** | data, |
| cpl_size | ndata | ||
| ) |
Average several DARK calibration map.
| data | List of input DARK map |
| ndata | Number of DARK in the list |
| CPL_ERROR_NULL_INPUT | no data as input |
Definition at line 440 of file gravi_calib.c.
References gravi_data_duplicate(), and gravi_data_get_table().
| gravi_data* gravi_compute_badpix | ( | gravi_data * | dark_map, |
| gravi_data ** | flats_data, | ||
| int | nflat, | ||
| const cpl_parameterlist * | params | ||
| ) |
Identify the bad pixels in the DARK map and create the BAD map.
| dark_map | The input dark map calibration |
| flats_data | The input raw flats (optional) |
| nflat | The number of input flats (shall be 4) |
| params | Input parameter list with :
|
| CPL_ERROR_NULL_INPUT | input data is missing |
| CPL_ERROR_ILLEGAL_INPUT | The number of input flats is not 4 |
Pixel with dark value or read-out-noise out of a specified range are declared as bad pixels.
If the flats_data are provided, they are collapsed together. Pixel with mean flat value lower than a horizontal median filtering are declared as bad pixels. Only pixel with a mean flat value higher than 100 adu are inspected. The mask of inspected pixels is saved in IMAGING_MASK_SC. This can be applied with normal or defocused FLATs. Still to be validated in LOW.
FIXME: in term of implementation, this function is weird as some of the computation are somehow done in-place after duplication of the data...
Definition at line 1760 of file gravi_calib.c.
References gravi_data_add_img(), gravi_data_add_table(), gravi_data_copy_ext(), gravi_data_get_cube(), gravi_data_get_table(), gravi_data_has_extension(), gravi_data_new(), and gravi_image_get_quantile().
| gravi_data* gravi_compute_biasmask | ( | gravi_data * | dark_map, |
| gravi_data ** | flats_data, | ||
| int | nflat, | ||
| const cpl_parameterlist * | params | ||
| ) |
Create BIASMASK for SC from raw FLATs and raw DARK.
| dark_map | The input dark map calibration |
| flats_data | The input raw flats (optional) |
| nflat | The number of input flats (shall be 4) |
| params | The parameter list (no parameter used) |
| CPL_ERROR_NULL_INPUT | input data is missing |
| CPL_ERROR_ILLEGAL_INPUT | The number of input flats is not 4 |
Pixel with values lower than 100 adu in the collapsed FLAT are flag with 1 in the BIASMASK, while illuminated pixels (>100adu) are flag with 0 in BIASMASK.
FIXME: improve the way we define the threshold. Use an 'ouverture' filtering maybe.
Definition at line 2121 of file gravi_calib.c.
References gravi_data_add_img(), gravi_data_copy_ext(), gravi_data_get_cube(), gravi_data_new(), and gravi_image_get_quantile().
| gravi_data* gravi_compute_dark | ( | gravi_data * | raw_data | ) |
Compute the DARK calibration map.
| raw_data | The input raw dark |
| CPL_ERROR_NULL_INPUT | no raw_data as input |
The dark image of the SC is a saved as full image of the mean dark value and mean dark standard deviation (RON). The dark for the FT is saved into PIX array of the mean and dark standard deviation (RON). And the dark of the metrology is save into the METOLOGY table.
Definition at line 122 of file gravi_calib.c.
References gravi_array_wrap_image(), gravi_data_add_img(), gravi_data_add_table(), gravi_data_copy_ext(), gravi_data_get_cube(), gravi_data_get_plist(), gravi_data_get_table(), gravi_data_has_extension(), gravi_data_new(), gravi_imagelist_unwrap_images(), gravi_imagelist_wrap_column(), and gravi_pfits_add_check().
| cpl_propertylist* gravi_compute_gain | ( | gravi_data ** | flats_data, |
| int | nrawgain, | ||
| gravi_data * | dark_map | ||
| ) |
Compute mean detector gain.
| flats_data | The input raw FLAT data, one per beam |
| nrawgain | 4 |
| dark_map | The input DARK calibration map |
| CPL_ERROR_NULL_INPUT | input data is missing |
| CPL_ERROR_ILLEGAL_INPUT | not all shutter are opened |
It returs a propertylist with the QC value of the mean SC and mean FT gain, in [ADU/e].
Definition at line 1505 of file gravi_calib.c.
References gravi_data_get_cube(), gravi_data_get_table(), gravi_data_has_extension(), gravi_image_from_column(), and gravi_imagelist_from_column().
| gravi_data* gravi_compute_piezotf | ( | gravi_data * | data, |
| const cpl_parameterlist * | params | ||
| ) |
Create piezo transfer function for Kalman Calibration & monitoring.
| data | The input raw data |
| params | The parameter list (no parameter used) |
| CPL_ERROR_NULL_INPUT | input data is missing |
1- Read the piezo commands (in volts) from the OPDC table 2- Read the OPD measured by the fringe tracker (in radians) 3- Using an SVD inversion, get the 20 parameters of the transfer function: OPD(n)=a_i*piezo(n-1)+b_i*piezo(n-2)+c_i*piezo(n-3)+d_i*piezo(n-4)+e_i*piezo(n-5) where i is the piezo number (between 1 and 4), and a,b,c,d,e the 5 values of the autoregressive function of degree 5 (AR5). 4- Compute and store the QC parameters: residual errors, delay, gain, etc...
Definition at line 2226 of file gravi_calib.c.
References gravi_data_copy_ext(), gravi_data_get_table(), and gravi_data_new().
| gravi_data* gravi_compute_profile | ( | gravi_data ** | flats_data, |
| gravi_data * | dark_map, | ||
| gravi_data * | bad_map, | ||
| int | nflat, | ||
| const cpl_parameterlist * | params | ||
| ) |
Computes the spatial profile of each spectrum for optimal extraction purpose.
| flats_data | The FLAT_RAW datas |
| dark_map | The DARK calibration map |
| bad_map | BAD calibration map |
| nflat | The number of FLAT file inputs |
| params | Input parameter list with :
|
| CPL_ERROR_NULL_INPUT | input data is missing |
| CPL_ERROR_ILLEGAL_INPUT | not all shutter are opened or profile_width option not > 0 or missing table in the input data |
For each region defined in the IMAGING_DETECTOR_SC table this function retrieves the profile of the spectrum passing by the reference point defined in the table IMAGING_DETECTOR_SC. The FT data have no profile.
Definition at line 976 of file gravi_calib.c.
References gravi_array_wrap_image(), gravi_create_profile_image(), gravi_data_add_img(), gravi_data_add_table(), gravi_data_copy_ext(), gravi_data_get_cube(), gravi_data_get_table(), gravi_data_has_extension(), gravi_data_new(), gravi_fit_profile(), gravi_image_extract_dimension(), gravi_image_from_column(), gravi_imagelist_unwrap_images(), gravi_imagelist_wrap_column(), gravi_region_get_tel(), and gravi_remove_badpixel_sc().
| cpl_image * gravi_create_profile_image | ( | cpl_image * | mean_img, |
| cpl_vector * | values_x0, | ||
| cpl_vector * | values_y0, | ||
| cpl_vector * | values_sigma, | ||
| cpl_size | iy_min, | ||
| cpl_size | iy_max, | ||
| const char * | mode | ||
| ) |
Create the profile image from image and/or fitted params.
| mean_img | Input image (nx,ny) |
| values_x0 | Input vector of spectral channels (0..nx-1) |
| values_y0 | Input vector of profile center in spatial direction |
| values_sigma | Input vector of profile width in spatial direction |
| iy_min | Min coordinate where to fill the profile (0..ny-1) |
| iy_max | Max coordinate where to fill the profile (0..ny-1) |
| mode | "BOX", "PROFILE", "GAUSS" |
| CPL_ERROR_NULL_INPUT | input data is missing |
| CPL_ERROR_ILLEGAL_INPUT | iy_min or iy_max are outside boundaries |
The vectors values_x0, values_y0, values_sigma are first smoothed (duplicated) with a polynomial interpolation before being used. The image of the profile is built either from mean_img (LOW, MED) or is a boxcard of 5 pixels (HIGH).
Definition at line 797 of file gravi_calib.c.
Referenced by gravi_compute_profile().
| cpl_error_code gravi_fit_profile | ( | cpl_vector * | values_x0, |
| cpl_vector * | values_y0, | ||
| cpl_vector * | values_sigma, | ||
| cpl_image * | mean_img, | ||
| int | ref_x, | ||
| int | ref_y, | ||
| int | size_profile, | ||
| const char * | resolution | ||
| ) |
Fit the profile parameters in an image.
| values_x0 | Output vector of spectral channels (0..nx-1) |
| values_y0 | Output vector of profile center in spatial direction |
| values_sigma | Output vector of profile width in spatial direction |
| mean_img | Input image (nx,ny) |
| ref_x,ref_y | Coordinate of a known pixel inside the spectra |
| size_profile | Spatial extend of the data to extract and fit |
| resolution | Spectral resolution (LOW, MED, HIGH) |
| CPL_ERROR_NULL_INPUT | input data is missing |
| CPL_ERROR_ILLEGAL_INPUT | ref_x or ref_y are outside boundaries |
values_x0, values_y0, values_sigma are of size nx and unit [pixel] in the FITS convention (1..nx). The function starts to fit the profile toward the right from ref_x, then toward the left from ref_x. In resolution HIGH, the ref_y is updated at each spectral channel to follow the curvature when extracting the data.
Definition at line 519 of file gravi_calib.c.
Referenced by gravi_compute_profile().
1.8.11