|
GRAVI Pipeline Reference Manual
1.2.3
|
Functions | |
| cpl_table * | gravi_table_ft_format (cpl_table *pix_table, cpl_table *skystd_table, cpl_table *skyavg_table, cpl_table *badft_table, int n_region, double gain) |
| Extract FT spectrum from PIX column. More... | |
| cpl_table * | gravi_imglist_sc_collapse (cpl_table *profile_table, cpl_imagelist *raw_imglist, cpl_imagelist *rawVar_imglist, cpl_size startx) |
| Extract the SC spectrum with profile. More... | |
| cpl_error_code | gravi_interpolate_spectrum_table (cpl_table *spectrum_table, cpl_table *wave_table, cpl_table **oiwave_tables, cpl_table *detector_table, cpl_table *specflat_table, const cpl_parameterlist *parlist, int type_data) |
| Re-interpolate in-place a spectrum table. More... | |
| int | gravi_pixel_is_good (cpl_image *bad_img, int x, int y) |
| Check if the pixel in the BADPIX map is a good pixel. More... | |
| cpl_error_code | gravi_remove_badpixel_sc (cpl_imagelist *imglist_sc, cpl_image *bad_img) |
| Remove the badpixel of the SC. More... | |
| gravi_data * | gravi_extract_spectrum (gravi_data *raw_data, gravi_data *profile_map, gravi_data *dark_map, gravi_data *bad_map, gravi_data *sky_map, const cpl_parameterlist *parlist, enum gravi_detector_type det_type) |
| Create the SPECTRUM gravi_data with extracted spectrum per region. More... | |
| cpl_error_code | gravi_subtract_met_dark (gravi_data *preproc_data, gravi_data *dark_map) |
| Substract metrology dark. More... | |
| cpl_error_code | gravi_align_spectrum (gravi_data *spectrum_data, gravi_data *wave_map, gravi_data *p2vm_map, enum gravi_detector_type det_type, const cpl_parameterlist *parlist) |
| Regrid the regions into a common wavelength (in-place) More... | |
This module implements the preprocessing of the data, which is mainly to convert raw data into spectra. The main function gravi_extract_spectrum() is used at several place in the pipeline. And the steps of the preprocessing are description in the sections :
| cpl_error_code gravi_align_spectrum | ( | gravi_data * | spectrum_data, |
| gravi_data * | wave_map, | ||
| gravi_data * | p2vm_map, | ||
| enum gravi_detector_type | det_type, | ||
| const cpl_parameterlist * | parlist | ||
| ) |
Regrid the regions into a common wavelength (in-place)
| spectrum_data | The SPECTRUM data to regrid |
| wave_map | The WAVE calibration map (current grid) |
| p2vm_map | or NULL The P2VM calibration map (target grid) |
| det_type | The 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. |
| parlist | Input parameter list (no parameter used). |
It re-samples the spectral element according to the wavelength calibration. The SPECTRUM are re-interpolated into the OI_WAVELENGTH of this P2VM map. The target wavelength are the one of the OI_WAVELENGTH from the P2VM map (assumed to be the same for both polarisation!!)
This is done in-place to save enormous time, especially on FT.
Definition at line 1358 of file gravi_preproc.c.
References gravi_data_copy_ext(), gravi_data_get_oiwave_tables(), gravi_data_get_table(), gravi_interpolate_spectrum_table(), and gravi_spectrum_get_flux().
| gravi_data* gravi_extract_spectrum | ( | gravi_data * | raw_data, |
| gravi_data * | profile_map, | ||
| gravi_data * | dark_map, | ||
| gravi_data * | bad_map, | ||
| gravi_data * | sky_map, | ||
| const cpl_parameterlist * | parlist, | ||
| enum gravi_detector_type | det_type | ||
| ) |
Create the SPECTRUM gravi_data with extracted spectrum per region.
| raw_data | Input RAW gravi_data |
| profile_data | FLAT calibration map, with profiles |
| dark_data | DARK calibration map |
| bad_map | BAD calibration map |
| sky_map | SKY calibration map |
| parlist | Input parameter list with :
|
| det_type | The detector to extract GRAVI_DET_SC, GRAVI_DET_FT or GRAVI_DET_ALL |
| CPL_ERROR_NULL_INPUT | input data is missing |
It substrates the dark map. It converts data into photoelectrons using the gain map and identify the bad pixels for a correction. Finally it extracts the spectra with the calibrated spatial profile (for SC data)
Definition at line 590 of file gravi_preproc.c.
References gravi_data_add_table(), gravi_data_copy_ext(), gravi_data_get_cube(), gravi_data_get_plist(), gravi_data_get_table(), gravi_data_new(), gravi_imagelist_get_flux(), gravi_imglist_sc_collapse(), gravi_pfits_add_check(), gravi_pfits_get_ft_gain(), gravi_pfits_get_sc_gain(), gravi_pfits_get_startx(), gravi_pfits_get_time_sc(), gravi_remove_badpixel_sc(), gravi_spectrum_get_flux(), and gravi_table_ft_format().
| cpl_table * gravi_imglist_sc_collapse | ( | cpl_table * | profile_table, |
| cpl_imagelist * | raw_imglist, | ||
| cpl_imagelist * | rawVar_imglist, | ||
| cpl_size | startx | ||
| ) |
Extract the SC spectrum with profile.
| profile_table | Input table containing the profile images |
| raw_imagelist | Input imagelist of raw data |
| rawVar_imagelist | Input imagelist of variance |
| startx | Input left location of profile in image |
Extract all the spectrum using the spectrum extraction method based on the optimal extraction algorithm (Horne, 1986). This algorithm is based on the knowledge of a spatial profile. Note the profile may not be optimal (ex: boxcard) but shall ensure flux-conservation from its normalization.
The profile table shall contains DATA# columns, each containing the image of the profile of this region. The return tables contains DATA# column with flux, and DATAERR# columns with errors (sqrt(variance)).
startx is the left start column of the profile in images, in FITS convention (1 for the first pixel).
Definition at line 436 of file gravi_preproc.c.
References gravi_imagelist_unwrap_images(), and gravi_imagelist_wrap_column().
Referenced by gravi_extract_spectrum().
| cpl_error_code gravi_interpolate_spectrum_table | ( | cpl_table * | spectrum_table, |
| cpl_table * | wave_table, | ||
| cpl_table ** | oiwave_tables, | ||
| cpl_table * | detector_table, | ||
| cpl_table * | specflat_table, | ||
| const cpl_parameterlist * | parlist, | ||
| int | type_data | ||
| ) |
Re-interpolate in-place a spectrum table.
| spectrum_table | The table to manipulate |
| wave_table | The input wave_table (one map per region) |
| oiwave_tables | The output OI_WAVEs table (same for all regions) |
| detector_rable | The input IMAGING DETECTOR table |
| specflat_table | The SPECTRUMFLAT, to allow unbiased effective wave |
| parlist | Input parameter list (no parameter used) |
All regions are re-interpolated into a common wavelength grid, defined by the oiwave_table (OIFITS format). The input wave_table contains the the initial wavelength grid of each region.
The wavelength bins in wave_table shall be monotonic incresing. All wavelength bins of oiwave_table shall be within the min/max of wave_table (not extrapolation is allowed).
Definition at line 920 of file gravi_preproc.c.
References gravi_region_get_pol().
Referenced by gravi_align_spectrum().
| int gravi_pixel_is_good | ( | cpl_image * | bad_img, |
| int | x, | ||
| int | y | ||
| ) |
Check if the pixel in the BADPIX map is a good pixel.
| bad_img | badpix as img |
| x | xpos |
| y | ypos |
Definition at line 99 of file gravi_preproc.c.
| cpl_error_code gravi_remove_badpixel_sc | ( | cpl_imagelist * | imglist_sc, |
| cpl_image * | bad_img | ||
| ) |
Remove the badpixel of the SC.
| imglist_sc | input data as imglist, remove inplace |
| bad_img | badpixel image |
The bad pixels of imglist_sc, identified by the map bad_img, are re-interpolated from neighboring values with a special care of the spatial / spectral directions since the spectra are almost 1D.
Definition at line 125 of file gravi_preproc.c.
Referenced by gravi_compute_profile(), and gravi_extract_spectrum().
| cpl_error_code gravi_subtract_met_dark | ( | gravi_data * | preproc_data, |
| gravi_data * | dark_map | ||
| ) |
Substract metrology dark.
| preproc_data | The table to manipulate |
| dark_data | DARK calibration map |
If Metrology dark is present, subtract DARK to METROLOGY data
Definition at line 860 of file gravi_preproc.c.
References gravi_data_get_table(), and gravi_data_has_extension().
| cpl_table * gravi_table_ft_format | ( | cpl_table * | pix_table, |
| cpl_table * | skystd_table, | ||
| cpl_table * | skyavg_table, | ||
| cpl_table * | badft_table, | ||
| int | n_region, | ||
| double | gain | ||
| ) |
Extract FT spectrum from PIX column.
| pix_table | Input raw data [adu] |
| skystd_table | Input SKY std data [adu] |
| skyavg_table | Input SKY avg data [adu] |
| n_region | Number of regions to descramble |
| gain | Conversion gain in [ADU/e] |
The TIME column is duplicated in output. The pixels from the PIX column are descrambled into DATA# = (RAW-SKY)/gain DATAERR# = sqrt (max(DATA#,0) + (SKYSTD/gain)^2)
Definition at line 271 of file gravi_preproc.c.
Referenced by gravi_extract_spectrum().
1.8.11