Common Pipeline Library Reference Manual  6.1.1
Functions
High-level functions to compute detector features

Functions

cpl_error_code cpl_detector_interpolate_rejected (cpl_image *self)
 Interpolate any bad pixels in an image and delete the bad pixel map.
cpl_error_code cpl_flux_get_bias_window (const cpl_image *diff, const cpl_size *zone_def, cpl_size ron_hsize, cpl_size ron_nsamp, double *bias, double *error)
 Compute the bias in a rectangle.
cpl_error_code cpl_flux_get_noise_ring (const cpl_image *diff, const double *zone_def, cpl_size ron_hsize, cpl_size ron_nsamp, double *noise, double *error)
 Compute the readout noise in a ring.

Detailed Description

Synopsis:
#include "cpl_detector.h"

Function Documentation

cpl_error_code cpl_detector_interpolate_rejected ( cpl_image *  self)

Interpolate any bad pixels in an image and delete the bad pixel map.

Parameters:
selfThe image to clean
Returns:
The _cpl_error_code_ or CPL_ERROR_NONE

The value of a bad pixel is interpolated from the good pixels among the 8 nearest. (If all but one of the eight neighboring pixels are bad, the interpolation becomes a nearest neighbor interpolation). For integer images the interpolation in done with floating-point and rounded to the nearest integer.

If there are pixels for which all of the eight neighboring pixels are bad, a subsequent interpolation pass is done, where the already interpolated pixels are included as source for the interpolation.

The interpolation passes are repeated until all bad pixels have been interpolated. In the worst case, all pixels will be interpolated from a single good pixel.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_DATA_NOT_FOUND if all pixels are bad
cpl_error_code cpl_flux_get_bias_window ( const cpl_image *  diff,
const cpl_size zone_def,
cpl_size  ron_hsize,
cpl_size  ron_nsamp,
double *  bias,
double *  error 
)

Compute the bias in a rectangle.

Parameters:
diffInput image, usually a difference frame.
zone_defZone where the bias is to be computed.
ron_hsizeto specify half size of squares (<0 to use default)
ron_nsampto specify the nb of samples (<0 to use default)
biasOutput parameter: bias in the frame.
errorOutput parameter: error on the bias.
Returns:
the _cpl_error_code_ or CPL_ERROR_NONE
See also:
cpl_flux_get_noise_window()
Note:
This function uses the pseudo-random number generator.
cpl_error_code cpl_flux_get_noise_ring ( const cpl_image *  diff,
const double *  zone_def,
cpl_size  ron_hsize,
cpl_size  ron_nsamp,
double *  noise,
double *  error 
)

Compute the readout noise in a ring.

Parameters:
diffInput image, usually a difference frame.
zone_defZone where the readout noise is to be computed.
ron_hsizeto specify half size of squares (<0 to use default)
ron_nsampto specify the nb of samples (<0 to use default)
noiseOutput parameter: noise in the frame.
errorOutput parameter: error on the noise.
Returns:
the _cpl_error_code_ or CPL_ERROR_NONE
See also:
cpl_flux_get_noise_window
Note:
This function uses the pseudo-random number generator.

The provided zone is an array of four integers specifying the zone to take into account for the computation. The integers specify a ring as x, y, r1, r2 where these coordinates are given in the FITS notation (x from 1 to nx, y from 1 to ny and bottom to top).

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if diff noise or zone_def is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the internal radius is bigger than the external one in zone_def
  • CPL_ERROR_DATA_NOT_FOUND if an insufficient number of samples were found inside the ring