Common Pipeline Library Reference 7.3.2
|
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 *bias_image, 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. | |
cpl_error_code | cpl_flux_get_noise_window (const cpl_image *diff, const cpl_size *zone_def, cpl_size ron_hsize, cpl_size ron_nsamp, double *noise, double *error) |
Compute the readout noise in a rectangle. | |
cpl_error_code cpl_detector_interpolate_rejected | ( | cpl_image * | self | ) |
Interpolate any bad pixels in an image and delete the bad pixel map.
self | The image to clean |
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:
References cpl_ensure_code, cpl_error_get_code(), CPL_ERROR_INVALID_TYPE, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_image_accept_all(), cpl_image_get_bpm_const(), cpl_image_get_data(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_type(), cpl_mask_get_data_const(), CPL_TYPE_DOUBLE, CPL_TYPE_DOUBLE_COMPLEX, CPL_TYPE_FLOAT, CPL_TYPE_FLOAT_COMPLEX, and CPL_TYPE_INT.
cpl_error_code cpl_flux_get_bias_window | ( | const cpl_image * | bias_image, |
const cpl_size * | zone_def, | ||
cpl_size | ron_hsize, | ||
cpl_size | ron_nsamp, | ||
double * | bias, | ||
double * | error | ||
) |
Compute the bias in a rectangle.
bias_image | Input bias image |
zone_def | Zone where the bias is to be computed. |
ron_hsize | to specify half size of squares (<0 to use default) |
ron_nsamp | to specify the nb of samples (<0 to use default) |
bias | Output parameter: bias in the frame. |
error | Output parameter: error on the bias. |
References CPL_ERROR_NONE.
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.
diff | Input image, usually a difference frame. |
zone_def | Zone where the readout noise is to be computed. |
ron_hsize | to specify half size of squares (<0 to use default) |
ron_nsamp | to specify the nb of samples (<0 to use default) |
noise | On success, *noise is the noise in the frame. |
error | NULL, or on success, *error is the error in the noise |
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:
References cpl_bivector_delete(), cpl_bivector_get_x_data_const(), cpl_bivector_get_y_data_const(), cpl_ensure_code, CPL_ERROR_DATA_NOT_FOUND, CPL_ERROR_ILLEGAL_INPUT, CPL_ERROR_NONE, CPL_ERROR_NULL_INPUT, cpl_errorstate_get(), cpl_errorstate_is_equal(), cpl_errorstate_set(), cpl_image_get_size_x(), cpl_image_get_size_y(), cpl_image_get_stdev_window(), CPL_SIZE_FORMAT, cpl_vector_delete(), cpl_vector_get_median(), cpl_vector_get_stdev(), cpl_vector_new(), cpl_vector_set(), cpl_vector_unwrap(), and cpl_vector_wrap().
cpl_error_code cpl_flux_get_noise_window | ( | const cpl_image * | diff, |
const cpl_size * | zone_def, | ||
cpl_size | ron_hsize, | ||
cpl_size | ron_nsamp, | ||
double * | noise, | ||
double * | error | ||
) |
Compute the readout noise in a rectangle.
diff | Input image, usually a difference frame. |
zone_def | Zone where the readout noise is to be computed. |
ron_hsize | to specify half size of squares (<0 to use default) |
ron_nsamp | to specify the nb of samples (<0 to use default) |
noise | Output parameter: noise in the frame. |
error | Output parameter: error on the noise. |
This function is meant to compute the readout noise in a frame by means of a MonteCarlo approach. The input is a frame, usually a difference between two frames taken with the same settings for the acquisition system, although no check is done on that, it is up to the caller to feed in the right kind of frame.
The provided zone is an array of four integers specifying the zone to take into account for the computation. The integers specify ranges as xmin, xmax, ymin, ymax, where these coordinates are given in the FITS notation (x from 1 to lx, y from 1 to ly and bottom to top). Specify NULL instead of an array of four values to use the whole frame in the computation.
The algorithm will create typically 100 9x9 windows on the frame, scattered optimally using a Poisson law. In each window, the standard deviation of all pixels in the window is computed and this value is stored. The readout noise is the median of all computed standard deviations, and the error is the standard deviation of the standard deviations.
Both noise and error are returned by modifying a passed double. If you do not care about the error, pass NULL.
Possible _cpl_error_code_ set in this function:
References CPL_ERROR_NONE.