High-Level Data Reduction Library: Fringing

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

Loading...
Searching...
No Matches
Functions
Fringing

This module contains functions to derive and subtract a master-fringe image. More...

## Functions
cpl_error_code | hdrl_fringe_compute (hdrl_imagelist *ilist_fringe, const cpl_imagelist *ilist_obj, const cpl_mask *stat_mask, const hdrl_parameter *collapse_params, hdrl_image **master, cpl_image **contrib_map, cpl_table **qctable)
| Calculates the master fringe and contribution map based on the.
cpl_error_code | hdrl_fringe_correct (hdrl_imagelist *ilist_fringe, const cpl_imagelist *ilist_obj, const cpl_mask *stat_mask, const hdrl_image *masterfringe, cpl_table **qctable)
| Scales and subtracts the master fringe from the images.

## Detailed Description

This module contains functions to derive and subtract a master-fringe image.

# Master-fringe computation

For the master-fringe estimation, the algorithm model the pixel intensity distribution in a given image as a mixture of two Gaussian distributions, whose means are the background and the fringe amplitudes, respectively:

Thus the density function of the intensity of an individual pixel is modeled as follows

The means and ( ) are proportional to the background amplitude and the fringe pattern amplitude, respectively. These values are used for normalization of the background and fringe amplitudes before stacking.

The parameters of the two Gaussian components are estimated from the density function of the pixel intensities by a nonlinear least squares fit algorithm. The algorithm requires as its input an estimated density function. Such an estimate is calculated in a preprocessing step as a truncated Hermite series:

where is the normalized Hermite function

and are, respectively, the sample mean and the sample standard deviation of pixel intensities in the given image. The truncation parameter is found experimentally, has been sufficient so far. The Hermite coefficients are computed as follows

where the summation extends over all pixel intensities , is the total number of pixels, and .

The following image shows a truncated Hermite series and its approximation by a Gaussian mixture.

# Master-fringe subtraction

For the master-fringe subtraction the algorithm computes fringe amplitudes for each individual image by a least squares fit of a linear combination of the estimated master-fringe and a constant background. Specifically, the th fringe is estimated as

where is the estimated stacked master-fringe, and is a constant representing the background. The unknown constants and are computed by a standard least squares fit preformed over the unmasked pixels.

## Function Documentation

## ◆ hdrl_fringe_compute()

cpl_error_code hdrl_fringe_compute | ( | hdrl_imagelist * | ilist_fringe,
|  | const cpl_imagelist * | ilist_obj,
|  | const cpl_mask * | stat_mask,
|  | const hdrl_parameter * | collapse_params,
|  | hdrl_image ** | master,
|  | cpl_image ** | contrib_map,
|  | cpl_table ** | qctable
| ) |  |

Calculates the master fringe and contribution map based on the.

Gaussian mixture model.

Parameters

  ilist_fringe | Image list from where to extract the fringes
  ilist_obj | Masks with the objects of the single images (or NULL)
  stat_mask | Static mask (or NULL)
  collapse_params | parameter controlling the collapse algorithm
  master | returned master fringe map
  contrib_map | returned contribution map of the master fringe map
  qctable | returned table containing quality control information (or NULL)

Returns
  the cpl error code in case of error or CPL_ERROR_NONE

The function calculates the master fringe and contribution maps of a list of (dithered) images. The background and fringe level are estimated as the mean values of a Gaussian mixture model to the image histogram. The histogram is approximated by a Hermite series before fitting the mixture model, in order to avoid possible problems with bin sizes.

The masks exclude the regions where the fringe is weak, and are essential for an accurate estimation of noisy images. The masks can be used to remove objects and bad regions from the fit as well: The algorithm combines the bad pixel map (from ilist_fringe), the object mask (from ilist_obj), and static mask (stat_mask) for the fringe computation itself, but uses only the combined bad pixel map and object mask for the final collapsing. This ensures that the master fringe is also calculated in regions excluded by the static mask.

Note
  Please note, that the function directly works on the passed hdrl imagelist (ilist_fringe) in order to save memory thus modifying the imagelist
  Error propagation: Please note, that the scaling factor derived and used in this function is considered to be noiseless, i.e. the associated error is supposed to be zero

## ◆ hdrl_fringe_correct()

cpl_error_code hdrl_fringe_correct | ( | hdrl_imagelist * | ilist_fringe,
|  | const cpl_imagelist * | ilist_obj,
|  | const cpl_mask * | stat_mask,
|  | const hdrl_image * | masterfringe,
|  | cpl_table ** | qctable
| ) |  |

Scales and subtracts the master fringe from the images.

Parameters

  ilist_fringe | Image list from where to subtract the master fringe
  ilist_obj | Masks with the objects of the single images (or NULL)
  stat_mask | Static mask (or NULL)
  masterfringe | master fringe to scale and subtract
  qctable | table containing quality control information (or NULL)

Returns
  the cpl error code in case of error or CPL_ERROR_NONE

The function subtracts a fringe correction image (master) from a set of input images (ilist_fringe). The amplitude of the fringes is computed for each input image and used to properly rescale the correction image before subtraction.

The masks exclude the regions where the fringe is weak, and are essential for an accurate scaling estimation of noisy images. The algorithm combines the bad pixel map (from ilist_fringe), the object mask (from ilist_obj), and static mask (stat_mask) for the scaling computation of the master fringe, but only uses the bad pixel map when subtracting the master-fringe. The object mask and static mask are ignored in this step. This ensures that the master fringe is properly subtracted (with error propagation) in all regions not affected by the bad pixel mask.

Note
  Please note, that the function directly works on the passed hdrl imagelist (ilist_fringe) in order to save memory thus modifying the imagelist i.e. removing the fringes directly from the original imagelist (ilist_fringe)
  Error propagation: Please note, that the scaling factor derived and used in this function is considered to be noiseless, i.e. the associated error is supposed to be zero