IIINSTRUMENT Pipeline Reference Manual  6.2.2
Functions
Fitting

Functions

cpl_imagelist * isaac_imagelist_fit_polynomial (const cpl_imagelist *ilist, const double *dit, int deg)
 Compute the non linearity of the detector. More...
 

Detailed Description

Function Documentation

◆ isaac_imagelist_fit_polynomial()

cpl_imagelist* isaac_imagelist_fit_polynomial ( const cpl_imagelist *  ilist,
const double *  dit,
int  deg 
)

Compute the non linearity of the detector.

Parameters
ilistThe list of exposures (images obtained with different DITs)
ditThe DIT values used
degThe polynomial degree for the fit
Note
dit must point to (at least) as many doubles as there are images in the list, otherwise the behaviour of the function is undefined.
The created imagelist must be deallocated with cpl_imagelist_delete().
Returns
The image list with the fit coefficients or NULL on error.

Image list can be CPL_TYPE_FLOAT

For each pixel, a polynomial representing the relation DIT=P(flux) is computed where: P(x) = a1*x + ... + an*x^n The returned image list contains deg+1 images. The deg first images contain the the deg first coefficients of the polynomial and the last image contains the error of the fit.

Possible CPL error codes set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if deg is not strictly positive
  • CPL_ERROR_TYPE_MISMATCH if the passed image list type is not supported
  • CPL_ERROR_INCOMPATIBLE_INPUT if deg exceeds the number of input images
  • CPL_ERROR_SINGULAR_MATRIX if there are no pixels with enough distinct values, in this case a retry with a reduced deg may work.

Definition at line 78 of file isaac_fit.c.