|
GRAVI Pipeline Reference Manual 1.7.2
|
Data Structures | |
| struct | _gravi_data_ |
Macros | |
| #define | GRAVI_DATA_SIZE 30 |
Functions | |
| int | gravi_data_is_oi_ext (cpl_propertylist *hdr) |
| Check if EXTNAME starts with 'OI_' (OIFITS extension) | |
| cpl_error_code | gravi_data_check_savetypes (cpl_propertylist *hdr, cpl_table *oi_table) |
| Set the savetypes of the OIFITS table. | |
| int | gravi_data_get_dark_pos (cpl_table *detector_table, int reg) |
| retrun the position of the dark line on top of the region at x position | |
| cpl_mask * | gravi_data_create_bias_mask (cpl_table *detector_table, cpl_size nx, cpl_size ny) |
| return a mask with pixel to be possibly illuminated | |
| cpl_error_code | gravi_remove_cosmicrays_sc (cpl_imagelist *imglist_sc) |
| Remove cosmic rays via filtering through images. | |
| gravi_data * | gravi_data_new (int nb_ext) |
| Create an empty gravi_data. | |
| void | gravi_data_delete (gravi_data *self) |
| Delete a gravi data. | |
| gravi_data * | gravi_data_duplicate (const gravi_data *self) |
| Create a copy of the gravi data. | |
| cpl_error_code | gravi_data_append (gravi_data *first, const gravi_data *second, int force) |
| Append a gravi_data into another existing one. | |
| gravi_data * | gravi_data_load (const char *filename) |
| Low-level function to load FITS file. | |
| gravi_data * | gravi_data_load_ext (const char *filename, const char *extensions_regexp) |
| Low-level function to load FITS file. | |
| cpl_error_code | gravi_data_dump_mode (gravi_data *data) |
| Dump some information about data in messagin. | |
| gravi_data * | gravi_data_load_frame (cpl_frame *frame, cpl_frameset *used_frameset) |
| Load a FITS file and create a gravi_data. | |
| int | gravi_data_patch (gravi_data *file_to_patch, cpl_frameset *patch_frameset) |
| Load a RAW FITS file and create a gravi_data. | |
| gravi_data * | gravi_data_load_rawframe (cpl_frame *frame, cpl_frameset *used_frameset) |
| Load a RAW FITS file and create a gravi_data. | |
| gravi_data * | gravi_data_load_rawframe_ext (cpl_frame *frame, cpl_frameset *used_frameset, const char *extensions_regexp) |
| Load a RAW FITS file and create a gravi_data from specified extensions. | |
| cpl_error_code | gravi_data_dump (gravi_data *self) |
| Dump the overall structure of a gravi_data in stdout. | |
| int | gravi_data_get_size (const gravi_data *self) |
| Get the number of extension in a gravi_data. | |
| cpl_error_code | gravi_data_save_data (gravi_data *self, const char *filename, unsigned mode) |
| Save a gravi data in a FITS file. | |
| cpl_error_code | gravi_data_save_new (gravi_data *self, cpl_frameset *allframes, const char *filename, const char *suffix, const cpl_parameterlist *parlist, cpl_frameset *usedframes, cpl_frame *frame, const char *recipe, cpl_propertylist *applist, const char *proCatg) |
| Save a gravi data in a CPL-complian FITS file. | |
| cpl_error_code | gravi_data_detector_cleanup (gravi_data *data, const cpl_parameterlist *parlist) |
| Perform self-bias correction to the SC raw data. | |
| static int | _gravi_data_find (const gravi_data *self, const char *name) |
| cpl_error_code | gravi_data_copy_ext_insname (gravi_data *output, gravi_data *input, const char *name, const char *insname) |
| Copy extensions from one data to another. | |
| cpl_error_code | gravi_data_copy_ext_i (gravi_data *output, gravi_data *input, cpl_size num) |
| Copy extensions from one data to another. | |
| cpl_error_code | gravi_data_copy_ext (gravi_data *output, gravi_data *input, const char *name) |
| Copy extensions from one data to another. | |
| cpl_error_code | gravi_data_move_ext (gravi_data *output, gravi_data *input, const char *name) |
| Move extensions from one data to another. | |
| int | gravi_data_has_extension (gravi_data *raw_calib, const char *ext_name) |
| Check if data has extension with given EXTNAME. | |
| int | gravi_data_has_type (gravi_data *self, const char *type) |
| Return the number of ext whose EXTNAME and INSNAME match 'type'. | |
| cpl_propertylist * | gravi_data_get_plist_x (gravi_data *self, int i) |
| Get the propertylist of an extension by position. | |
| cpl_table * | gravi_data_get_table_x (gravi_data *self, int i) |
| Get the table of an extension by position. | |
| cpl_imagelist * | gravi_data_get_cube_x (gravi_data *self, int i) |
| Get the cube of an extension by position. | |
| cpl_table * | gravi_data_get_oi_table (gravi_data *self, const char *extname, const char *insname) |
| Get an OI_FITS table from EXTNAME and INSNAME. | |
| cpl_propertylist * | gravi_data_get_oi_plist (gravi_data *self, const char *extname, const char *insname) |
| Get the propertylist from EXTNAME and INSNAME. | |
| cpl_propertylist * | gravi_data_get_plist (gravi_data *self, const char *extname) |
| Get the propertylist from EXTNAME. | |
| cpl_propertylist * | gravi_data_get_extra_primary_header (gravi_data *self) |
| Get the propertylist for additional keywords to the primary header. | |
| cpl_table * | gravi_data_get_table (gravi_data *self, const char *extname) |
| Return a pointer on a table extension by its EXTNAME. | |
| cpl_imagelist * | gravi_data_get_cube (gravi_data *self, const char *extname) |
| Return a pointer on an IMAGE extension by its EXTNAME. | |
| cpl_error_code | gravi_data_erase_x (gravi_data *self, int pos) |
| Erase an extension by its position. | |
| cpl_error_code | gravi_data_erase (gravi_data *self, const char *extname) |
| Erase an extension by its EXTNAME. | |
| cpl_error_code | gravi_data_erase_type (gravi_data *self, const char *type) |
| Erase all extension related to an instrument (SC, FT, MET...) | |
| cpl_error_code | gravi_data_add_table (gravi_data *self, cpl_propertylist *plist, const char *extname, cpl_table *table) |
| Add a BINTABLE extension in gravi_data. | |
| cpl_error_code | gravi_data_add_cube (gravi_data *self, cpl_propertylist *plist, const char *extname, cpl_imagelist *imglist) |
| Add an IMAGE (imagelist) extension in gravi_data. | |
| cpl_error_code | gravi_data_add_img (gravi_data *self, cpl_propertylist *plist, const char *extname, cpl_image *image) |
| Add an IMAGE (single image) extension in gravi_data. | |
| cpl_error_code | gravi_data_clean_for_astro (gravi_data *data) |
| Clean the data to keep only OIFITS extensions related to SC. | |
| cpl_error_code | gravi_data_check_consistency (gravi_data *data) |
| Verify the integrity of RAW data. | |
| cpl_table ** | gravi_data_get_oiwave_tables (gravi_data *data, int type_data, int npol) |
| Get pointer to the OI_WAVELENGTH tables of both polarisations. | |
This module implements the gravi data type. The type gravi_data is basically a structure of variables container which consists of type cpl_propertylist and cpl_table. The contents of the gravi_data structure is loaded from the FITS file so the property lists will be stocked in the first variable propertylist, and the tables associate at each property list will be stocked in the variable table. The fields are similar to ordinary cpl_propertylist and cpl_table variables so it can use all the features of these variables.
| #define GRAVI_DATA_SIZE 30 |
Definition at line 62 of file gravi_data.c.
|
inlinestatic |
Definition at line 1558 of file gravi_data.c.
Referenced by gravi_data_erase(), gravi_data_get_cube(), gravi_data_get_plist(), gravi_data_get_table(), and gravi_data_has_extension().
| cpl_error_code gravi_data_add_cube | ( | gravi_data * | self, |
| cpl_propertylist * | plist, | ||
| const char * | extname, | ||
| cpl_imagelist * | imglist | ||
| ) |
Add an IMAGE (imagelist) extension in gravi_data.
| self | The gravi_data to insert in |
| plist | The (optional) plist to associate, not duplicated |
| extname | The (optional) EXTNAME |
| imglist | The imagelist to insert, not duplicated |
The image and its associated plist are append into the gravi_data, without duplication (image and plist shall not be deleted).
Definition at line 2353 of file gravi_data.c.
References CPLCHECK_MSG, and plist.
Referenced by gravi_compute_flat_badpix(), gravi_compute_wave_offset(), gravi_data_copy_ext(), gravi_data_copy_ext_i(), gravi_data_copy_ext_insname(), gravi_data_move_ext(), gravi_fit_argon(), gravi_preproc_acqcam(), and gravi_wave_qc().
| cpl_error_code gravi_data_add_img | ( | gravi_data * | self, |
| cpl_propertylist * | plist, | ||
| const char * | extname, | ||
| cpl_image * | image | ||
| ) |
Add an IMAGE (single image) extension in gravi_data.
| self | The gravi_data to insert in |
| plist | The (optional) plist to associate, not duplicated |
| extname | The (optional) EXTNAME |
| image | The image to insert, not duplicated |
The image and its associated plist are append into the gravi_data, without duplication (image and plist shall not be deleted).
Definition at line 2394 of file gravi_data.c.
References CPLCHECK_MSG, and plist.
Referenced by gravi_compute_badpix(), gravi_compute_biasmask(), gravi_compute_dark(), gravi_compute_profile(), gravi_data_detector_cleanup(), and gravi_reduce_acqcam().
| cpl_error_code gravi_data_add_table | ( | gravi_data * | self, |
| cpl_propertylist * | plist, | ||
| const char * | extname, | ||
| cpl_table * | table | ||
| ) |
Add a BINTABLE extension in gravi_data.
| self | The gravi_data to insert in |
| plist | The (optional) plist to associate, not duplicated |
| extname | The (optional) EXTNAME |
| imglist | The table to insert, not duplicated |
The table and its associated plist are append into the gravi_data, without duplication (table and plist shall not be deleted).
Definition at line 2289 of file gravi_data.c.
References CPLCHECK_MSG, gravi_data_check_savetypes(), GRAVI_OI_ARRAY_EXT, GRAVI_OI_FLUX_EXT, GRAVI_OI_T3_EXT, GRAVI_OI_TARGET_EXT, GRAVI_OI_VIS2_EXT, GRAVI_OI_VIS_EXT, GRAVI_OI_WAVELENGTH_EXT, gravi_pfits_get_extname(), and plist.
Referenced by gravi_compute_argon_pos(), gravi_compute_badpix(), gravi_compute_dark(), gravi_compute_disp(), gravi_compute_p2vmred(), gravi_compute_pca(), gravi_compute_profile(), gravi_compute_vis(), gravi_compute_wave(), gravi_create_p2vm(), gravi_data_clean_for_astro(), gravi_data_copy_ext(), gravi_data_copy_ext_i(), gravi_data_copy_ext_insname(), gravi_data_move_ext(), gravi_extract_spectrum(), gravi_metrology_reduce(), gravi_p2vm_transmission(), gravi_reduce_acqcam(), gravi_wave_compute_opds(), gravi_wave_correct_color(), gravity_astrometry(), and gravity_p2vm().
| cpl_error_code gravi_data_append | ( | gravi_data * | first, |
| const gravi_data * | second, | ||
| int | force | ||
| ) |
Append a gravi_data into another existing one.
| first | the main gravi_data (will grow) |
| second | the gravi_data to append to first |
| CPL_ERROR_NULL_INPUT | Input data is missing |
| CPL_ERROR_INCOMPATIBLE_INPUT | This extension of the input data are not compatible |
The function only works for OIFITS so far. The function skips some table that shall not be merged (OI_ARRAY, OI_WAVELENGTH, OI_TARGET...). It appends the table extension and the image extension by duplicating the data (second may be properly deallocated).
Definition at line 308 of file gravi_data.c.
References cpl_msg_info(), CPLCHECK_MSG, gravi_data_copy_ext_i(), gravi_msg_function_exit, gravi_msg_function_start, gravi_pfits_get_extname(), and gravi_table_are_equal().
Referenced by gravity_dark(), gravity_disp(), gravity_postprocess(), gravity_vis(), and gravity_vis_from_p2vmred().
| cpl_error_code gravi_data_check_consistency | ( | gravi_data * | data | ) |
Verify the integrity of RAW data.
| data | RAW data to verify |
Check the consistency of table in the data, by looking at the temporal coverage of the real-time signals METROLOGY, OPDC, FT... (shall encompass the science), and the steps between consecutive frames in these real-time signals (shall be constant).
Definition at line 2531 of file gravi_data.c.
References cpl_msg_debug(), CPLCHECK_MSG, FREE, gravi_data_get_header, gravi_data_get_plist(), gravi_data_get_table(), gravi_data_has_extension(), gravi_msg_function_exit, gravi_msg_function_start, gravi_pfits_add_check(), gravi_pfits_get_dit_sc(), gravi_pfits_get_time_sc(), header, and plist.
Referenced by gravi_data_load_rawframe().
| cpl_error_code gravi_data_check_savetypes | ( | cpl_propertylist * | hdr, |
| cpl_table * | oi_table | ||
| ) |
Set the savetypes of the OIFITS table.
| hdr | property list of the table, to check it is an OIFITS table |
| oi_table | the OIFITS table to verify |
| CPL_ERROR_NULL_INPUT | input data is missing |
| CPL_ERROR_ILLEGAL_INPUT | Cannot reinstall the savetypes |
Ensure the FLAG columns are saved as BOOL, the STA_INDEX are saved as SHORT, the TARGET_ID are saved as SHORT and the MNT_STA are saved as SHORT. This is to follow properly the OIFITS standard.
Definition at line 198 of file gravi_data.c.
References gravi_data_is_oi_ext().
Referenced by gravi_data_add_table(), gravi_data_duplicate(), gravi_data_load(), and gravi_data_load_ext().
| cpl_error_code gravi_data_clean_for_astro | ( | gravi_data * | data | ) |
Clean the data to keep only OIFITS extensions related to SC.
| self | The gravi data to be cleaned in-place |
Remove all tables not related to SC. That is keep: OI_ARRAY, OI_TARGET, and keep OI_WAVELENGTH, OI_VIS, OI_VIS2, OI_T3, OI_FLUX whose INSNAME is the SC.
Definition at line 2435 of file gravi_data.c.
References cpl_msg_debug(), cpl_msg_info(), CPLCHECK_MSG, FREE, gravi_data_add_table(), gravi_data_get_plist_x(), gravi_data_get_size(), gravi_data_get_table_x(), gravi_msg_function_exit, gravi_msg_function_start, GRAVI_OI_ARRAY_EXT, GRAVI_OI_TARGET_EXT, GRAVI_OI_VIS_ACQ_EXT, GRAVI_OI_VIS_MET_EXT, GRAVI_OI_WAVELENGTH_EXT, gravi_pfits_get_extname(), gravi_pfits_get_insname(), INSNAME_ACQ, INSNAME_SC, INSNAME_SC_P1, INSNAME_SC_P2, and plist.
Referenced by gravity_disp(), and gravity_vis().
| cpl_error_code gravi_data_copy_ext | ( | gravi_data * | output, |
| gravi_data * | input, | ||
| const char * | name | ||
| ) |
Copy extensions from one data to another.
| output | gravi_data to insert the extension |
| input | gravi_data to read the extension |
| name | EXTNAME of the extension to copy |
Deep copy of the extension NAME from input to output Copy all if several extension with same EXTNAME are found. Silent if the copy cannot be done.
Definition at line 1690 of file gravi_data.c.
References CPLCHECK_MSG, gravi_data_add_cube(), gravi_data_add_table(), gravi_data_get_cube_x(), gravi_data_get_plist_x(), gravi_data_get_size(), gravi_data_get_table_x(), gravi_pfits_get_extension_type(), gravi_pfits_get_extname(), and plist.
Referenced by gravi_align_spectrum(), gravi_compute_badpix(), gravi_compute_biasmask(), gravi_compute_dark(), gravi_compute_p2vmred(), gravi_compute_piezotf(), gravi_compute_profile(), gravi_compute_vis(), gravi_compute_wave(), gravi_create_p2vm(), gravi_extract_spectrum(), gravity_disp(), gravity_p2vm(), and gravity_wavelamp().
| cpl_error_code gravi_data_copy_ext_i | ( | gravi_data * | output, |
| gravi_data * | input, | ||
| cpl_size | num | ||
| ) |
Copy extensions from one data to another.
| output | gravi_data to insert the extension |
| input | gravi_data to read the extension |
| num | num to copy |
Deep copy of the extension NAME from input to output Copy all if several extension with same EXTNAME are found. Silent if the copy cannot be done.
Definition at line 1647 of file gravi_data.c.
References CPLCHECK_MSG, gravi_data_add_cube(), gravi_data_add_table(), gravi_data_get_cube_x(), gravi_data_get_plist_x(), gravi_data_get_table_x(), gravi_pfits_get_extension_type(), and plist.
Referenced by gravi_data_append().
| cpl_error_code gravi_data_copy_ext_insname | ( | gravi_data * | output, |
| gravi_data * | input, | ||
| const char * | name, | ||
| const char * | insname | ||
| ) |
Copy extensions from one data to another.
| output | gravi_data to insert the extension |
| input | gravi_data to read the extension |
| name | EXTNAME of the extension to copy |
| insname | INSNAME of the extension to copy |
Deep copy of the extension NAME from input to output Copy all if several extension with same EXTNAME are found. Silent if the copy cannot be done.
Definition at line 1587 of file gravi_data.c.
References CPLCHECK_MSG, gravi_data_add_cube(), gravi_data_add_table(), gravi_data_get_cube_x(), gravi_data_get_plist_x(), gravi_data_get_size(), gravi_data_get_table_x(), gravi_pfits_get_extension_type(), gravi_pfits_get_extname(), gravi_pfits_get_insname(), and plist.
Referenced by gravity_vis(), and gravity_vis_from_p2vmred().
| cpl_mask * gravi_data_create_bias_mask | ( | cpl_table * | detector_table, |
| cpl_size | nx, | ||
| cpl_size | ny | ||
| ) |
return a mask with pixel to be possibly illuminated
| detector_table | cpl_table containing extension IMAGING_DETECTOR_TABLE |
| nx | size of image |
| ny | size of image |
Return a mask with 1 where the pixels are illumated with the spectra, according to the information in DETECTOR_TABLE, and 0 if the pixels are not illuminated.
Returned mask should be desallocated with cpl_mask_delete
Definition at line 1131 of file gravi_data.c.
References cpl_msg_info(), CPLCHECK_NUL, FREE, gravi_msg_function_exit, gravi_msg_function_start, and gravi_table_get_value.
Referenced by gravi_data_detector_cleanup().
| void gravi_data_delete | ( | gravi_data * | self | ) |
Delete a gravi data.
| self | The gravi data to delete. |
The function destroys a gravi data of any kind. All the members including their values are properly deallocated. If the gravi data self is NULL, nothing is done and no error is set.
Definition at line 146 of file gravi_data.c.
References FREE, FREELOOP, GRAVI_DATA_SIZE, gravi_msg_function_exit, and gravi_msg_function_start.
Referenced by gravi_compute_tf(), gravi_compute_tf_qc(), gravi_data_load(), gravi_data_load_ext(), gravi_data_save_data(), gravi_fit_argon(), gravity_badpix(), gravity_biasmask(), gravity_dark(), gravity_disp(), gravity_image(), gravity_p2vm(), gravity_pcacal(), gravity_piezo(), gravity_postprocess(), gravity_vis(), gravity_vis_from_p2vmred(), gravity_viscal(), gravity_wavelamp(), and load_data().
| cpl_error_code gravi_data_detector_cleanup | ( | gravi_data * | data, |
| const cpl_parameterlist * | parlist | ||
| ) |
Perform self-bias correction to the SC raw data.
| data | gravi_data to be processed (in-place). |
| parlist | parameter list with :
|
This function applies the self bias-pixel correction to the IMAGING_DATA_SC images, in-place. The bias is estimated independently for each image in the imagelist (DIT). It is the median of the bias-pixel, whose location depend on the spectral setup (HIGH has bias-column, while MED and LOW have bias-lines). The functions add QC paramter to recover the mean subtracted bias.
Definition at line 1232 of file gravi_data.c.
References cpl_image_delete(), cpl_msg_info(), cpl_propertylist_update_double(), CPLCHECK_MSG, FREE, gravi_data_add_img(), gravi_data_create_bias_mask(), gravi_data_get_cube(), gravi_data_get_dark_pos(), gravi_data_get_header, gravi_data_get_table(), gravi_image_subtract_collapse(), GRAVI_IMAGING_DATA_SC_EXT, GRAVI_IMAGING_DETECTOR_SC_EXT, gravi_msg_function_exit, gravi_msg_function_start, gravi_msg_warning(), gravi_param_get_bool_default(), gravi_param_get_string_default(), gravi_pfits_get_resolution(), gravi_remove_cosmicrays_sc(), gravi_vector_get_mean_clip(), and header.
Referenced by gravity_biasmask(), gravity_dark(), gravity_disp(), gravity_p2vm(), gravity_vis(), and gravity_wavelamp().
| cpl_error_code gravi_data_dump | ( | gravi_data * | self | ) |
Dump the overall structure of a gravi_data in stdout.
| self | : gravi_data to dump |
| CPL_ERROR_NULL_INPUT | Input data is missing |
Definition at line 796 of file gravi_data.c.
References cpl_msg_info(), and gravi_pfits_get_extname().
| cpl_error_code gravi_data_dump_mode | ( | gravi_data * | data | ) |
Dump some information about data in messagin.
| data | The gravi data to dump |
| CPL_ERROR_NULL_INPUT | Input data is missing |
If the information is missing, the function does nothing and return successfuly.
Definition at line 565 of file gravi_data.c.
References cpl_msg_info(), gravi_data_get_header, GRAVI_FT, gravi_pfits_get_pola_mode(), gravi_pfits_get_spec_res(), GRAVI_SC, and header.
Referenced by gravi_data_load_frame(), gravi_data_load_rawframe(), and gravi_data_load_rawframe_ext().
| gravi_data * gravi_data_duplicate | ( | const gravi_data * | self | ) |
Create a copy of the gravi data.
| self | The gravi data to duplicate. |
| CPL_ERROR_NULL_INPUT | input data is missing |
The function returns a copy of the gravi data self. The copy is a deep copy, i.e. all fields members are copied. I return NULL in case of an error. In the latter case an appropriate error code is set.
Definition at line 250 of file gravi_data.c.
References CPLCHECK_NUL, gravi_data_check_savetypes(), gravi_data_new(), gravi_msg_function_exit, and gravi_msg_function_start.
Referenced by gravi_average_dark(), gravi_calibrate_vis(), gravi_compute_tf(), gravi_compute_zp(), and gravity_viscal().
| cpl_error_code gravi_data_erase | ( | gravi_data * | self, |
| const char * | extname | ||
| ) |
Erase an extension by its EXTNAME.
| self | The gravi_data to manipulate in-place |
| name | The string to search |
The function erases the first (and only the first) extension whose EXTNAME exactly matches name.
Definition at line 2212 of file gravi_data.c.
References _gravi_data_find(), cpl_msg_info(), CPLCHECK_MSG, and gravi_data_erase_x().
Referenced by gravity_dark().
| cpl_error_code gravi_data_erase_type | ( | gravi_data * | self, |
| const char * | type | ||
| ) |
Erase all extension related to an instrument (SC, FT, MET...)
| self | The gravi_data to manipulate in-place |
| type | The string to search ("SC", "FT", "MET"...) |
The function erases all extension whose INSNAME or EXTNAME parameters could be matched to type.
Definition at line 2247 of file gravi_data.c.
References cpl_msg_info(), CPLCHECK_MSG, gravi_data_erase_x(), gravi_data_get_plist_x(), gravi_data_get_size(), gravi_pfits_get_extname(), gravi_pfits_get_insname(), and plist.
Referenced by gravity_postprocess().
| cpl_error_code gravi_data_erase_x | ( | gravi_data * | self, |
| int | pos | ||
| ) |
Erase an extension by its position.
| self | The gravi_data to manipulate in-place |
| pos | The extension to delete |
The function erases the extension in position pos.
Definition at line 2161 of file gravi_data.c.
References CPLCHECK_MSG, FREE, GRAVI_DATA_SIZE, and gravi_pfits_get_extension_type().
Referenced by gravi_data_erase(), and gravi_data_erase_type().
| cpl_imagelist * gravi_data_get_cube | ( | gravi_data * | self, |
| const char * | extname | ||
| ) |
Return a pointer on an IMAGE extension by its EXTNAME.
| self | The gravi data to search in. |
| name | The EXTNAME to search |
The function returns a pointer to the imagelist with name name, or NULL if it does not exist or is not a IMAGE.
Definition at line 2131 of file gravi_data.c.
References _gravi_data_find(), and gravi_pfits_get_extension_type().
Referenced by gravi_compute_badpix(), gravi_compute_biasmask(), gravi_compute_dark(), gravi_compute_flat_badpix(), gravi_compute_gain(), gravi_compute_profile(), gravi_compute_wave_offset(), gravi_data_detector_cleanup(), gravi_extract_spectrum(), gravi_fit_argon(), gravi_preproc_acqcam(), gravi_reduce_acqcam(), and gravity_wavelamp().
| cpl_imagelist * gravi_data_get_cube_x | ( | gravi_data * | self, |
| int | i | ||
| ) |
Get the cube of an extension by position.
| self | The gravi data to search in. |
| i | The selected extension |
NULL on error.The function returns a pointer to the imglist corresponding to the extension i, or NULL on error or if the extension is not a imaglist. The returned imglist is still owned by the gravi_data, i.e. it must not be deleted through the returned pointer.
Definition at line 1926 of file gravi_data.c.
Referenced by gravi_data_copy_ext(), gravi_data_copy_ext_i(), gravi_data_copy_ext_insname(), and gravi_data_move_ext().
| int gravi_data_get_dark_pos | ( | cpl_table * | detector_table, |
| int | reg | ||
| ) |
retrun the position of the dark line on top of the region at x position
| detector_table | cpl_table containing extension IMAGING_DETECTOR_TABLE |
| reg | region index (start to 0) |
| x | x position on the detector |
This function return the central position of the dark line on top of the given region at x position
Definition at line 1102 of file gravi_data.c.
References gravi_table_get_value.
Referenced by gravi_data_detector_cleanup().
| cpl_propertylist * gravi_data_get_extra_primary_header | ( | gravi_data * | self | ) |
Get the propertylist for additional keywords to the primary header.
| self | The gravi data to search in. |
NULL on error. Definition at line 2074 of file gravi_data.c.
Referenced by gravi_compute_vis_qc(), and gravity_viscal().
| cpl_propertylist * gravi_data_get_oi_plist | ( | gravi_data * | self, |
| const char * | extname, | ||
| const char * | insname | ||
| ) |
Get the propertylist from EXTNAME and INSNAME.
| self | The gravi data to search in. |
| extname | The requested EXTNAME |
| insname | The requested INSNAME |
NULL on error.The function returns a pointer to the first propertylist corresponding to the extension with the requested INSNAME and EXTNAME. The returned pointer is still owned by the gravi_data, i.e. it must not be deleted.
Definition at line 2001 of file gravi_data.c.
References gravi_pfits_get_extname(), and gravi_pfits_get_insname().
Referenced by gravi_compute_disp_old().
| cpl_table * gravi_data_get_oi_table | ( | gravi_data * | self, |
| const char * | extname, | ||
| const char * | insname | ||
| ) |
Get an OI_FITS table from EXTNAME and INSNAME.
| self | The gravi data to search in. |
| extname | The requested EXTNAME |
| insname | The requested INSNAME |
NULL on error.The function returns a pointer to the table corresponding to the extension with the requested INSNAME and EXTNAME. The returned table is still owned by the gravi_data, i.e. it must not be deleted through the returned pointer.
Definition at line 1952 of file gravi_data.c.
References gravi_pfits_get_extname(), and gravi_pfits_get_insname().
Referenced by gravi_apply_tf_amp(), gravi_apply_tf_phi(), gravi_compute_disp_old(), and gravi_lazer_get_wavelength().
| cpl_table ** gravi_data_get_oiwave_tables | ( | gravi_data * | data, |
| int | type_data, | ||
| int | npol | ||
| ) |
Get pointer to the OI_WAVELENGTH tables of both polarisations.
| data | Input gravi_data |
| type_data | GRAVI_SC or GRAVI_FT |
| npol | Number of polarisation in data (1 or 2) |
The routine allocate memory for 1 or 2 pointers on the tables. Thus the return value shall be desallocated with cpl_free
Definition at line 2664 of file gravi_data.c.
References gravi_data_get_oi_wave, GRAVI_FT, and GRAVI_SC.
Referenced by gravi_align_spectrum(), and gravi_compute_p2vm().
| cpl_propertylist * gravi_data_get_plist | ( | gravi_data * | self, |
| const char * | extname | ||
| ) |
Get the propertylist from EXTNAME.
| self | The gravi data to search in. |
| extname | The requested EXTNAME |
NULL on error.The function returns a pointer to the first propertylist corresponding to the extension with the requested EXTNAME. The propertylist of the main HEADER can be requested with extname = GRAVI_PRIMARY_HDR_EXT The returned pointer is still owned by the gravi_data, i.e. it must not be deleted.
Definition at line 2049 of file gravi_data.c.
References _gravi_data_find(), and GRAVI_PRIMARY_HDR_EXT.
Referenced by gravi_acqcam_field(), gravi_acqcam_z2meter(), gravi_compute_dark(), gravi_compute_disp_old(), gravi_compute_flat_badpix(), gravi_compute_p2vmred(), gravi_compute_wave_offset(), gravi_create_oiwave_table_sc(), gravi_data_check_consistency(), gravi_data_compare(), gravi_data_mean_metFddl(), gravi_extract_spectrum(), gravi_fit_argon(), gravi_flatten_vis(), gravi_wave_fit_2d(), gravi_wave_qc(), and gravity_pcacal().
| cpl_propertylist * gravi_data_get_plist_x | ( | gravi_data * | self, |
| int | i | ||
| ) |
Get the propertylist of an extension by position.
| self | The gravi data to search in. |
| i | The selected extension |
NULL on error.The function returns a pointer to the property list corresponding to the extension i. The returned propertylist is still owned by self, i.e. it must not be deleted through the returned pointer.
Definition at line 1876 of file gravi_data.c.
Referenced by gravi_compute_wave_offset(), gravi_data_clean_for_astro(), gravi_data_compare(), gravi_data_copy_ext(), gravi_data_copy_ext_i(), gravi_data_copy_ext_insname(), gravi_data_erase_type(), gravi_data_has_type(), gravi_data_move_ext(), gravi_data_patch(), gravi_fit_argon(), and gravi_vis_mjd_to_time().
| int gravi_data_get_size | ( | const gravi_data * | self | ) |
Get the number of extension in a gravi_data.
| self | The input gravi_data. |
| CPL_ERROR_NULL_INPUT | Input data is missing |
Definition at line 828 of file gravi_data.c.
Referenced by gravi_compute_wave_offset(), gravi_data_clean_for_astro(), gravi_data_compare(), gravi_data_copy_ext(), gravi_data_copy_ext_insname(), gravi_data_erase_type(), gravi_data_has_type(), gravi_data_move_ext(), gravi_fit_argon(), gravi_vis_force_time(), and gravi_vis_mjd_to_time().
| cpl_table * gravi_data_get_table | ( | gravi_data * | self, |
| const char * | extname | ||
| ) |
Return a pointer on a table extension by its EXTNAME.
| self | The gravi data to search in. |
| name | The EXTNAME to search |
The function returns a pointer to the table with name name, or NULL if it does not exist or is not a bintable.
Definition at line 2096 of file gravi_data.c.
References _gravi_data_find(), and gravi_pfits_get_extension_type().
Referenced by gravi_acqcam_field(), gravi_align_spectrum(), gravi_average_dark(), gravi_compute_argon_pos(), gravi_compute_badpix(), gravi_compute_dark(), gravi_compute_disp(), gravi_compute_disp_old(), gravi_compute_flat_badpix(), gravi_compute_gain(), gravi_compute_opdc_state(), gravi_compute_p2vmred(), gravi_compute_piezotf(), gravi_compute_pointing_uv(), gravi_compute_profile(), gravi_compute_qc_ft_opd_estimator(), gravi_compute_signals(), gravi_compute_tau0(), gravi_compute_tf(), gravi_compute_vis(), gravi_compute_wave(), gravi_compute_wave_offset(), gravi_create_oiwave_table_sc(), gravi_data_check_consistency(), gravi_data_detector_cleanup(), gravi_data_mean_metFddl(), gravi_extract_spectrum(), gravi_fit_argon(), gravi_flatten_vis(), gravi_idp_compute(), gravi_lazer_get_wavelength(), gravi_metrology_demodulate(), gravi_metrology_get_astig(), gravi_metrology_get_fc_focus(), gravi_metrology_get_fc_shift(), gravi_metrology_reduce(), gravi_smooth_preproc(), gravi_subtract_met_dark(), gravi_wave_qc(), gravity_image(), gravity_p2vm(), gravity_pcacal(), and gravity_wavelamp().
| cpl_table * gravi_data_get_table_x | ( | gravi_data * | self, |
| int | i | ||
| ) |
Get the table of an extension by position.
| self | The gravi data to search in. |
| i | The selected extension |
NULL on error.The function returns a pointer to the table corresponding to the extension i, or NULL on error or if the extension is not a table. The returned table is still owned by the gravi_data set, i.e. it must not be deleted through the returned pointer.
Definition at line 1901 of file gravi_data.c.
Referenced by gravi_compute_pointing_uv(), gravi_compute_tf(), gravi_data_clean_for_astro(), gravi_data_compare(), gravi_data_copy_ext(), gravi_data_copy_ext_i(), gravi_data_copy_ext_insname(), gravi_data_move_ext(), gravi_metrology_reduce(), gravi_vis_force_time(), and gravi_vis_mjd_to_time().
| int gravi_data_has_extension | ( | gravi_data * | raw_calib, |
| const char * | ext_name | ||
| ) |
Check if data has extension with given EXTNAME.
| raw_calib | gravi_data to search in |
| ext_name | name of the extension to check |
Definition at line 1808 of file gravi_data.c.
References _gravi_data_find(), and test.
Referenced by gravi_compute_badpix(), gravi_compute_dark(), gravi_compute_gain(), gravi_compute_p2vmred(), gravi_compute_profile(), gravi_compute_signals(), gravi_data_check_consistency(), gravi_idp_compute(), gravi_metrology_get_astig(), gravi_metrology_reduce(), gravi_preproc_acqcam(), gravi_reduce_acqcam(), and gravi_subtract_met_dark().
| int gravi_data_has_type | ( | gravi_data * | self, |
| const char * | type | ||
| ) |
Return the number of ext whose EXTNAME and INSNAME match 'type'.
| self | gravi_data to search in |
| type | name to search (ex: "_SC", "_FT", "METROLOGY") |
Definition at line 1833 of file gravi_data.c.
References cpl_msg_debug(), gravi_data_get_plist_x(), gravi_data_get_size(), gravi_pfits_get_extname(), gravi_pfits_get_insname(), and plist.
Referenced by gravi_average_vis(), gravi_compute_rejection(), gravi_compute_snr(), gravi_compute_vis(), gravi_compute_vis_qc(), and gravi_vis_copy_fluxdata().
| int gravi_data_is_oi_ext | ( | cpl_propertylist * | hdr | ) |
Check if EXTNAME starts with 'OI_' (OIFITS extension)
Definition at line 174 of file gravi_data.c.
References gravi_pfits_get_extname().
Referenced by gravi_data_check_savetypes().
| gravi_data * gravi_data_load | ( | const char * | filename | ) |
Low-level function to load FITS file.
| filename | Name of the input file. |
| CPL_ERROR_NULL_INPUT | Input data is missing |
The function returns a gravi data created by reading the FITS file. Currently only the FITS file format is supported. All the gravi data memory members are allocated.
Definition at line 402 of file gravi_data.c.
References cpl_msg_debug(), CPLCHECK_NUL, FREE, gravi_data_check_savetypes(), gravi_data_delete(), gravi_data_new(), gravi_msg_function_exit, gravi_msg_function_start, gravi_pfits_get_extension_type(), and header.
Referenced by gravi_data_load_frame(), and gravi_data_load_rawframe().
| gravi_data * gravi_data_load_ext | ( | const char * | filename, |
| const char * | extensions_regexp | ||
| ) |
Low-level function to load FITS file.
| filename | Name of the input file. |
| extensions_regexp | Extensions to load |
| CPL_ERROR_NULL_INPUT | Input data is missing |
| CPL_ERROR_ILLEGAL_INPUT | extensions_regexp cannot be interpreted |
The function returns a gravi data created by reading the FITS file. Only the extension names that match the regular expression in extensions_regexp parameter are actually loaded Currently only the FITS file format is supported. All the gravi data memory members are allocated.
Definition at line 474 of file gravi_data.c.
References cpl_msg_debug(), CPLCHECK_NUL, FREE, gravi_data_check_savetypes(), gravi_data_delete(), gravi_data_new(), gravi_msg_function_exit, gravi_msg_function_start, gravi_pfits_get_extension_type(), and header.
Referenced by gravi_data_load_rawframe_ext(), and gravity_image().
| gravi_data * gravi_data_load_frame | ( | cpl_frame * | frame, |
| cpl_frameset * | used_frameset | ||
| ) |
Load a FITS file and create a gravi_data.
| filename | Name of the input file. |
| used_frameset | If not NULL, this frameset is append with frame |
| CPL_ERROR_NULL_INPUT | Input data is missing |
Load and create a gravi data type from input frame.
Definition at line 599 of file gravi_data.c.
References cpl_msg_info(), CPLCHECK_NUL, FILESHORT, gravi_data_dump_mode(), and gravi_data_load().
Referenced by gravity_disp(), gravity_p2vm(), gravity_pcacal(), gravity_postprocess(), gravity_vis(), gravity_vis_from_p2vmred(), gravity_viscal(), gravity_wavelamp(), and load_data().
| gravi_data * gravi_data_load_rawframe | ( | cpl_frame * | frame, |
| cpl_frameset * | used_frameset | ||
| ) |
Load a RAW FITS file and create a gravi_data.
| filename | Name of the input file. |
| used_frameset | If not NULL, this frameset is append with frame |
| CPL_ERROR_NULL_INPUT | Input data is missing |
Load and create a gravi data type from input RAW frame. Data integrity is verified.
Definition at line 716 of file gravi_data.c.
References cpl_msg_info(), CPLCHECK_NUL, FILESHORT, gravi_data_check_consistency(), gravi_data_dump_mode(), and gravi_data_load().
Referenced by gravity_badpix(), gravity_biasmask(), gravity_dark(), gravity_disp(), gravity_p2vm(), gravity_piezo(), gravity_vis(), and gravity_wavelamp().
| gravi_data * gravi_data_load_rawframe_ext | ( | cpl_frame * | frame, |
| cpl_frameset * | used_frameset, | ||
| const char * | extensions_regexp | ||
| ) |
Load a RAW FITS file and create a gravi_data from specified extensions.
| filename | Name of the input file. |
| used_frameset | If not NULL, this frameset is append with frame |
| extensions_regexp | Regular expression with extensions to load |
| CPL_ERROR_NULL_INPUT | Input data is missing |
Load and create a gravi data type from input RAW frame. Only the extensions specified by the regular expression are loaded into the gravi_data struct.
Definition at line 760 of file gravi_data.c.
References cpl_msg_info(), CPLCHECK_NUL, FILESHORT, gravi_data_dump_mode(), and gravi_data_load_ext().
Referenced by gravity_p2vm().
| cpl_error_code gravi_data_move_ext | ( | gravi_data * | output, |
| gravi_data * | input, | ||
| const char * | name | ||
| ) |
Move extensions from one data to another.
| output | gravi_data to insert the extension |
| input | gravi_data to remove the extension |
| name | EXTNAME of the extension to move |
Move the extension NAME from input to output Move all if several extension with same EXTNAME are found. Silent if no move could be done.
Definition at line 1741 of file gravi_data.c.
References cpl_msg_info(), CPLCHECK_MSG, gravi_data_add_cube(), gravi_data_add_table(), gravi_data_get_cube_x(), gravi_data_get_plist_x(), gravi_data_get_size(), gravi_data_get_table_x(), GRAVI_DATA_SIZE, gravi_msg_function_exit, gravi_msg_function_start, gravi_pfits_get_extension_type(), gravi_pfits_get_extname(), and plist.
Referenced by gravity_disp(), gravity_p2vm(), and gravity_vis().
| gravi_data * gravi_data_new | ( | int | nb_ext | ) |
Create an empty gravi_data.
| nb_ext | must be greater than 0 |
| CPL_ERROR_ILLEGAL_INPUT | is 0 |
The function allocates memory for a gravi_data. The returned gravi_data must be deleted using the destructor gravi_data_delete(). The allocated structure can contain up to GRAVI_DATA_SIZE extension, which with its own header (propertylist). The extensions can be IMAGE or BINTABLE.
Definition at line 110 of file gravi_data.c.
References GRAVI_DATA_SIZE, gravi_msg_function_exit, and gravi_msg_function_start.
Referenced by gravi_compute_badpix(), gravi_compute_biasmask(), gravi_compute_dark(), gravi_compute_disp(), gravi_compute_disp_old(), gravi_compute_p2vmred(), gravi_compute_pca(), gravi_compute_piezotf(), gravi_compute_profile(), gravi_compute_vis(), gravi_compute_wave_offset(), gravi_create_p2vm(), gravi_data_duplicate(), gravi_data_load(), gravi_data_load_ext(), gravi_eop_load_finals2000A(), gravi_extract_spectrum(), gravi_fit_argon(), gravi_visdata_fromellipse(), gravity_p2vm(), and gravity_wavelamp().
| int gravi_data_patch | ( | gravi_data * | file_to_patch, |
| cpl_frameset * | patch_frameset | ||
| ) |
Load a RAW FITS file and create a gravi_data.
| filename | Name of the input file. |
| used_frameset | If not NULL, this frameset is append with frame |
| CPL_ERROR_NULL_INPUT | Input data is missing |
Load and create a gravi data type from input RAW frame. Data integrity is verified.
Definition at line 635 of file gravi_data.c.
References cpl_msg_info(), cpl_propertylist_update_double(), CPLCHECK_INT, FILESHORT, FREE, and gravi_data_get_plist_x().
Referenced by gravity_vis().
| cpl_error_code gravi_data_save_data | ( | gravi_data * | self, |
| const char * | filename, | ||
| unsigned | mode | ||
| ) |
Save a gravi data in a FITS file.
| self | The gravi data to save or NULL if empty |
| filename | Name of the file to write |
| mode | The desired output options (combined with bitwise or) |
| CPL_ERROR_NULL_INPUT | Input data is missing |
| CPL_ERROR_ILLEGAL_INPUT | Unknown type of one extension |
This function saves a gravi data to a FITS file, using cfitsio and save all the tables members with its properties list. Supported output modes are CPL_IO_CREATE (create a new file) and CPL_IO_EXTEND (append to an existing file).
This is a low-level routine, which does not provide a CPL compliant product (see gravi_data_save_new).
Definition at line 856 of file gravi_data.c.
References cpl_table_save(), gravi_data_delete(), and gravi_pfits_get_extension_type().
| cpl_error_code gravi_data_save_new | ( | gravi_data * | self, |
| cpl_frameset * | allframes, | ||
| const char * | filename, | ||
| const char * | suffix, | ||
| const cpl_parameterlist * | parlist, | ||
| cpl_frameset * | usedframes, | ||
| cpl_frame * | frame, | ||
| const char * | recipe, | ||
| cpl_propertylist * | applist, | ||
| const char * | proCatg | ||
| ) |
Save a gravi data in a CPL-complian FITS file.
| self | The gravi data to save or NULL if empty |
| allframes | The list of input frames for the recipe |
| filename | Filename, or build from frame and proCatg if NULL |
| suffix | If the filename is constructed from the recipe and pro_catg, add _suffix to it. Nothing added if NULL |
| parlist | Input parameter list with :
|
| usedframes | The list of raw/calibration frames used for this product |
| frame | The reference frame to build the header |
| recipe | The recipe name |
| applist | Optional propertylist to append to primary header or NULL |
| proCatg | Optional string coding the PRO.CATG |
| CPL_ERROR_NULL_INPUT | Input data is missing |
Definition at line 925 of file gravi_data.c.
References cpl_msg_info(), cpl_table_save(), CPLCHECK_MSG, FILESHORT, FREE, gravi_data_get_header, gravi_data_get_qc, gravi_msg_function_exit, gravi_msg_function_start, GRAVI_NIGHT_OBS, gravi_param_get_bool(), gravi_pfits_add_pipe_build(), and gravi_plist_get_oifits_keywords().
Referenced by gravity_astrometry(), gravity_badpix(), gravity_biasmask(), gravity_dark(), gravity_disp(), gravity_p2vm(), gravity_pcacal(), gravity_piezo(), gravity_postprocess(), gravity_vis(), gravity_vis_from_p2vmred(), gravity_viscal(), and gravity_wavelamp().
| 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().