High-Level Data Reduction Library: Bad Pixel Mask 3D Computation

High-Level Data Reduction Library 1.6.0 High-Level data reduction routines for ESO pipelines

Loading...
Searching...
No Matches
Functions
Bad Pixel Mask 3D Computation
Bad Pixel Detection

Algorithms to detect bad pixels on a stack of identical images like e.g. bias images. More...

Collaboration diagram for Bad Pixel Mask 3D Computation:

## Functions
hdrl_parameter * | hdrl_bpm_3d_parameter_create (double kappa_low, double kappa_high, hdrl_bpm_3d_method method)
| Creates BPM Parameters object for the imagelist method.
cpl_error_code | hdrl_bpm_3d_parameter_verify (const hdrl_parameter *param)
| Verify basic correctness of the BPM_3D parameters.
cpl_boolean | hdrl_bpm_3d_parameter_check (const hdrl_parameter *self)
| Check that the parameter is a BPM_3D parameter.
double | hdrl_bpm_3d_parameter_get_kappa_low (const hdrl_parameter *p)
| Access the kappa_low in the BPM_3D parameter.
double | hdrl_bpm_3d_parameter_get_kappa_high (const hdrl_parameter *p)
| Access the kappa_high in the BPM_3D parameter.
hdrl_bpm_3d_method | hdrl_bpm_3d_parameter_get_method (const hdrl_parameter *p)
| Access the method in the BPM_3D parameter.
cpl_parameterlist * | hdrl_bpm_3d_parameter_create_parlist (const char *base_context, const char *prefix, const hdrl_parameter *defaults)
| Create a parameter list for the BPM_3D computation.
hdrl_parameter * | hdrl_bpm_3d_parameter_parse_parlist (const cpl_parameterlist *parlist, const char *prefix)
| Parse a parameterlist to create input parameters for the BPM_3D.
cpl_imagelist * | hdrl_bpm_3d_compute (const hdrl_imagelist *imglist, const hdrl_parameter *params)
| detect bad pixels on a stack of identical images

## Detailed Description

Algorithms to detect bad pixels on a stack of identical images like e.g. bias images.

The routines in this module can be used to detect bad pixels on a stack of identical images like bias or dark images. The algorithm first collapses the stack of images by using the median in order to generate a master-image. Then it subtracts the master image from each individual image and derives the bad pixels on the residual-images by thresholding, i.e. all pixels exceeding the threshold are considered as bad. Please note, that the algorithm assumes that the mean level of the different images is the same, if this is not the case, the master-image as described above will be biased.

The calculation is performed by calling the top-level function hdrl_bpm_3d_compute() and the parameters passed to this function can be created by calling hdrl_bpm_3d_parameter_create().

## Function Documentation

## ◆ hdrl_bpm_3d_compute()

cpl_imagelist * hdrl_bpm_3d_compute | ( | const hdrl_imagelist * | imglist,
|  | const hdrl_parameter * | params
| ) |  |

detect bad pixels on a stack of identical images

Parameters

  imglist | input hdrl imagelist
  params | BPM_3D computation parameters

Returns
  cpl_imagelist where the newly rejected pixels are marked as unity.

The algorithm first collapses the stack of images by using the median to generate a master-image. Then it subtracts the master image from each individual image and derives the bad pixels on the residual-images by thresholding, i.e. all pixels strictly exceeding the threshold are considered as bad.

Three methods are currently available to derive the bad pixels on the residual images and can be set when creating the BPM_3D parameter via hdrl_bpm_3d_parameter_create():

- `method` = HDRL_BPM_3D_THRESHOLD_ABSOLUTE: It uses kappa_low and kappa_high as absolute threshold

- `method` = HDRL_BPM_3D_THRESHOLD_RELATIVE: It scales the measured rms on the residual-image with kappa_low and kappa_high and uses it as threshold. For the rms a properly scaled Median Absolute Deviation (MAD) is used.

