|
ERIS Pipeline Reference Manual 1.8.15
|
Functions | |
| ifsInstrument | eris_ifu_get_instrument_frame (cpl_frame *frame) |
| Get instrument identifier from a CPL frame. | |
| hdrl_image * | eris_ifu_raw_hdrl_image (const cpl_image *cplImage) |
| Create an HDRL image from a CPL image with calculated noise. | |
| cpl_image * | eris_ifu_calc_noise_map (const cpl_image *data, double gain, double readnoise) |
| Calculate a noise map for detector data. | |
| hdrl_imagelist * | eris_ifu_load_exposure_frameset (const cpl_frameset *frameset, int exposureCorrectionMode) |
| Load raw exposures from a frameset with optional corrections. | |
| hdrl_image * | eris_ifu_load_exposure_frame (const cpl_frame *frame, int exposureCorrectionMode, cpl_image *dqi) |
| Load a raw detector exposure from a frame with optional corrections. | |
| cpl_error_code | eris_ifu_add_badpix_border (cpl_image *data, cpl_boolean add_ones, cpl_image *dqi) |
| Flag detector border pixels as bad in image and optionally set to 1. | |
| hdrl_image * | eris_ifu_load_exposure_file (const char *filename, int exposureCorrectionMode, cpl_image *dqi) |
| Load a raw detector exposure from file with corrections and noise. | |
| cpl_mask * | eris_ifu_detect_crh (hdrl_image *image, int exposureCorrectionMode, hdrl_parameter *laCosmicParams, bool maskImage) |
| Detect cosmic ray hits using LA-cosmic algorithm. | |
| cpl_error_code | eris_ifu_saturation_detection (cpl_image *image, cpl_image *dqi) |
| Detect saturated pixels and flag them as bad. | |
| cpl_error_code | eris_ifu_exposure_line_correction (cpl_image *image) |
| Perform line/row correction on raw detector image. | |
| cpl_error_code | eris_ifu_exposure_column_correction (cpl_image *image) |
| Perform column correction on raw detector image. | |
| cpl_error_code | eris_ifu_calc_bpm (const cpl_parameterlist *pl, const char *recipe_name, hdrl_image *master_img, const hdrl_imagelist *imglist_on, cpl_mask **bpm2dMask, cpl_mask **bpm3dMask) |
| Create 2D and/or 3D bad pixel masks using HDRL algorithms. | |
| hdrl_image * | eris_ifu_warp_polynomial_image (const hdrl_image *hdrlInImg, const cpl_polynomial *poly_u, const cpl_polynomial *poly_v) |
| Warp an HDRL image using 2D polynomial transformations. | |
| cpl_error_code | eris_ifu_add_std_params (cpl_parameterlist *pl, const char *recipename) |
| Add standard recipe parameters to a parameter list. | |
| void | eris_ifu_free_std_param (struct stdParamStruct *stdParams) |
| Free memory allocated for stdParamStruct. | |
| cpl_error_code | eris_ifu_fetch_std_param (const cpl_parameterlist *parlist, const char *recipename, struct stdParamStruct *stdParams) |
| Fetch standard parameters from parameter list into structure. | |
| cpl_error_code | eris_parlist_config_add_all_recipes (cpl_parameterlist *pl, const char *recname) |
| Add common configuration parameters for all recipes. | |
| cpl_error_code | eris_parlist_config_add_bpm (cpl_parameterlist *pl, const char *recname) |
| Add bad pixel mask configuration parameters to parameter list. | |
| cpl_error_code | eris_parlist_config_add_flat (cpl_parameterlist *pl, const char *recname) |
| Add flat field configuration parameters to parameter list. | |
| cpl_vector * | eris_ifu_polyfit_1d (const cpl_vector *x, const cpl_vector *y, const int degree) |
| Fit a 1D polynomial to vector data. | |
| cpl_polynomial * | eris_ifu_1d_polynomial_fit (int nPoints, double *xdata, double *ydata, int degree) |
| Fit a 1D polynomial to arrays of data points. | |
| cpl_error_code | eris_ifu_1d_interpolation (double *xIn, double *yIn, int nIn, double *xOut, double *yOut, int nOut, const int interType) |
| Perform 1D interpolation using GSL routines. | |
| double | eris_ifu_image_get_mean (const cpl_image *image) |
| ** | |
| cpl_vector * | eris_ifu_calc_centers_collapse_chunk (const cpl_image *img, int chunk_center, int height) |
| cpl_vector * | eris_ifu_image_collapse (const cpl_image *img) |
| cpl_error_code | eris_ifu_slitpos_gauss (const cpl_image *profile_x, double *left_edge_pos, double *right_edge_pos, int llx, int productDepth) |
| eris_ifu_dist_slitpos_gauss | |
| cpl_error_code | eris_ifu_bpm_correction (hdrl_image *himg, hdrl_image *badPixelMaskImg) |
| eris_ifu_bpm_correction | |
This module provides a comprehensive set of utility functions for IFU data processing, including:
These functions support both ERIS and SINFONI instruments and are used throughout the pipeline for data reduction tasks.
| cpl_error_code eris_ifu_1d_interpolation | ( | double * | xIn, |
| double * | yIn, | ||
| int | nIn, | ||
| double * | xOut, | ||
| double * | yOut, | ||
| int | nOut, | ||
| const int | interType | ||
| ) |
Perform 1D interpolation using GSL routines.
| xIn | X-values of input data points |
| yIn | Y-values of input data points |
| nIn | Number of input points |
| xOut | X-values for output (interpolation points) |
| yOut | (Output) Interpolated Y-values |
| nOut | Number of output points |
| interType | Interpolation type (see below) |
Definition at line 1788 of file eris_ifu_functions.c.
References ASSURE, BRK_WITH_ERROR_MSG, CATCH, eris_check_error_code(), eris_ifu_free_double_array(), and TRY.
Referenced by eris_ifu_jitter_reconstruct_cube(), and eris_ifu_wave_resampled_arc_image().
| cpl_polynomial * eris_ifu_1d_polynomial_fit | ( | int | nPoints, |
| double * | xdata, | ||
| double * | ydata, | ||
| int | degree | ||
| ) |
Fit a 1D polynomial to arrays of data points.
| nPoints | Number of data points |
| xdata | X-coordinates array |
| ydata | Y-values array |
| degree | Polynomial degree |
Definition at line 1716 of file eris_ifu_functions.c.
References CATCH, CATCH_MSGS, eris_check_error_code(), and TRY.
Referenced by eris_ifu_fit_all_lines(), eris_ifu_get_first_fit(), and eris_ifu_wave_smooth_coeffs().
| cpl_error_code eris_ifu_add_badpix_border | ( | cpl_image * | data, |
| cpl_boolean | add_ones, | ||
| cpl_image * | dqi | ||
| ) |
Flag detector border pixels as bad in image and optionally set to 1.
| data | Input/output image |
| add_ones | If TRUE, set flagged pixels to 1.0 |
| dqi | (Optional) Data quality image to update with ERIS_DQI_BP flag |
Definition at line 274 of file eris_ifu_functions.c.
References CATCH, CHECK_ERROR_STATE, eris_check_error_code(), and TRY.
Referenced by eris_ifu_load_exposure_file().
| cpl_error_code eris_ifu_add_std_params | ( | cpl_parameterlist * | pl, |
| const char * | recipename | ||
| ) |
Add standard recipe parameters to a parameter list.
| pl | Parameter list to which to append parameters |
| recipename | Recipe name (without "eris." prefix) |
Definition at line 1002 of file eris_ifu_functions.c.
References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_hdrl_parameter(), eris_ifu_free_parameter(), eris_ifu_free_parameterlist(), eris_ifu_free_string(), eris_ifu_parameterlist_append_list(), hdrl_lacosmic_parameter_create(), hdrl_lacosmic_parameter_create_parlist(), and TRY.
Referenced by eris_ifu_jitter_fill_common_parameterlist().
| cpl_error_code eris_ifu_bpm_correction | ( | hdrl_image * | himg, |
| hdrl_image * | badPixelMaskImg | ||
| ) |
eris_ifu_bpm_correction
| image | 2D hdrl image to be corrected |
| badPixelMaskImg | Master bad pixel image |
Correct the bad pixels of the image by taking the average of the 4 neighboring pixels
Definition at line 2499 of file eris_ifu_functions.c.
References eris_check_error_code(), hdrl_image_get_error(), hdrl_image_get_error_const(), hdrl_image_get_image(), hdrl_image_get_image_const(), hdrl_image_get_mask(), hdrl_image_get_mask_const(), hdrl_image_get_size_x(), hdrl_image_get_size_y(), hdrl_image_insert(), and hdrl_image_new().
Referenced by eris_ifu_jitter_build_cube().
| cpl_error_code eris_ifu_calc_bpm | ( | const cpl_parameterlist * | pl, |
| const char * | recipe_name, | ||
| hdrl_image * | master_img, | ||
| const hdrl_imagelist * | imglist_on, | ||
| cpl_mask ** | bpm2dMask, | ||
| cpl_mask ** | bpm3dMask | ||
| ) |
Create 2D and/or 3D bad pixel masks using HDRL algorithms.
| pl | Recipe parameter list |
| recipe_name | Recipe name for parameter lookup |
| master_img | Master image for 2D BPM computation |
| imglist_on | Image list for 3D BPM computation |
| bpm2dMask | (Output) 2D bad pixel mask |
| bpm3dMask | (Output) 3D bad pixel mask |
Definition at line 771 of file eris_ifu_functions.c.
References CATCH, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_free_hdrl_parameter(), eris_ifu_free_image(), eris_ifu_free_imagelist(), eris_ifu_free_mask(), eris_ifu_free_string(), hdrl_bpm_2d_compute(), hdrl_bpm_2d_parameter_parse_parlist(), hdrl_bpm_3d_compute(), hdrl_bpm_3d_parameter_parse_parlist(), hdrl_image_get_mask(), hdrl_image_get_size_x(), hdrl_image_get_size_y(), hdrl_image_reject_from_mask(), and TRY.
Referenced by eris_ifu_dark_static().
| cpl_vector * eris_ifu_calc_centers_collapse_chunk | ( | const cpl_image * | img, |
| int | chunk_center, | ||
| int | height | ||
| ) |
takes horizontal chuck of an image, collapses it in y
Definition at line 2164 of file eris_ifu_functions.c.
References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_image(), eris_ifu_free_vector(), and TRY.
Referenced by eris_ifu_dist_calc_centers().
| cpl_image * eris_ifu_calc_noise_map | ( | const cpl_image * | data, |
| double | gain, | ||
| double | readnoise | ||
| ) |
Calculate a noise map for detector data.
| data | Input image data |
| gain | Detector gain [e-/ADU] (must be > 0) |
| readnoise | Read-out noise [e-] (must be >= 0) |
Definition at line 149 of file eris_ifu_functions.c.
References BRK_IF_NULL, CATCH, CATCH_MSG, eris_check_error_code(), eris_ifu_free_image(), and TRY.
Referenced by eris_ifu_load_exposure_file(), and eris_ifu_raw_hdrl_image().
| cpl_mask * eris_ifu_detect_crh | ( | hdrl_image * | image, |
| int | exposureCorrectionMode, | ||
| hdrl_parameter * | laCosmicParams, | ||
| bool | maskImage | ||
| ) |
Detect cosmic ray hits using LA-cosmic algorithm.
| image | Input HDRL image |
| exposureCorrectionMode | Bit flags controlling detection |
| laCosmicParams | HDRL LA-cosmic parameters |
| maskImage | If true, apply mask to input image |
Definition at line 466 of file eris_ifu_functions.c.
References BRK_IF_ERROR, CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_mask(), hdrl_image_reject_from_mask(), hdrl_lacosmic_edgedetect(), and TRY.
| cpl_error_code eris_ifu_exposure_column_correction | ( | cpl_image * | image | ) |
Perform column correction on raw detector image.
| image | Input/output detector image |
Definition at line 675 of file eris_ifu_functions.c.
References BRK_IF_NULL, BRK_WITH_ERROR_MSG, CATCH, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_free_vector(), and TRY.
Referenced by eris_ifu_load_exposure_file().
| cpl_error_code eris_ifu_exposure_line_correction | ( | cpl_image * | image | ) |
Perform line/row correction on raw detector image.
| image | Input/output detector image |
Definition at line 578 of file eris_ifu_functions.c.
References BRK_IF_NULL, BRK_WITH_ERROR_MSG, CATCH, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_free_vector(), and TRY.
Referenced by eris_ifu_load_exposure_file().
| cpl_error_code eris_ifu_fetch_std_param | ( | const cpl_parameterlist * | parlist, |
| const char * | recipename, | ||
| struct stdParamStruct * | stdParams | ||
| ) |
Fetch standard parameters from parameter list into structure.
| parlist | Input parameter list |
| recipename | Recipe name (without "eris." prefix) |
| stdParams | (Output) Structure to populate with parameter values |
Definition at line 1169 of file eris_ifu_functions.c.
References CATCH, CATCH_MSGS, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_free_parameter(), eris_ifu_free_string(), hdrl_lacosmic_parameter_parse_parlist(), and TRY.
Referenced by eris_ifu_jitter_fetch_params().
| void eris_ifu_free_std_param | ( | struct stdParamStruct * | stdParams | ) |
Free memory allocated for stdParamStruct.
| stdParams | Pointer to stdParamStruct to free |
Definition at line 1132 of file eris_ifu_functions.c.
References eris_check_error_code(), and hdrl_parameter_delete().
Referenced by eris_stdstar_reduction_common().
| ifsInstrument eris_ifu_get_instrument_frame | ( | cpl_frame * | frame | ) |
Get instrument identifier from a CPL frame.
| frame | Input CPL frame |
Definition at line 78 of file eris_ifu_functions.c.
References BRK_WITH_ERROR, CATCH, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_free_propertylist(), eris_ifu_get_instrument(), and TRY.
Referenced by eris_ifu_dfs_set_groups(), and eris_ifu_jitter_get_instrument_settings().
| cpl_vector * eris_ifu_image_collapse | ( | const cpl_image * | img | ) |
collapses image in y and converts to vector
Definition at line 2215 of file eris_ifu_functions.c.
References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_image(), eris_ifu_free_vector(), and TRY.
| double eris_ifu_image_get_mean | ( | const cpl_image * | image | ) |
**
Calculate the mean of an image ignoring NaN values.
| image | Image to be averaged. |
Possible cpl_error_code set in this function:
data is NULL. Definition at line 1979 of file eris_ifu_functions.c.
References BRK_IF_NULL, CATCH, CATCH_MSGS, eris_check_error_code(), and TRY.
| hdrl_image * eris_ifu_load_exposure_file | ( | const char * | filename, |
| int | exposureCorrectionMode, | ||
| cpl_image * | dqi | ||
| ) |
Load a raw detector exposure from file with corrections and noise.
| filename | Path to detector exposure FITS file |
| exposureCorrectionMode | Bit flags specifying corrections to apply |
| dqi | (Optional) Data quality image to populate |
Definition at line 381 of file eris_ifu_functions.c.
References CATCH, CATCH_MSGS, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_add_badpix_border(), eris_ifu_calc_noise_map(), eris_ifu_exposure_column_correction(), eris_ifu_exposure_line_correction(), eris_ifu_free_hdrl_image(), eris_ifu_free_image(), eris_ifu_free_propertylist(), eris_ifu_get_instrument(), eris_ifu_saturation_detection(), hdrl_image_create(), and TRY.
Referenced by eris_ifu_detlin_load_frames(), eris_ifu_get_hdrlimagelist_by_tag(), eris_ifu_load_exposure_frame(), and eris_ifu_wave_collapse_arc_images().
| hdrl_image * eris_ifu_load_exposure_frame | ( | const cpl_frame * | frame, |
| int | exposureCorrectionMode, | ||
| cpl_image * | dqi | ||
| ) |
Load a raw detector exposure from a frame with optional corrections.
| frame | CPL frame holding the detector FITS file info |
| exposureCorrectionMode | Bit flags for corrections to apply |
| dqi | (Optional) Data quality image to populate with DQI flags |
Definition at line 237 of file eris_ifu_functions.c.
References CATCH, eris_check_error_code(), eris_ifu_load_exposure_file(), and TRY.
Referenced by eris_ifu_jitter_get_objsky_exposures(), and eris_ifu_load_exposure_frameset().
| hdrl_imagelist * eris_ifu_load_exposure_frameset | ( | const cpl_frameset * | frameset, |
| int | exposureCorrectionMode | ||
| ) |
Load raw exposures from a frameset with optional corrections.
| frameset | CPL frameset containing detector FITS files |
| exposureCorrectionMode | Bit flags for corrections to apply |
Definition at line 196 of file eris_ifu_functions.c.
References CATCH, eris_check_error_code(), eris_ifu_load_exposure_frame(), hdrl_imagelist_get_size(), hdrl_imagelist_new(), hdrl_imagelist_set(), and TRY.
| cpl_vector * eris_ifu_polyfit_1d | ( | const cpl_vector * | x, |
| const cpl_vector * | y, | ||
| const int | degree | ||
| ) |
Fit a 1D polynomial to vector data.
| x | X-coordinate vector |
| y | Y-value vector to fit |
| degree | Polynomial degree (must be > 0) |
Definition at line 1632 of file eris_ifu_functions.c.
References CATCH, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_free_vector(), and TRY.
| hdrl_image * eris_ifu_raw_hdrl_image | ( | const cpl_image * | cplImage | ) |
Create an HDRL image from a CPL image with calculated noise.
| cplImage | Input CPL image (data only) |
Definition at line 116 of file eris_ifu_functions.c.
References CATCH, eris_check_error_code(), eris_ifu_calc_noise_map(), hdrl_image_create(), and TRY.
| cpl_error_code eris_ifu_saturation_detection | ( | cpl_image * | image, |
| cpl_image * | dqi | ||
| ) |
Detect saturated pixels and flag them as bad.
| image | Input/output image |
| dqi | (Optional) Data quality image to update with ERIS_DQI_SAT flag |
Definition at line 521 of file eris_ifu_functions.c.
References eris_check_error_code().
Referenced by eris_ifu_load_exposure_file().
| cpl_error_code eris_ifu_slitpos_gauss | ( | const cpl_image * | profile_x, |
| double * | left_edge_pos, | ||
| double * | right_edge_pos, | ||
| int | llx, | ||
| int | productDepth | ||
| ) |
eris_ifu_dist_slitpos_gauss
| profile_x | In y collapsed profile across detector |
| left_edge_pos | (return) position of left edge () |
| right_edge_pos | (return) position of right edge |
| llx | offset in x for specific slitlet |
| productDepth | level of verbosity |
The function extracts a small area around the left ascending edge and another around the descending right edge. The y-values are subtracted in order th get a peak at the edge. The peak will be fitted using a gauss-funtion.
Definition at line 2260 of file eris_ifu_functions.c.
References BRK_WITH_ERROR, CATCH, CATCH_MSGS, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_fit_gauss(), eris_ifu_free_vector(), eris_ifu_save_vector_dbg(), and TRY.
| hdrl_image * eris_ifu_warp_polynomial_image | ( | const hdrl_image * | hdrlInImg, |
| const cpl_polynomial * | poly_u, | ||
| const cpl_polynomial * | poly_v | ||
| ) |
Warp an HDRL image using 2D polynomial transformations.
| hdrlInImg | Input HDRL image (data and error) |
| poly_u | Polynomial transformation for x-coordinates |
| poly_v | Polynomial transformation for y-coordinates |
Definition at line 906 of file eris_ifu_functions.c.
References CATCH, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_free_hdrl_image(), eris_ifu_free_image(), eris_ifu_free_vector(), hdrl_image_create(), hdrl_image_get_error_const(), hdrl_image_get_image(), hdrl_image_get_image_const(), hdrl_image_get_size_x(), hdrl_image_get_size_y(), and TRY.
Referenced by eris_ifu_jitter_build_cube().
| cpl_error_code eris_parlist_config_add_all_recipes | ( | cpl_parameterlist * | pl, |
| const char * | recname | ||
| ) |
Add common configuration parameters for all recipes.
| pl | Parameter list to which to append |
| recname | Recipe name (without "eris." prefix) |
Definition at line 1282 of file eris_ifu_functions.c.
References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_parameter(), eris_ifu_free_string(), and TRY.
| cpl_error_code eris_parlist_config_add_bpm | ( | cpl_parameterlist * | pl, |
| const char * | recname | ||
| ) |
Add bad pixel mask configuration parameters to parameter list.
| pl | Parameter list to which to append |
| recname | Recipe name (without "eris." prefix) |
Definition at line 1350 of file eris_ifu_functions.c.
References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_hdrl_parameter(), eris_ifu_free_parameter(), eris_ifu_free_parameterlist(), eris_ifu_free_string(), eris_ifu_parameterlist_append_list(), hdrl_bpm_2d_parameter_create_filtersmooth(), hdrl_bpm_2d_parameter_create_legendresmooth(), hdrl_bpm_2d_parameter_create_parlist(), hdrl_bpm_3d_parameter_create(), hdrl_bpm_3d_parameter_create_parlist(), hdrl_collapse_minmax_parameter_create(), hdrl_collapse_mode_parameter_create(), hdrl_collapse_parameter_create_parlist(), hdrl_collapse_sigclip_parameter_create(), hdrl_parameter_delete(), and TRY.
| cpl_error_code eris_parlist_config_add_flat | ( | cpl_parameterlist * | pl, |
| const char * | recname | ||
| ) |
Add flat field configuration parameters to parameter list.
| pl | Parameter list to which to append |
| recname | Recipe name (without "eris." prefix) |
Definition at line 1465 of file eris_ifu_functions.c.
References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_hdrl_parameter(), eris_ifu_free_parameterlist(), eris_ifu_free_string(), eris_ifu_parameterlist_append_list(), hdrl_flat_parameter_create(), hdrl_flat_parameter_create_parlist(), and TRY.