ERIS Pipeline Reference Manual 1.8.15
Functions
IFU Dark Frame Processing Functions

Functions

cpl_error_code eris_ifu_dark_static (const cpl_parameterlist *parlist, hdrl_imagelist *darkImageList, hdrl_parameter *pdarkcollapse, hdrl_image **masterDarkHdrlImg, cpl_image **qualityImage, cpl_image **masterBpm, cpl_image **contribMap, cpl_mask **bpm2dMask, cpl_mask **bpm3dMask, cpl_propertylist *qcParams)
 Determine master dark and bad pixel maps.
 
cpl_image * eris_ifu_dark_noise (hdrl_imagelist *imageList)
 Determine dark noise image from standard deviation across frames.
 
cpl_error_code eris_ifu_dark_qc (const cpl_parameterlist *parlist, hdrl_image *masterDarkHdrlImg, hdrl_imagelist *darkImageList, const cpl_mask *masterBpm, const cpl_image *qualityImage, cpl_propertylist *qcParams)
 Determine quality control parameters for master dark.
 
cpl_image * eris_ifu_dark_get_dqi (const cpl_mask *masterBpmMask, const cpl_mask *bpm2dMask, const cpl_mask *bpm3dMask)
 Create a data quality indicator (DQI) image from bad pixel masks.
 

Detailed Description

This module provides functions for processing dark frames, including master dark creation, bad pixel map generation, noise estimation, and quality control parameter calculation for IFU data.

Synopsis:
#include "eris_ifu_dark_static.h"

Function Documentation

◆ eris_ifu_dark_get_dqi()

cpl_image * eris_ifu_dark_get_dqi ( const cpl_mask *  masterBpmMask,
const cpl_mask *  bpm2dMask,
const cpl_mask *  bpm3dMask 
)

Create a data quality indicator (DQI) image from bad pixel masks.

Parameters
masterBpmMaskMaster bad pixel mask (saturated and border pixels)
bpm2dMaskBad pixel mask from 2D analysis method
bpm3dMaskBad pixel mask from 3D analysis method
Returns
DQI image with combined quality flags, or NULL on error

Creates a data quality indicator image by combining information from multiple bad pixel masks. The DQI image is an integer image where each pixel value is a bitwise combination of quality flags:

  • ERIS_DQI_SAT: Saturated pixels (from masterBpmMask)
  • ERIS_DQI_BP: Border pixels (4-pixel border on all edges)
  • ERIS_DQI_BP_BPM2D: Bad pixels identified by 2D analysis
  • ERIS_DQI_BP_BPM3D: Bad pixels identified by 3D analysis
Note
The returned image must be freed by the caller using cpl_image_delete().
Multiple flags can be set for a single pixel if it fails multiple criteria.
Border pixels are explicitly set to ERIS_DQI_BP (4 pixels on each edge).

Definition at line 462 of file eris_ifu_dark_static.c.

References CATCH, eris_check_error_code(), eris_ifu_free_image(), and TRY.

Referenced by eris_ifu_dark_static().

◆ eris_ifu_dark_noise()

cpl_image * eris_ifu_dark_noise ( hdrl_imagelist *  imageList)

Determine dark noise image from standard deviation across frames.

Parameters
imageListInput HDRL dark images list
Returns
Dark noise image, or NULL on error

Calculates the pixel-by-pixel standard deviation across all input dark frames to estimate the temporal noise characteristics. This noise image represents the frame-to-frame variation at each pixel location.

Note
The returned image must be freed by the caller using cpl_image_delete().
Rejected pixels in the input images are included in the calculation.

Definition at line 171 of file eris_ifu_dark_static.c.

References CATCH, eris_check_error_code(), eris_ifu_free_vector(), hdrl_image_get_image_const(), hdrl_imagelist_get(), hdrl_imagelist_get_size(), hdrl_imagelist_get_size_x(), hdrl_imagelist_get_size_y(), and TRY.

Referenced by eris_ifu_dark_static().

◆ eris_ifu_dark_qc()

cpl_error_code eris_ifu_dark_qc ( const cpl_parameterlist *  parlist,
hdrl_image *  masterDarkHdrlImg,
hdrl_imagelist *  darkImageList,
const cpl_mask *  masterBpm,
const cpl_image *  qualityImage,
cpl_propertylist *  qcParams 
)

