X-shooter Pipeline Reference Manual 3.8.15
Macros | Functions
xsh_fit_body.h File Reference

Go to the source code of this file.

Macros

#define TYPE_ADD(a)   CONCAT2X(a, CPL_TYPE)
 
#define TYPE_ADD_CONST(a)   CONCAT2X(TYPE_ADD(a),const)
 
#define IMAGE_GET_DATA   TYPE_ADD(cpl_image_get_data)
 

Functions

static void TYPE_ADD() irplib_fit_imagelist_polynomial (cpl_imagelist *self, const cpl_matrix *mh, const cpl_matrix *mv, const cpl_vector *x_pos, const cpl_imagelist *values, const cpl_vector *xpow, double xnmean, int np, int nc, cpl_image *fiterror)
 Fit a polynomial to each pixel in a list of images.
 
static void TYPE_ADD() irplib_fit_imagelist_residual (cpl_image *self, int jj, const cpl_vector *x_pos, const cpl_vector *xpow, const cpl_matrix *mx, const cpl_matrix *mb)
 Compute the residual of a polynomial fit to an imagelist.
 

Macro Definition Documentation

◆ IMAGE_GET_DATA

#define IMAGE_GET_DATA   TYPE_ADD(cpl_image_get_data)

Definition at line 23 of file xsh_fit_body.h.

◆ TYPE_ADD

#define TYPE_ADD (   a)    CONCAT2X(a, CPL_TYPE)

Definition at line 21 of file xsh_fit_body.h.

◆ TYPE_ADD_CONST

#define TYPE_ADD_CONST (   a)    CONCAT2X(TYPE_ADD(a),const)

Definition at line 22 of file xsh_fit_body.h.

Function Documentation

◆ irplib_fit_imagelist_polynomial()

static void TYPE_ADD() irplib_fit_imagelist_polynomial ( cpl_imagelist *  self,
const cpl_matrix *  mh,
const cpl_matrix *  mv,
const cpl_vector *  x_pos,
const cpl_imagelist *  values,
const cpl_vector *  xpow,
double  xnmean,
int  np,
int  nc,
cpl_image *  fiterror 
)
static

Fit a polynomial to each pixel in a list of images.

Parameters
selfPreallocated imagelist to hold fitting result
mhUpper triangular part of SPD Hankel matrix, H = V' * V
mvThe transpose of the Vandermonde matrix, V'
x_posThe vector of positions to fit (used for fiterror only)
valuesThe list of images with values to fit
xpowThe mindeg powers of x_pos (or NULL, when mindeg is zero)
xnmeanMinus the mean value of the x_pos elements (or zero)
npThe number of sample points (length of values and x_pos)
ncThe number of polynomial coefficients to determine per pixel
fiterrorWhen non-NULL, the error of the fit
Returns
void
See also
irplib_fit_imagelist_polynomial

Definition at line 44 of file xsh_fit_body.h.

References CPL_TYPE, irplib_fit_imagelist_residual_double(), irplib_fit_imagelist_residual_float(), irplib_fit_imagelist_residual_int(), irplib_matrix_product_transpose(), irplib_matrix_solve_chol_transpose(), irplib_polynomial_shift_double(), nx, ny, and TYPE_ADD_CONST.

◆ irplib_fit_imagelist_residual()

static void TYPE_ADD() irplib_fit_imagelist_residual ( cpl_image *  self,
int  jj,
const cpl_vector *  x_pos,
const cpl_vector *  xpow,
const cpl_matrix *  mx,
const cpl_matrix *  mb 
)
static

Compute the residual of a polynomial fit to an imagelist.

Parameters
selfPreallocated image to hold residual
jjThe index of the image row to compute
x_posThe vector of positions to fit (used for fiterror only)
xpowThe mindeg powers of x_pos (or NULL, when mindeg is zero)
mxThe transpose of the computed fitting coefficients
mbThe transpose of the values to be fitted
Returns
void
See also
irplib_fit_imagelist_polynomial()

The call requires nx * (np * (2 * nc + 1) + 1) FLOPs.

Definition at line 155 of file xsh_fit_body.h.

References CPL_TYPE, nx, and TYPE_ADD.