|
ERIS Pipeline Reference Manual 1.8.10
|
Functions | |
| ifsInstrument | eris_ifu_get_instrument_frame (cpl_frame *frame) |
| Return value of INSTRUME from a given input frame. | |
| hdrl_image * | eris_ifu_raw_hdrl_image (const cpl_image *cplImage) |
| Return an HDRL image containing a noise image as well. | |
| cpl_image * | eris_ifu_calc_noise_map (const cpl_image *data, double gain, double readnoise) |
| Return an HDRL image containing a noise image. | |
| hdrl_imagelist * | eris_ifu_load_exposure_frameset (const cpl_frameset *frameset, int exposureCorrectionMode) |
| Read a raw detector exposure, perform some correction, add noise data. | |
| hdrl_image * | eris_ifu_load_exposure_frame (const cpl_frame *frame, int exposureCorrectionMode, cpl_image *dqi) |
| Read a raw detector exposure, perform some correction, add noise data. | |
| cpl_error_code | eris_ifu_add_badpix_border (cpl_image *data, cpl_boolean add_ones, cpl_image *dqi) |
| Add image border frame to bad pixel map. | |
| hdrl_image * | eris_ifu_load_exposure_file (const char *filename, int exposureCorrectionMode, cpl_image *dqi) |
| Read a raw detector exposure, perform some correction, add noise data. | |
| cpl_mask * | eris_ifu_detect_crh (hdrl_image *image, int exposureCorrectionMode, hdrl_parameter *laCosmicParams, bool maskImage) |
| Detect Cosmic Ray Hits. | |
| cpl_error_code | eris_ifu_saturation_detection (cpl_image *image, cpl_image *dqi) |
| Detect saturated pixel and mask them as bad pixels. | |
| cpl_error_code | eris_ifu_exposure_line_correction (cpl_image *image) |
| Perform line correction on a raw detector image. | |
| cpl_error_code | eris_ifu_exposure_column_correction (cpl_image *image) |
| Perform column correction on a 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 and apply 2D and/or 3D Badpixel-Mask based on parameter. | |
| hdrl_image * | eris_ifu_warp_polynomial_image (const hdrl_image *hdrlInImg, const cpl_polynomial *poly_u, const cpl_polynomial *poly_v) |
| eris_ifu_warp_polynomial_image | |
| cpl_vector * | eris_ifu_polyfit_1d (const cpl_vector *x, const cpl_vector *y, const int degree) |
| An easy-to-handle wrapper to cpl_polynomial_fit() to fit a vector. | |
| 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 | |
| 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 | (intput) x values of input data set points |
| yIn | (intput) y values of input data set points |
| nIn | (intput) number of input data set points |
| xOut | (input) x values of points to be interpolated |
| yOut | (output) dependent y values for xOut points |
| nOut | (input) number of output data points |
| interType | (intput) type of interpolation |
The intertype parameter can have following values:
interType > 2: polynomial interpolation, polynomial degree is interType-1 For the interpolation a box car with a number of "interTpye" samples is used. interType 2: linear interpolation intertype -1: Cubic spline with natural boundary conditions. The resulting curve is piecewise cubic on each interval, with matching first and second derivatives at the supplied data points. The second derivative is chosen to be zero at the first point and last point.
intertype -2: cubic spline with periodic boundary conditions. The resulting curve is piecewise cubic on each interval, with matching first and second derivatives at the supplied data points. The derivatives at the first and last points are also matched. Note that the last point in the data must have the same y-value as the first point, otherwise the resulting periodic interpolation will have a discontinuity at the boundary.
intertype -3: Non-rounded Akima spline with natural boundary conditions. This method uses the non-rounded corner algorithm of Wodicka.
intertype -4: Non-rounded Akima spline with periodic boundary conditions. This method uses the non-rounded corner algorithm of Wodicka.
intertype -5: Steffen's method guarantees the monotonicity of the interpolating function between the given data points. Therefore, minima and maxima can only occur exactly at the data points, and there can never be spurious oscillations between data points. The interpolated function is piecewise cubic in each interval. The resulting curve and its first derivative are guaranteed to be continuous, but the second derivative may be discontinuous.
Definition at line 1636 of file eris_ifu_functions.c.
References ASSURE, BRK_WITH_ERROR_MSG, CATCH, eris_check_error_code(), eris_ifu_free_double_array(), and TRY.
| cpl_error_code eris_ifu_add_badpix_border | ( | cpl_image * | data, |
| cpl_boolean | add_ones, | ||
| cpl_image * | dqi | ||
| ) |
Add image border frame to bad pixel map.
| data | input image |
| add_ones | switch to set flagged pixels to 1 or not |
| dqi | input bad pixel (data quality) map |
Definition at line 246 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_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 2347 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().
| 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 and apply 2D and/or 3D Badpixel-Mask based on parameter.
| pl | input parameter list |
| recipe_name | input recipe name |
| master_img | input (HDRL) image |
| imglist_on | input HDRL list of on images |
| bpm2dMask | output bad pixel mask with flagged pixels with method 2D |
| bpm3dMask | output bad pixel mask with flagged pixels with method 3D |
Definition at line 727 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.
| 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 2012 of file eris_ifu_functions.c.
References CATCH, CATCH_MSGS, eris_check_error_code(), eris_ifu_free_image(), eris_ifu_free_vector(), and TRY.
| cpl_image * eris_ifu_calc_noise_map | ( | const cpl_image * | data, |
| double | gain, | ||
| double | readnoise | ||
| ) |
Return an HDRL image containing a noise image.
| data | input image data |
| gain | input gain |
| readnoise | inout read-out-noise |
Possible cpl_error_code set in this function:
Definition at line 130 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.
| image | input (HDRL) image |
| exposureCorrectionMode | data correction to be applied |
| laCosmicParams | HDRL parameters controlling LA-cosmic detection |
| maskImage | mask or not flagged pixels from the input (HDRL) image |
The exposureCorrectionMode parameter is a bit coded value to specify the required corrections. When more than one correction is requested the mode values can be concatenated using the OR operator.
Definition at line 446 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 a raw detector image.
| image |
The detector is read out in vertical direction. Hence, artefacts in the vertical direction can be due to a read out problem. Sometimes a pattern of columns can be seen of which every second is too bright and every other is too dark.
The correction is done by subtracting the median of 4 reference pixels located at the top and bottom of the detector.
Possible cpl_error_code set in this function:
Definition at line 644 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 correction on a raw detector image.
| image |
The read-out electronics subtracts the mean of the 4 reference pixel located at the left and right border of the detector image. This is done on purpose to remove the row-number dependent bias. However a bad (hot) pixel has a strong impact on the mean value. Therefore this function replaces the mean by the median value which is less affected by out-lyers.
Possible cpl_error_code set in this function:
Definition at line 548 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().
| ifsInstrument eris_ifu_get_instrument_frame | ( | cpl_frame * | frame | ) |
Return value of INSTRUME from a given input frame.
| frame | input frame |
Definition at line 58 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().
| cpl_vector * eris_ifu_image_collapse | ( | const cpl_image * | img | ) |
collapses image in y and converts to vector
Definition at line 2063 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 1827 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 | ||
| ) |
Read a raw detector exposure, perform some correction, add noise data.
| filename | of the detector exposure FITS file |
| exposureCorrectionMode | data correction to be applied |
| dqi | input bad pixel (data quality) map if not NULL will be filled with a data quality image |
The exposureCorrectionMode parameter is a bit coded value to specify the required corrections. When more than one correction is requested the mode values can be concatenated using the OR operator.
The list of corrections are:
The bad pixel mask of returned HDRL image is set with the border pixels and the detected saturated pixels. The DQI (data quality image) holds a more detailed about which why a pixel is rejected. bit number bit value description 4 8 saturated pixel 5 16 border pixel (the first/last 4 rows/columns)
Detected cosmic ray hits may be added in future.
Possible cpl_error_code set in this function:
Definition at line 362 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_get_hdrlimagelist_by_tag(), and eris_ifu_load_exposure_frame().
| hdrl_image * eris_ifu_load_exposure_frame | ( | const cpl_frame * | frame, |
| int | exposureCorrectionMode, | ||
| cpl_image * | dqi | ||
| ) |
Read a raw detector exposure, perform some correction, add noise data.
| frame | CPL frame holding the file info of the detector FITS file |
| exposureCorrectionMode | data correction to be applied |
| dqi | input bad pixel (data quality) map |
Definition at line 213 of file eris_ifu_functions.c.
References CATCH, eris_check_error_code(), eris_ifu_load_exposure_file(), and TRY.
Referenced by eris_ifu_load_exposure_frameset().
| hdrl_imagelist * eris_ifu_load_exposure_frameset | ( | const cpl_frameset * | frameset, |
| int | exposureCorrectionMode | ||
| ) |
Read a raw detector exposure, perform some correction, add noise data.
| frameset | CPL frameset holding the file info of the detector FITS files |
| exposureCorrectionMode | data correction to be applied |
Definition at line 173 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 | ||
| ) |
An easy-to-handle wrapper to cpl_polynomial_fit() to fit a vector.
| x | Positions to fit. |
| y | Values to fit. |
| degree | Degree of the polynomial to fit. |
degree + 1 The first value is the constant term: y(x) = fit_par[0] + fit_par[1]*x + fit_par[2]*x^2 + fit_par[3]*x^3 + ...Possible cpl_error_code set in this function:
Definition at line 1474 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 | ) |
Return an HDRL image containing a noise image as well.
| cplImage | as data |
Possible cpl_error_code set in this function:
Definition at line 96 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 pixel and mask them as bad pixels.
| image | |
| dqi | input bad pixel (data quality) map |
Definition at line 494 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 2108 of file eris_ifu_functions.c.
References BRK_WITH_ERROR, CATCH, CATCH_MSGS, CHECK_ERROR_STATE, eris_check_error_code(), 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 | ||
| ) |
eris_ifu_warp_polynomial_image
| hdrlInImg | |
| poly_u | |
| poly_v |
Definition at line 853 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.