Functions for flatfielding

Functions

cpl_imagelist * irplib_flat_fit_set (cpl_imagelist *raw, int mode)
 Compute a flat-field out of a set of exposures.
double * irplib_flat_fit_slope_robust (double *x, double *y, int np)
 Fit a slope to a list of points (robust fit).

Function Documentation

cpl_imagelist* irplib_flat_fit_set ( cpl_imagelist *  raw,
int  mode 
)

Compute a flat-field out of a set of exposures.

Parameters:
raw Input image set
mode 0 for proportional, 1 for robust fit
Returns:
1 newly allocated set of 2 or 3 images

The input is assumed to be a cube containing planes of different intensities (usually increasing or decreasing). Typical inputs are: twilight data sets, halogen lamp, or skies of different airmasses in the thermal regime.

The input image list must be of type float.

In robust mode, the output is a set of 3 images. The first image contains a regression map, i.e. for each pixel position on the detector, a curve is plotted of the pixel intensity in each plane against the median intensity of the plane. A slope is fit, and the gain factor is stored into this first image.

The second image contains the y-intercepts of the slope fit. It is usually good to check it out in case of failures.

The third image contains the sum of squared errors for each fit. The fit is using a robust least-squares criterion rejecting outliers. This is the algorithm to use with big telescopes like the VLT, which collect so much light that objects are actually seen in the twilight sky.

In proportional mode, the output is a set of 2 images. The first image contains a regression map. The second image contains the sum of squared errors for each fit.

Definition at line 87 of file irplib_flat.c.

References irplib_flat_fit_slope_robust().

double* irplib_flat_fit_slope_robust ( double *  x,
double *  y,
int  np 
)

Fit a slope to a list of points (robust fit).

Parameters:
x x coordinates
y y coordinates
np number of points
Returns:
Pointer to newly allocated array of 3 doubles.

The slope to fit has the following kind of equation: y = c[0] + c[1] * x

The returned coefficients are defined as: c[0] is the y-intercept. c[1] is the slope. c[2] is the median squared error of the fit. This is a very robust slope fit. It tolerates up to 50% of outliers in input.

Definition at line 191 of file irplib_flat.c.

Referenced by irplib_flat_fit_set(), and irplib_slitpos_analysis().


Generated on 3 Mar 2013 for DETMON Pipeline Reference Manual by  doxygen 1.6.1