|
ERIS Pipeline Reference Manual 1.8.15
|
Core jitter observation processing workflows and cube reconstruction. More...
Macros | |
| #define | ERIS_IFU_SKIP_SKY_CORR_PLANES 75 |
| *static */void | |
Functions | |
| void | eris_ifu_jitter_free_sofStruct (struct sofStruct *sof_struct) |
| Free and clean up SOF structure and all contained data. | |
| void | eris_ifu_jitter_get_cube_type_string (cubeType type) |
| Print cube type as string to log. | |
| cubeType | eris_ifu_jitter_get_coadd_obj_type (cubeType type) |
| Convert cube type to corresponding coadded cube type. | |
| cubeType | eris_ifu_jitter_get_obj_type (sofModes mode) |
| Get object cube type from SOF observation mode. | |
| cubeType | eris_ifu_jitter_get_sky_type (sofModes mode) |
| Get sky cube type from SOF observation mode. | |
| cpl_error_code | eris_ifu_jitter_process_exposures (struct sofStruct *sof, struct stdParamStruct stdParams, struct paramStruct params, cpl_frameset *frameset, const cpl_parameterlist *parlist, const char *recipe_name, const char *context) |
| Process all raw exposures into calibrated 3D data cubes. | |
| cpl_error_code | eris_ifu_jitter_process_cubes (struct sofStruct *sof, struct stdParamStruct stdParams, struct paramStruct params, cpl_frameset *frameset, const cpl_parameterlist *parlist, const char *recipe_name, cubeType *obj_type) |
| Process and combine data cubes with sky tweaking and DAR correction. | |
| hdrl_image * | eris_ifu_jitter_subtract_background (skyTweakModes sky_tweak, int objIdx, struct sofStruct *sof, productDepthType productDepth) |
| Subtract sky or dark background from raw exposure image. | |
| hdrl_imagelist * | eris_ifu_jitter_build_cube (hdrl_image *inputImage, int sofIdx, struct sofStruct *sof, struct paramStruct params, bool doVelocityCorrection, cpl_polynomial *ohLambdaCorrection, productDepthType productDepth) |
| Build 3D data cube from 2D detector image. | |
| cpl_error_code | eris_image_get_valid_data_range (cpl_image *image, cpl_size *min, cpl_size *max) |
| Determine valid data range in spectral direction (find NaN-dominated rows) | |
| cpl_imagelist * | eris_ifu_jitter_reconstruct_cube (cpl_image *resampledDetImage, slitletDetectionModes mode, int fineTuneMode, double firstCol, cpl_vector *distancesV, cpl_bivector *positionsVV) |
| Function to create a 3D-data cube from a re-sampled image. | |
| cpl_error_code | eris_ifu_jitter_get_procatg_and_filename (cubeType type, char **proCatg, char **filenamePrefix) |
| Get the value of the PRO.CATG and the filename as function of the type of cube. | |
| cpl_error_code | eris_ifu_extract_spec (const cpl_imagelist *data_in, const cpl_imagelist *noise_in, cpl_image *mask, cpl_vector **spec_data_out, cpl_vector **spec_noise_out) |
| Extract a spectrum from 3D data cube. | |
| cpl_error_code | eris_ifu_extract_spec_fetch_params (const cpl_parameterlist *parlist, struct esParamStruct *params, const char *context) |
| Fetch spectral extraction parameters from parameter list. | |
| cpl_error_code | eris_ifu_jitter_extract (cpl_frameset *frameset, const cpl_parameterlist *parlist, cubeType obj_type, const char *pcatg, struct stdParamStruct stdParams, const char *pipefile_prefix, const char *context) |
| Main spectral extraction function. | |
| cpl_error_code | eris_ifu_jitter_extract_spec_processSof (cubeType obj_type, cpl_frameset *frames, struct esParamStruct params, struct esSofStruct *sof) |
| Process SOF for spectral extraction. | |
| cpl_error_code | eris_ifu_dar_correction (hdrl_imagelist *cube, cpl_propertylist *hdr, int method, double radius, int length) |
| Apply Differential Atmospheric Refraction (DAR) correction. | |
| cpl_error_code | eris_ifu_dar_cpl_shift (cpl_image *inImg, cpl_image *out1Img, cpl_image *out2Img, double xShift, double yShift, cpl_kernel kernelType, double width, cpl_size kernelSize) |
| Apply DAR correction using CPL image shifting. | |
| cpl_error_code | eris_ifu_dar_gsl_shift (cpl_image *inImg, cpl_image *outImg, double xShift, double yShift, const gsl_interp2d_type *T) |
| Apply DAR correction using GSL 2D interpolation. | |
| int | eris_frameset_count_tag (cpl_frameset *sof, const char *tag) |
| Count frames with specified tag in frameset. | |
| cpl_error_code | eris_frameset_duplicate_cube_tag (cpl_frameset *frameset, const char *pcatg, cpl_boolean apply_flat) |
| Duplicate a cube file with different PRODCATG for coadded version. | |
| cpl_error_code | eris_ifu_update_wcs_with_OCS_keywords (struct sofStruct *sof) |
| Update WCS coordinates from OCS cumulative offset keywords. | |
Core jitter observation processing workflows and cube reconstruction.
This module implements the complete data reduction workflow for jittered IFU observations, including data cube construction, sky subtraction, spectral extraction, and mosaicking.
Key Functionality:
Processing Workflow:
Sky Subtraction Methods:
Data Structures:
| int eris_frameset_count_tag | ( | cpl_frameset * | sof, |
| const char * | tag | ||
| ) |
Count frames with specified tag in frameset.
| sof | Input frameset |
| tag | Tag to search for |
Definition at line 3661 of file eris_ifu_jitter_static.c.
Referenced by eris_stdstar_reduction_common().
| cpl_error_code eris_frameset_duplicate_cube_tag | ( | cpl_frameset * | frameset, |
| const char * | pcatg, | ||
| cpl_boolean | apply_flat | ||
| ) |
Duplicate a cube file with different PRODCATG for coadded version.
| frameset | input frameset containing data cube |
| pcatg | cube PRO.CATG |
| apply_flat | was the cube corrected by flat? |
Definition at line 3700 of file eris_ifu_jitter_static.c.
Referenced by eris_stdstar_reduction_common().
| cpl_error_code eris_ifu_dar_correction | ( | hdrl_imagelist * | cube, |
| cpl_propertylist * | hdr, | ||
| int | method, | ||
| double | radius, | ||
| int | length | ||
| ) |
Apply Differential Atmospheric Refraction (DAR) correction.
| cube | data cube to correct (modified in place) |
| hdr | FITS header with WCS info |
| shiftMethod | interpolation method for shifting [0-8] |
| shiftWidth | kernel radius for interpolation [pixels] |
| shiftLength | kernel length for interpolation |
Definition at line 3355 of file eris_ifu_jitter_static.c.
References BRK_IF_ERROR, CATCH, CHECK_ERROR_STATE, eris_ifu_dar_cpl_shift(), eris_ifu_dar_gsl_shift(), eris_ifu_free_image(), eris_ifu_free_vector(), eris_ifu_lcorr_create_lambda_vector(), hdrl_dar_compute(), hdrl_dar_parameter_create(), hdrl_image_create(), hdrl_image_get_error(), hdrl_image_get_image(), hdrl_imagelist_get(), hdrl_imagelist_set(), hdrl_parameter_delete(), and TRY.
Referenced by eris_ifu_jitter_process_cubes().
| cpl_error_code eris_ifu_dar_cpl_shift | ( | cpl_image * | inImg, |
| cpl_image * | out1Img, | ||
| cpl_image * | out2Img, | ||
| double | xShift, | ||
| double | yShift, | ||
| cpl_kernel | kernelType, | ||
| double | width, | ||
| cpl_size | kernelSize | ||
| ) |
Apply DAR correction using CPL image shifting.
| cube | Data cube to correct (modified in place) |
| refImg | Reference image for cross-correlation |
| shiftMethod | CPL shift method [0-4] |
| shiftWidth | Kernel radius [pixels] |
| shiftLength | Kernel length |
Definition at line 3504 of file eris_ifu_jitter_static.c.
References CATCH, CHECK_ERROR_STATE, eris_ifu_free_image(), eris_ifu_free_vector(), and TRY.
Referenced by eris_ifu_dar_correction().
| cpl_error_code eris_ifu_dar_gsl_shift | ( | cpl_image * | inImg, |
| cpl_image * | outImg, | ||
| double | xShift, | ||
| double | yShift, | ||
| const gsl_interp2d_type * | T | ||
| ) |
Apply DAR correction using GSL 2D interpolation.
| cube | Data cube to correct (modified in place) |
| refImg | Reference image for cross-correlation |
| shiftMethod | Interpolation method (5=bilinear, 6=bicubic) |
| shiftWidth | Not used for GSL methods |
| shiftLength | Not used for GSL methods |
Definition at line 3586 of file eris_ifu_jitter_static.c.
Referenced by eris_ifu_dar_correction().
| cpl_error_code eris_ifu_extract_spec | ( | const cpl_imagelist * | data_in, |
| const cpl_imagelist * | noise_in, | ||
| cpl_image * | mask, | ||
| cpl_vector ** | spec_data_out, | ||
| cpl_vector ** | spec_noise_out | ||
| ) |
Extract a spectrum from 3D data cube.
| data_in | input 3D data cube | |
| noise_in | input 3D errors cube (can be NULL) | |
| mask | input pixel mask for weighted extraction (can be NULL) | |
| [out] | spec_data_out | extracted spectrum (allocated by function) |
| [out] | spec_noise_out | error spectrum (allocated if noise_in provided) |
Definition at line 2654 of file eris_ifu_jitter_static.c.
References ASSURE, BRK_IF_NULL, CATCH, CATCH_MSG, and TRY.
Referenced by eris_ifu_lcorr_extract_spectrum().
| cpl_error_code eris_ifu_extract_spec_fetch_params | ( | const cpl_parameterlist * | parlist, |
| struct esParamStruct * | params, | ||
| const char * | context | ||
| ) |
Fetch spectral extraction parameters from parameter list.
| parlist | input parameter list |
| params | output parameter structure (modified in place) |
| recipe_name | recipe name for parameter context |
Definition at line 3003 of file eris_ifu_jitter_static.c.
References BRK_WITH_ERROR_MSG, CATCH, CHECK_ERROR_STATE, and TRY.
Referenced by eris_ifu_jitter_extract().
| hdrl_imagelist * eris_ifu_jitter_build_cube | ( | hdrl_image * | inputImage, |
| int | sofIdx, | ||
| struct sofStruct * | sof, | ||
| struct paramStruct | params, | ||
| bool | doVelocityCorrection, | ||
| cpl_polynomial * | ohLambdaCorrection, | ||
| productDepthType | productDepth | ||
| ) |
Build 3D data cube from 2D detector image.
| inputImage | input image (brick-wall pattern, before re-sampling) |
| sofIdx | index of image in input sofStruct structure |
| sofStruct | data structure containing all input data |
| params | structure with all parameters required to reduce sci data |
| doVelocityCorrection | boolean switch to apply or not velocity corr |
| ohLambdaCorrection | polynomial coefficients with OH wave-cal corr |
| productDepth | product depth parameter |
Definition at line 1880 of file eris_ifu_jitter_static.c.
References BRK_IF_ERROR, BRK_IF_NULL, CATCH, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_bpm_correction(), eris_ifu_dist_warp_bpm(), eris_ifu_dist_warp_image(), eris_ifu_free_hdrl_image(), eris_ifu_free_image(), eris_ifu_free_propertylist(), eris_ifu_free_string(), eris_ifu_jitter_reconstruct_cube(), eris_ifu_mask_nans_in_cube(), eris_ifu_save_hdrl_image_dbg(), eris_ifu_warp_polynomial_image(), eris_ifu_wave_resampled_arc_image(), hdrl_image_create(), hdrl_image_div_image(), hdrl_image_duplicate(), hdrl_image_get_error(), hdrl_image_get_image(), hdrl_image_insert(), hdrl_image_new(), hdrl_imagelist_create(), hdrl_imagelist_get_size(), and TRY.
Referenced by eris_ifu_jitter_process_exposures().
| cpl_error_code eris_ifu_jitter_extract | ( | cpl_frameset * | frameset, |
| const cpl_parameterlist * | parlist, | ||
| cubeType | obj_type, | ||
| const char * | pcatg, | ||
| struct stdParamStruct | stdParams, | ||
| const char * | pipefile_prefix, | ||
| const char * | context | ||
| ) |
Main spectral extraction function.
| frameset | input frameset |
| obj_cube | object data cube |
| obj_cube_hdr | cube FITS header |
| params | extraction parameters |
| es_sof | extraction SOF structure |
| productDepth | product depth parameter |
Definition at line 3101 of file eris_ifu_jitter_static.c.
References BRK_IF_ERROR, BRK_IF_NULL, CATCH, CATCH_MSG, eris_check_error_code(), eris_compute_psf_qc(), eris_ifu_extract_spec_fetch_params(), eris_ifu_free_bivector(), eris_ifu_free_hdrl_image(), eris_ifu_free_image(), eris_ifu_free_propertylist(), eris_ifu_free_vector(), eris_ifu_jitter_extract_spec_processSof(), eris_ifu_jitter_get_coadd_obj_type(), eris_ifu_jitter_get_cube_type_string(), eris_ifu_jitter_get_procatg_and_filename(), eris_ifu_save_deq_image(), hdrl_image_get_error(), hdrl_image_get_image(), hdrl_image_get_mask(), and TRY.
Referenced by eris_stdstar_reduction_common().
| cpl_error_code eris_ifu_jitter_extract_spec_processSof | ( | cubeType | obj_type, |
| cpl_frameset * | frames, | ||
| struct esParamStruct | params, | ||
| struct esSofStruct * | sof | ||
| ) |
Process SOF for spectral extraction.
| frameset | input frameset |
| obj_type | cube type |
| sof | input SOF structure |
| params | extraction parameters |
| recipe_name | recipe name |
| productDepth | product depth parameter |
Definition at line 3263 of file eris_ifu_jitter_static.c.
References BRK_IF_NULL, BRK_WITH_ERROR_MSG, CATCH, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_jitter_get_procatg_and_filename(), eris_ifu_load_deq_hdrl_imagelist(), hdrl_imagelist_get_size(), hdrl_imagelist_get_size_x(), hdrl_imagelist_get_size_y(), and TRY.
Referenced by eris_ifu_jitter_extract().
| void eris_ifu_jitter_free_sofStruct | ( | struct sofStruct * | sof_struct | ) |
Free and clean up SOF structure and all contained data.
| sof_struct | SOF structure to free (can be NULL) |
Definition at line 154 of file eris_ifu_jitter_static.c.
References hdrl_image_delete(), and hdrl_imagelist_delete().
Referenced by eris_stdstar_reduction_common().
| cubeType eris_ifu_jitter_get_coadd_obj_type | ( | cubeType | type | ) |
Convert cube type to corresponding coadded cube type.
| type | Input cube type |
Definition at line 324 of file eris_ifu_jitter_static.c.
Referenced by eris_ifu_jitter_extract().
| void eris_ifu_jitter_get_cube_type_string | ( | cubeType | type | ) |
Print cube type as string to log.
| type | Cube type enumeration value |
Definition at line 230 of file eris_ifu_jitter_static.c.
Referenced by eris_ifu_jitter_extract(), and eris_stdstar_reduction_common().
| cubeType eris_ifu_jitter_get_obj_type | ( | sofModes | mode | ) |
Get object cube type from SOF observation mode.
| mode | SOF observation mode (SCIENCE, STD, STD_FLUX, PSF, etc.) |
Definition at line 396 of file eris_ifu_jitter_static.c.
Referenced by eris_ifu_jitter_process_cubes(), and eris_ifu_jitter_process_exposures().
| cpl_error_code eris_ifu_jitter_get_procatg_and_filename | ( | cubeType | type, |
| char ** | proCatg, | ||
| char ** | filenamePrefix | ||
| ) |
Get the value of the PRO.CATG and the filename as function of the type of cube.
| type | the cube type | |
| [out] | proCatg | cube PRO.CATG (caller must free) |
| [out] | filenamePrefix | cube filename prefix (caller must free) |
Definition at line 2514 of file eris_ifu_jitter_static.c.
Referenced by eris_ifu_combine(), eris_ifu_jitter_extract(), eris_ifu_jitter_extract_spec_processSof(), eris_ifu_jitter_process_cubes(), and eris_stdstar_reduction_common().
| cubeType eris_ifu_jitter_get_sky_type | ( | sofModes | mode | ) |
Get sky cube type from SOF observation mode.
| mode | SOF observation mode (SCIENCE, STD, STD_FLUX, PSF, etc.) |
Definition at line 437 of file eris_ifu_jitter_static.c.
Referenced by eris_ifu_jitter_process_cubes(), and eris_ifu_jitter_process_exposures().
| cpl_error_code eris_ifu_jitter_process_cubes | ( | struct sofStruct * | sof, |
| struct stdParamStruct | stdParams, | ||
| struct paramStruct | params, | ||
| cpl_frameset * | frameset, | ||
| const cpl_parameterlist * | parlist, | ||
| const char * | recipe_name, | ||
| cubeType * | obj_type | ||
| ) |
Process and combine data cubes with sky tweaking and DAR correction.
| sof | SOF structure containing all exposures and their cubes |
| stdParams | Standard pipeline parameters |
| params | Jitter-specific processing parameters |
| frameset | Input frameset for DFS compliance |
| parlist | Recipe parameter list |
| recipe_name | Recipe name for output products |
| obj_type | Output: determined object cube type (modified in place) |
Definition at line 1347 of file eris_ifu_jitter_static.c.
References BRK_IF_ERROR, BRK_IF_NULL, BRK_WITH_ERROR_MSG, CATCH, CATCH_MSGS, CHECK_ERROR_STATE, eris_ifu_dar_correction(), eris_ifu_extract_frameset(), eris_ifu_free_imagelist(), eris_ifu_free_mask(), eris_ifu_free_parameterlist(), eris_ifu_free_string(), eris_ifu_free_table(), eris_ifu_jitter_get_obj_type(), eris_ifu_jitter_get_procatg_and_filename(), eris_ifu_jitter_get_sky_type(), eris_ifu_sky_tweak(), eris_ifu_split_hdrl_imagelist(), hdrl_image_reject_from_mask(), hdrl_imagelist_create(), hdrl_imagelist_get(), hdrl_imagelist_get_size(), hdrl_imagelist_get_size_x(), hdrl_imagelist_get_size_y(), sc_skycorr(), and TRY.
Referenced by eris_stdstar_reduction_common().
| cpl_error_code eris_ifu_jitter_process_exposures | ( | struct sofStruct * | sof, |
| struct stdParamStruct | stdParams, | ||
| struct paramStruct | params, | ||
| cpl_frameset * | frameset, | ||
| const cpl_parameterlist * | parlist, | ||
| const char * | recipe_name, | ||
| const char * | context | ||
| ) |
Process all raw exposures into calibrated 3D data cubes.
| sof | SOF structure containing all exposures and calibrations |
| stdParams | Standard pipeline parameters |
| params | Jitter-specific processing parameters |
| frameset | Input frameset for DFS compliance |
| parlist | Recipe parameter list |
| recipe_name | Recipe name for output products |
| context | Parameter context string (e.g., "eris.eris_ifu_jitter") |
Definition at line 704 of file eris_ifu_jitter_static.c.
References BRK_IF_ERROR, BRK_IF_NULL, CATCH, eris_check_error_code(), eris_ifu_append_qc_float(), eris_ifu_cube_trim_nans(), eris_ifu_free_hdrl_image(), eris_ifu_free_hdrl_imagelist(), eris_ifu_free_polynomial(), eris_ifu_get_band(), eris_ifu_get_plane_cut_min_max(), eris_ifu_jitter_build_cube(), eris_ifu_jitter_get_obj_type(), eris_ifu_jitter_get_sky_type(), eris_ifu_jitter_subtract_background(), eris_ifu_lcorr_get(), eris_ifu_update_wcs_with_OCS_keywords(), hdrl_imagelist_get_size(), and TRY.
Referenced by eris_stdstar_reduction_common().
| cpl_imagelist * eris_ifu_jitter_reconstruct_cube | ( | cpl_image * | resampledDetImage, |
| slitletDetectionModes | mode, | ||
| int | fineTuneMode, | ||
| double | firstCol, | ||
| cpl_vector * | distancesV, | ||
| cpl_bivector * | positionsVV | ||
| ) |
Function to create a 3D-data cube from a re-sampled image.
| resampledDetImage | the re-sampled image |
| mode | parameter to control the slitlet detection algorithm used |
| fineTuneMode | Specifies the row interpolation mode using GSL routines 0: no interpolation >2: polynomial interpolation, polynomial degree is interType-1 2: linear interpolation -1: Cubic spline with natural boundary conditions -2: cubic spline with periodic boundary conditions -3: Non-rounded Akima spline with natural boundary conditions. -4: Non-rounded Akima spline with periodic boundary conditions. -5: Steffen's method guarantees the monotonicity of the interpolating function between the given data points |
| firstCol | first column of each slitlet used to re-sample image |
| distancesV | output computed slitlets distances (for DISTANCES mode, can be NULL) |
| positionsVV | output computed slutlets positions (for EDGES mode, can be NULL) |
Definition at line 2296 of file eris_ifu_jitter_static.c.
References BRK_IF_ERROR, BRK_IF_NULL, BRK_WITH_ERROR_MSG, CATCH, eris_ifu_1d_interpolation(), eris_ifu_free_imagelist(), eris_ifu_mask_nans_in_cube(), and TRY.
Referenced by eris_ifu_jitter_build_cube().
| hdrl_image * eris_ifu_jitter_subtract_background | ( | skyTweakModes | sky_tweak, |
| int | objIdx, | ||
| struct sofStruct * | sof, | ||
| productDepthType | productDepth | ||
| ) |
Subtract sky or dark background from raw exposure image.
| sky_tweak | Sky tweaking mode (NONE, DAVIES, AUSTRIAN) |
| objIdx | Index of object exposure in SOF |
| sof | SOF structure containing calibrations and exposures |
| productDepth | Product depth parameter for debug output |
Definition at line 1773 of file eris_ifu_jitter_static.c.
References BRK_IF_ERROR, BRK_IF_NULL, CATCH, eris_ifu_free_image(), eris_ifu_free_mask(), eris_ifu_free_string(), eris_ifu_save_hdrl_image_dbg(), hdrl_image_delete(), hdrl_image_duplicate(), hdrl_image_get_mask(), hdrl_image_sub_image(), and TRY.
Referenced by eris_ifu_jitter_process_exposures().
| cpl_error_code eris_ifu_update_wcs_with_OCS_keywords | ( | struct sofStruct * | sof | ) |
Update WCS coordinates from OCS cumulative offset keywords.
| sof | SOF structure with exposure table |
Definition at line 3815 of file eris_ifu_jitter_static.c.
References CATCH, CHECK_ERROR_STATE, and TRY.
Referenced by eris_ifu_jitter_process_exposures().
| cpl_error_code eris_image_get_valid_data_range | ( | cpl_image * | image, |
| cpl_size * | min, | ||
| cpl_size * | max | ||
| ) |
Determine valid data range in spectral direction (find NaN-dominated rows)
| image | Input 2D image to analyze |
| min | Output: minimum valid row index (modified in place) |
| max | Output: maximum valid row index (modified in place) |
Definition at line 2222 of file eris_ifu_jitter_static.c.