|
GRAVI Pipeline Reference Manual 1.9.0
|
Macros | |
| #define | INFO_DEBUG 0 |
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. | |
| 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. | |
| gravi_data * | gravi_compute_dark (gravi_data *raw_data) |
| Compute the DARK calibration map. | |
| gravi_data * | gravi_average_dark (gravi_data **data, cpl_size ndata) |
| Average several DARK calibration map. | |
| 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. | |
| cpl_propertylist * | gravi_compute_gain (gravi_data **flats_data, int nrawgain, gravi_data *dark_map) |
| Compute mean detector gain. | |
| 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. | |
| 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. | |
| gravi_data * | gravi_compute_piezotf (gravi_data *data, const cpl_parameterlist *params) |
| Create piezo transfer function for Kalman Calibration & monitoring. | |
| cpl_error_code | gravi_remove_cosmicrays_sc (cpl_imagelist *imglist_sc) |
| Remove cosmic rays via filtering through images. | |
| cpl_array * | gravi_filter_array_median (const cpl_array *arr, int size) |
| Apply median filter on 1-D array. | |
| double | gravi_calc_sigmaclipped_stddev (const cpl_array *arr, double nstd) |
| Perform sigma-clipping on input array and return std of clipped array. | |
| gravi_data * | gravi_compute_pca (gravi_data **data, int naccept, const cpl_parameterlist *params) |
| Fit model for visphi flattening using PCA. | |
| cpl_error_code | gravi_flatten_vis (gravi_data *vis_data, gravi_data *calib_data) |
| Use PCA model to flatten observed visphi. The flattened data are added to the existing VIS table. | |
Variables | |
| static double | met_Sep_2016 [64] = {-0.000338233 ,-0.000282107 ,0.000345582 ,0.000381979 ,0.000326764 ,-0.000225664 ,5.35555e-05 ,0.00060938 ,-0.000205619 ,-0.000265577 ,0.00017356 ,0.000265687 ,0.000295987 ,3.05255e-05 ,-0.000498407 ,0.000232075 ,0.00502058 ,0.002045925 ,-0.000110657 ,-0.000403592 ,-0.000065043 ,-0.000433645 ,-0.000626545 ,3.29765e-05 ,-0.001694525 ,-0.0011684 ,6.2795e-06 ,-0.001584115 ,-0.000735553 ,-0.000868538 ,-0.000985087 ,-0.0008204 ,0.000768577 ,0.000848342 ,-0.000134943 ,-0.000385157 ,-8.68822e-05 ,-0.000757366 ,0.000446051 ,-0.000231723 ,0.000790425 ,-0.000638897 ,0.000503496 ,-7.78205e-05 ,0.000287366 ,0.000243789 ,0.000083288 ,-0.000125138 ,-0.000147337 ,4.14224e-05 ,0.000123082 ,-0.00117179 ,4.54785e-05 ,-0.000186707 ,0.000682836 ,0.00090649 ,0.000357256 ,-0.002133845 ,-0.00151895 ,-0.00150048 ,-0.00266423 ,-0.0030716 ,0.000599228 ,-0.001078583} |
| static double | met_Mar_2017 [64] = {0.000481474 ,0.000678173 ,0.00022232 ,9.04735e-05 ,0.001030283 ,0.000400478 ,0.000199579 ,0.000610902 ,0.000870061 ,0.001148845 ,0.000706636 ,0.000491999 ,0.00093158 ,0.001224225 ,0.000652115 ,0.001117025 ,0.00481452 ,0.002359475 ,0.000641491 ,0.000126103 ,0.000158341 ,0.001455785 ,0.000227113 ,0.000366087 ,-0.000372672 ,-0.000814455 ,0.000403834 ,-0.00072791 ,-0.000422227 ,0.000413887 ,-0.000024651 ,0.000106683 ,0.00092596 ,0.000327427 ,0.000775269 ,0.000906505 ,0.000108337 ,-0.000214467 ,0.001249965 ,0.000694693 ,0.000718101 ,0.00083926 ,0.00138818 ,0.00131215 ,0.001113065 ,0.00134113 ,0.000972572 ,0.00073247 ,-3.35943e-05 ,0.000312545 ,0.000365923 ,0.000510906 ,0.000955084 ,0.000808904 ,0.000403238 ,-0.000150186 ,0.000200673 ,-0.00078668 ,-0.00078133 ,-0.00039955 ,-0.00226333 ,-0.00177287 ,0.000435995 ,-0.000397403} |
| static double | met_Jun_2017 [64] = {0.00029923 ,5.42185e-05 ,-0.000023823 ,0.000187444 ,0.000650675 ,0.000135629 ,-0.000047364 ,0.000479489 ,0.000463565 ,0.000536066 ,0.000528847 ,0.000874895 ,0.000702853 ,0.000438988 ,0.000183642 ,0.000536044 ,0.004829985 ,0.00215068 ,5.94134e-05 ,-0.000164468 ,-4.89301e-05 ,0.000400028 ,-0.000277333 ,-0.000169422 ,-0.00136967 ,-0.000998661 ,0.000244959 ,-0.00123726 ,-0.000404182 ,-0.000511517 ,-0.000398515 ,-0.000314167 ,0.000546602 ,0.000547136 ,0.000388259 ,0.000108443 ,-0.000266431 ,-0.000734324 ,0.000946866 ,0.0001005 ,0.000739434 ,0.000530113 ,0.000821013 ,0.000748435 ,0.00094666 ,0.00102861 ,-0.00013052 ,0.000576223 ,-0.000657692 ,-0.000293389 ,0.000146337 ,-0.000338176 ,0.000241386 ,0.00005168 ,0.000495891 ,-1.76273e-05 ,8.84135e-05 ,-0.00153857 ,-0.000850848 ,-0.000986058 ,-0.002700175 ,-0.002620785 ,0.000440797 ,-0.00063843} |
| static double | met_Jul_2017 [64] = {8.19405e-05 ,-0.000061716 ,0.000067827 ,0.000234624 ,0.000521161 ,0.000031451 ,0.000211139 ,0.000578157 ,0.000316435 ,0.000431433 ,0.000431228 ,0.000761259 ,0.000576742 ,0.000299923 ,0.00034315 ,0.000561323 ,0.004834095 ,0.00208259 ,-0.000155192 ,-0.000120373 ,-0.000328756 ,0.000265791 ,-0.000249398 ,-0.000310416 ,-0.001047503 ,-0.000884526 ,0.000431645 ,-0.000890023 ,-0.000330709 ,-0.000540866 ,-0.0002067 ,-0.000334498 ,0.00035945 ,0.000683828 ,0.000464533 ,0.000166613 ,-0.000276387 ,-0.00088093 ,0.001283446 ,0.00016521 ,0.000578248 ,0.000334565 ,0.000762716 ,0.000521964 ,0.000757276 ,0.000959739 ,0.000035001 ,0.000442429 ,-0.0006928 ,-0.000105863 ,-0.00006137 ,-0.000454825 ,-0.000157343 ,-5.68635e-05 ,0.000296553 ,-3.80711e-05 ,0.000384616 ,-0.00149983 ,-0.000650183 ,-0.00076473 ,-0.002494945 ,-0.00246317 ,0.000794264 ,-0.000337915} |
| static double | met_Aug_2017 [64] = {0.000225917 ,0.00033629 ,1.70956e-05 ,0.000178987 ,0.00103744 ,0.000275415 ,0.000107582 ,0.000678724 ,0.000402821 ,0.000713535 ,0.000518528 ,0.000607008 ,0.000506748 ,0.000640514 ,0.000300349 ,0.000522693 ,0.005585285 ,0.00305222 ,0.000771553 ,0.001006485 ,0.000618719 ,0.00130769 ,0.000419028 ,0.000491215 ,-0.000815277 ,-0.000646205 ,0.000640702 ,-0.000881775 ,-0.000200994 ,-0.000258582 ,-0.000465663 ,-0.00004838 ,0.000591627 ,0.000615608 ,0.000197913 ,0.000352664 ,-0.000113565 ,-0.000637229 ,0.001241975 ,-6.659e-06 ,0.000649339 ,0.000641595 ,0.000673658 ,0.000657426 ,0.001263897 ,0.001258565 ,0.000050901 ,0.000318844 ,-9.23866e-05 ,0.00065074 ,0.000793493 ,0.000600095 ,0.001049984 ,0.000858337 ,0.000786737 ,0.000737051 ,0.000576774 ,-0.001384295 ,-0.000642989 ,-0.0008569 ,-0.00208747 ,-0.00247888 ,0.00108834 ,-0.000190064} |
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_compute_pca() | #define INFO_DEBUG 0 |
Definition at line 47 of file gravi_calib.c.
| 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 457 of file gravi_calib.c.
References cpl_msg_info(), CPLCHECK_NUL, gravi_data_duplicate(), gravi_data_get_img, gravi_data_get_table(), GRAVI_IMAGING_DATA_FT_EXT, GRAVI_IMAGING_DATA_SC_EXT, GRAVI_IMAGING_ERR_FT_EXT, GRAVI_IMAGING_ERR_SC_EXT, gravi_msg_function_exit, gravi_msg_function_start, and gravi_msg_warning().
Referenced by gravity_vis().
| double gravi_calc_sigmaclipped_stddev | ( | const cpl_array * | arr, |
| double | nstd | ||
| ) |
Perform sigma-clipping on input array and return std of clipped array.
| arr | Array to operate on. |
| nstd | Number of standard deviations to clip beyond. |
Definition at line 2891 of file gravi_calib.c.
Referenced by gravi_compute_pca().
| 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 1806 of file gravi_calib.c.
References BADPIX_DARK, BADPIX_FLAT, BADPIX_RMS, cpl_image_delete(), cpl_msg_info(), CPLCHECK_NUL, FREE, gravi_data_add_img(), gravi_data_add_table(), gravi_data_copy_ext(), gravi_data_get_cube(), gravi_data_get_header, gravi_data_get_img, gravi_data_get_table(), gravi_data_has_extension(), gravi_data_new(), gravi_image_get_quantile(), GRAVI_IMAGING_DATA_ACQ_EXT, GRAVI_IMAGING_DATA_FT_EXT, GRAVI_IMAGING_DATA_SC_EXT, GRAVI_IMAGING_DETECTOR_FT_EXT, GRAVI_IMAGING_DETECTOR_SC_EXT, GRAVI_IMAGING_ERR_FT_EXT, GRAVI_IMAGING_ERR_SC_EXT, GRAVI_IMAGING_MASK_SC_EXT, gravi_msg_function_exit, gravi_msg_function_start, gravi_param_get_bool(), gravi_param_get_int(), QC_BADPIX_DARK_SC, QC_BADPIX_FLAT_SC, QC_BADPIX_FT, QC_BADPIX_RMS_SC, QC_BADPIX_SC, QC_DARKRMS_FT, QC_DARKRMS_SC, and QC_MEANDARK_FT.
Referenced by gravity_badpix(), and gravity_p2vm().
| 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 2271 of file gravi_calib.c.
References cpl_image_delete(), cpl_msg_info(), CPLCHECK_NUL, FREE, GRAVI_BIAS_MASK_SC_EXT, gravi_data_add_img(), gravi_data_copy_ext(), gravi_data_get_cube(), gravi_data_get_header, gravi_data_get_img, gravi_data_new(), gravi_image_get_quantile(), GRAVI_IMAGING_DATA_SC_EXT, GRAVI_IMAGING_DETECTOR_SC_EXT, gravi_msg_function_exit, and gravi_msg_function_start.
Referenced by gravity_biasmask().
| 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 METROLOGY table.
Definition at line 125 of file gravi_calib.c.
References cpl_image_delete(), cpl_msg_info(), cpl_propertylist_update_double(), CPLCHECK_NUL, FREE, gravi_array_wrap_image(), gravi_data_add_img(), gravi_data_add_table(), gravi_data_check_shutter_closed, gravi_data_check_shutter_open, gravi_data_copy_ext(), gravi_data_get_cube(), gravi_data_get_header, gravi_data_get_plist(), gravi_data_get_table(), gravi_data_has_extension(), gravi_data_new(), gravi_imagelist_unwrap_images(), gravi_imagelist_wrap_column(), GRAVI_IMAGING_DATA_ACQ_EXT, GRAVI_IMAGING_DATA_FT_EXT, GRAVI_IMAGING_DATA_SC_EXT, GRAVI_IMAGING_DETECTOR_FT_EXT, GRAVI_IMAGING_DETECTOR_SC_EXT, GRAVI_IMAGING_ERR_FT_EXT, GRAVI_IMAGING_ERR_SC_EXT, GRAVI_METROLOGY_ERR_EXT, GRAVI_METROLOGY_EXT, gravi_msg_function_exit, gravi_msg_function_start, gravi_pfits_add_check(), gravi_pfits_get_dpr_type(), met_Aug_2017, met_Jul_2017, met_Jun_2017, met_Mar_2017, met_Sep_2016, QC_ACQ_ZERO_NB, QC_DARKRANGE_MET, QC_DARKRMS_FT, QC_DARKRMS_MET, QC_DARKRMS_SC, QC_MEANDARK_FT, QC_MEANDARK_MET, QC_MEANDARK_SC, QC_MEANSKY_FT, QC_MEANSKY_SC, QC_SKYRMS_FT, and QC_SKYRMS_SC.
Referenced by gravity_badpix(), gravity_biasmask(), gravity_dark(), gravity_disp(), gravity_p2vm(), gravity_vis(), and gravity_wavelamp().
| 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 1551 of file gravi_calib.c.
References cpl_image_delete(), cpl_msg_info(), CPLCHECK_NUL, FREE, gravi_check_shutter(), gravi_data_check_shutter_beam(), gravi_data_get_cube(), gravi_data_get_header, gravi_data_get_img, gravi_data_get_table(), gravi_data_has_extension(), gravi_image_from_column(), gravi_imagelist_from_column(), GRAVI_IMAGING_DATA_FT_EXT, GRAVI_IMAGING_DATA_SC_EXT, gravi_msg_function_exit, gravi_msg_function_start, QC_MEANGAIN_FT, and QC_MEANGAIN_SC.
Referenced by gravity_p2vm().
| gravi_data * gravi_compute_pca | ( | gravi_data ** | data, |
| int | naccept, | ||
| const cpl_parameterlist * | params | ||
| ) |
Fit model for visphi flattening using PCA.
| data | The input data to generate calibration from |
| naccept | Length of data (number of accepted frames) |
| params | Input parameter list with :
|
| CPL_ERROR_NULL_INPUT | input data or parameters are missing |
| CPL_ERROR_DATA_NOT_FOUND | no valid input data provided |
Definition at line 2945 of file gravi_calib.c.
References CPLCHECK_NUL, FREE, gravi_calc_sigmaclipped_stddev(), gravi_data_add_table(), gravi_data_get_header, gravi_data_get_oi_vis, gravi_data_get_oi_wave, gravi_data_get_oi_wave_plist, gravi_data_new(), gravi_filter_array_median(), gravi_msg_function_exit, gravi_msg_function_start, GRAVI_NBASE, gravi_pca_create_model(), gravi_pca_create_result(), gravi_pca_decomp_matrix_svd(), GRAVI_PCA_EXT, gravi_pca_fit_components_bspline(), gravi_pca_fit_components_polynomial(), gravi_pca_fit_model(), gravi_pca_get_component(), gravi_pca_get_component_fit(), gravi_pca_get_component_median(), gravi_pca_get_data_residual(), gravi_pca_model_delete(), gravi_pca_refine_mean(), GRAVI_PCA_RESID_EXT, gravi_pca_result_delete(), gravi_pca_set_component_signs(), gravi_pfits_get_pola_mode(), gravi_pfits_get_pola_num(), gravi_pfits_get_spec_res(), GRAVI_SC, and header.
Referenced by gravity_pcacal().
| 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 2376 of file gravi_calib.c.
References cpl_msg_info(), cpl_propertylist_update_double(), CPLCHECK_NUL, gravi_data_copy_ext(), gravi_data_get_header, gravi_data_get_table(), gravi_data_new(), gravi_msg_function_exit, gravi_msg_function_start, GRAVI_NBASE, GRAVI_OPDC_EXT, and ntel.
Referenced by gravity_piezo().
| 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. Each of the flats has the shutter of only one telescope open |
| 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 994 of file gravi_calib.c.
References cpl_image_delete(), cpl_image_multiply(), cpl_msg_info(), CPLCHECK_NUL, FREE, FREELOOP, gravi_array_wrap_image(), gravi_create_profile_image(), GRAVI_DATA, gravi_data_add_img(), gravi_data_add_table(), gravi_data_check_shutter_beam(), gravi_data_copy_ext(), gravi_data_get_cube(), gravi_data_get_header, gravi_data_get_img, gravi_data_get_table(), gravi_data_has_extension(), gravi_data_new(), gravi_fit_profile(), gravi_get_shutter_id(), gravi_image_extract_dimension(), gravi_image_from_column(), gravi_imagelist_unwrap_images(), gravi_imagelist_wrap_column(), GRAVI_IMAGING_DATA_FT_EXT, GRAVI_IMAGING_DATA_SC_EXT, GRAVI_IMAGING_DETECTOR_FT_EXT, GRAVI_IMAGING_DETECTOR_SC_EXT, gravi_msg_function_exit, gravi_msg_function_start, gravi_param_get_bool(), gravi_param_get_int(), gravi_param_get_string_default(), gravi_pfits_get_pola_mode(), gravi_pfits_get_resolution(), gravi_pfits_get_window_start(), GRAVI_PROFILE_DATA_EXT, GRAVI_PROFILE_PARAMS_EXT, gravi_region_get_tel(), gravi_remove_badpixel_sc(), GRAVI_SC, gravi_table_get_value, PROFILE_FULLSTARTX, PROFILE_NX, PROFILE_STARTX, and QC_DARKRMS_SC.
Referenced by gravity_p2vm().
| 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 814 of file gravi_calib.c.
References cpl_msg_info(), CPLCHECK_NUL, FREE, gravi_msg_function_exit, and gravi_msg_function_start.
Referenced by gravi_compute_profile().
| cpl_array * gravi_filter_array_median | ( | const cpl_array * | arr, |
| int | size | ||
| ) |
Apply median filter on 1-D array.
| arr | Array to filter. |
| size | Window size for filter. |
Definition at line 2862 of file gravi_calib.c.
Referenced by gravi_compute_pca().
| 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 536 of file gravi_calib.c.
References CPLCHECK_MSG, FREE, gravi_msg_function_exit, and gravi_msg_function_start.
Referenced by gravi_compute_profile().
| cpl_error_code gravi_flatten_vis | ( | gravi_data * | vis_data, |
| gravi_data * | calib_data | ||
| ) |
Use PCA model to flatten observed visphi. The flattened data are added to the existing VIS table.
| data | The visphi data to flatten |
| pca_calib | The PCA calibration to use |
| CPL_ERROR_NULL_INPUT | input data or parameters are missing |
| CPL_ERROR_DATA_NOT_FOUND | no valid input data provided |
gravi_pca_result object that is used when generating the calibration. This is just so that the fitting routine can also be reused: no further decomposition is done here.Definition at line 3279 of file gravi_calib.c.
References CPLCHECK_MSG, FREE, FREELOOP, gravi_data_get_header, gravi_data_get_oi_vis, gravi_data_get_oi_wave_plist, gravi_data_get_plist(), gravi_data_get_table(), gravi_msg_function_exit, gravi_msg_function_start, GRAVI_NBASE, gravi_pca_create_result(), GRAVI_PCA_EXT, gravi_pca_fit_model(), gravi_pca_get_data_fit(), gravi_pca_get_data_residual(), gravi_pca_load_model(), gravi_pca_model_delete(), gravi_pca_result_delete(), gravi_pfits_get_pola_mode(), gravi_pfits_get_pola_num(), gravi_pfits_get_spec_res(), and GRAVI_SC.
Referenced by gravity_vis(), and gravity_vis_from_p2vmred().
| cpl_error_code gravi_remove_cosmicrays_sc | ( | cpl_imagelist * | imglist_sc | ) |
Remove cosmic rays via filtering through images.
| imglist_sc | input data as imglist, remove inplace |
IMPORTANT: Use this function AFTER bad pixel removal. Cosmic ray hits are identified as outliers when they are more than 5 times the median absolute deviation from the median computed across the list of images. This is evaluated on a pixel-by-pixel basis. CR pixels are interpolated along the row of an image.
Definition at line 2661 of file gravi_calib.c.
References cpl_msg_info(), CPLCHECK_MSG, FREE, gravi_msg_function_exit, gravi_msg_function_start, and IMAGE_IDX.
Referenced by gravi_data_detector_cleanup().
|
static |
Definition at line 83 of file gravi_calib.c.
Referenced by gravi_compute_dark().
|
static |
Definition at line 82 of file gravi_calib.c.
Referenced by gravi_compute_dark().
|
static |
Definition at line 81 of file gravi_calib.c.
Referenced by gravi_compute_dark().
|
static |
Definition at line 80 of file gravi_calib.c.
Referenced by gravi_compute_dark().
|
static |
Definition at line 79 of file gravi_calib.c.
Referenced by gravi_compute_dark().