Determine quality control parameters for master dark.

Parameters
parlistInput recipe parameters
masterDarkHdrlImgInput HDRL master dark image
darkImageListInput HDRL dark images list (raw frames)
masterBpmInput master bad pixel map mask
qualityImageInput data quality indicator image
qcParamsOutput QC parameters property list
Returns
CPL_ERROR_NONE on success, otherwise an error code

Computes various quality control parameters for the master dark frame and adds them to the provided property list. Parameters include:

  • Number and fraction of bad pixels (total, saturated, 2D method, 3D method)
  • Mean and standard deviation of the master dark (excluding bad pixels)
  • Average and standard deviation of raw dark medians
  • Fixed Pattern Noise (FPN) measured in a specified region
  • Read-Out Noise (RON) measured in a specified region
  • Individual RON measurements from consecutive frame differences
Note
The RON calculation uses the specified zone parameters from the input parameter list (qc_ron_xmin, qc_ron_xmax, qc_ron_ymin, qc_ron_ymax, qc_ron_hsize, qc_ron_nsamp).
The FPN calculation uses similar zone parameters (qc_fpn_*).
Border pixels (4 on each edge, total 2048*8 + 2040*8) are excluded from the bad pixel count.

Definition at line 235 of file eris_ifu_dark_static.c.

References CATCH, CHECK_ERROR_STATE, eris_check_error_code(), eris_ifu_append_qc_double(), eris_ifu_append_qc_float(), eris_ifu_append_qc_int(), eris_ifu_free_hdrl_image(), eris_ifu_free_image(), eris_ifu_free_string(), eris_ifu_free_vector(), eris_ifu_hdrl_image_reject_mask(), hdrl_image_duplicate(), hdrl_image_get_image_const(), hdrl_image_get_mean(), hdrl_image_get_stdev(), hdrl_imagelist_get(), hdrl_imagelist_get_size(), and TRY.

Referenced by eris_ifu_dark_static().

◆ eris_ifu_dark_static()

cpl_error_code eris_ifu_dark_static ( const cpl_parameterlist *  parlist,
hdrl_imagelist *  darkImageList,
hdrl_parameter *  pdarkcollapse,
hdrl_image **  masterDarkHdrlImg,
cpl_image **  qualityImage,
cpl_image **  masterBpm,
cpl_image **  contribMap,
cpl_mask **  bpm2dMask,
cpl_mask **  bpm3dMask,
cpl_propertylist *  qcParams 
)

Determine master dark and bad pixel maps.

Parameters
parlistInput recipe parameters
darkImageListInput HDRL dark images list
pdarkcollapseInput collapsing method parameter for HDRL
masterDarkHdrlImgOutput master dark HDRL image (pointer to image pointer)
qualityImageOutput data quality indicator image (pointer to image pointer)
masterBpmOutput master bad pixel map image (pointer to image pointer)
contribMapOutput contribution map showing number of contributing frames per pixel (pointer to image pointer)
bpm2dMaskOutput bad pixel map from 2D analysis (pointer to mask pointer)
bpm3dMaskOutput bad pixel map from 3D analysis (pointer to mask pointer)
qcParamsQuality control parameters property list
Returns
CPL_ERROR_NONE on success, otherwise an error code

This function processes a list of dark frames to create a master dark image, noise map, and bad pixel maps using both 2D and 3D analysis methods. It also generates a data quality indicator (DQI) image that combines information from saturated pixels, border pixels, and both bad pixel map methods.

Note
The output images and masks must be freed by the caller using appropriate deletion functions (hdrl_image_delete, cpl_image_delete, cpl_mask_delete).
Border pixels (4 pixels on each edge) are automatically flagged as bad pixels.
QC parameters are computed and added to qcParams if it is not NULL.

Definition at line 75 of file eris_ifu_dark_static.c.

References CATCH, eris_check_error_code(), eris_ifu_calc_bpm(), eris_ifu_dark_get_dqi(), eris_ifu_dark_noise(), eris_ifu_dark_qc(), eris_ifu_free_hdrl_image(), eris_ifu_free_image(), eris_ifu_free_mask(), hdrl_image_create(), hdrl_image_get_image_const(), hdrl_image_get_mask_const(), hdrl_imagelist_collapse(), and TRY.