- `method` = HDRL_BPM_3D_THRESHOLD_ERROR: It scales the propagated error of each individual pixel with kappa_low and kappa_high and uses it as threshold.

Note
  We assume that the images are already scaled outside this routine, i.e. their absolute levels match.

For a Gaussian distribution the Median Absolute Deviation (MAD) is a robust and consistent estimate of the Standard Deviation (STD) in the sense that the STD is approximately K * MAD, where K is a constant equal to approximately 1.4826

## ◆ hdrl_bpm_3d_parameter_check()

cpl_boolean hdrl_bpm_3d_parameter_check | ( | const hdrl_parameter * | self | ) |

Check that the parameter is a BPM_3D parameter.

Parameters

  self | The parameter to check

Returns
  True or False

## ◆ hdrl_bpm_3d_parameter_create()

hdrl_parameter * hdrl_bpm_3d_parameter_create | ( | double | kappa_low,
|  | double | kappa_high,
|  | hdrl_bpm_3d_method | method
| ) |  |

Creates BPM Parameters object for the imagelist method.

Parameters

  kappa_low | Low kappa factor for thresholding algorithm
  kappa_high | High kappa factor for thresholding algorithm
  method | used method

Returns
  The BPM_3D parameters object.

            It needs to be deallocated with hdrl_parameter_delete()

See also
  hdrl_parameter_delete()
  hdrl_bpm_3d_compute()

## ◆ hdrl_bpm_3d_parameter_create_parlist()

cpl_parameterlist * hdrl_bpm_3d_parameter_create_parlist | ( | const char * | base_context,
|  | const char * | prefix,
|  | const hdrl_parameter * | defaults
| ) |  |

Create a parameter list for the BPM_3D computation.

Parameters

  base_context | base context of parameter (e.g. recipe name)
  prefix | prefix of parameter, may be empty string
  defaults | default values

Creates a parameterlist with the BPM_3D parameters:

- base_context.prefix.kappa_low
- base_context.prefix.kappa_high
- base_context.prefix.method The CLI aliases omit the base_context.

## ◆ hdrl_bpm_3d_parameter_get_kappa_high()

double hdrl_bpm_3d_parameter_get_kappa_high | ( | const hdrl_parameter * | p | ) |

Access the kappa_high in the BPM_3D parameter.

Parameters

  p | The BPM_3D parameter

Returns
  The kappa_high

## ◆ hdrl_bpm_3d_parameter_get_kappa_low()

double hdrl_bpm_3d_parameter_get_kappa_low | ( | const hdrl_parameter * | p | ) |

Access the kappa_low in the BPM_3D parameter.

Parameters

  p | The BPM_3D parameter

Returns
  The kappa_low

## ◆ hdrl_bpm_3d_parameter_get_method()

hdrl_bpm_3d_method hdrl_bpm_3d_parameter_get_method | ( | const hdrl_parameter * | p | ) |

Access the method in the BPM_3D parameter.

Parameters

  p | The BPM_3D parameter

Returns
  The method

## ◆ hdrl_bpm_3d_parameter_parse_parlist()

hdrl_parameter * hdrl_bpm_3d_parameter_parse_parlist | ( | const cpl_parameterlist * | parlist,
|  | const char * | prefix
| ) |  |

Parse a parameterlist to create input parameters for the BPM_3D.

Parameters

  parlist | parameter list to parse
  prefix | prefix of parameter name

Returns
  Input parameters for the BPM_3D computation

Reads a parameterlist in order to create BPM image parameters. Expects a parameterlist containing:

- prefix.kappa_low
- prefix.kappa_high
- prefix.method

## ◆ hdrl_bpm_3d_parameter_verify()

cpl_error_code hdrl_bpm_3d_parameter_verify | ( | const hdrl_parameter * | param | ) |

Verify basic correctness of the BPM_3D parameters.

Parameters

  param | BPM image parameters

Returns
  CPL_ERROR_NONE if everything is ok, an error code otherwise