Focus determination functions


Functions

double sinfo_new_gaussian_ellipse (double *xdat, double *parlist)
 Compute the value of a 2d Gaussian function at a given point.
void sinfo_new_gaussian_ellipse_deriv (double *xdat, double *parlist, double *dervs)
 calculates the partial derivatives for a 2d Gaussian i function with parameters parlist at position xdat
int sinfo_new_lsqfitd (double *xdat, int *xdim, double *ydat, double *wdat, int *ndat, double *fpar, double *epar, int *mpar, int *npar, double *tol, int *its, double *lab)
 Least-squares fit of a function to a set of data points.
int sinfo_new_fit_2d_gaussian (cpl_image *image, double *fit_par, double *derv_par, int *mpar, int lleftx, int llefty, int halfbox_x, int halfbox_y, int *check)
 fits the image of a point source by using a 2-D Gaussian fit.
cpl_image * sinfo_new_plot_gaussian (cpl_image *image, double *parlist)
 image of the 2D-Gaussian
float sinfo_new_determine_conversion_factor (cpl_imagelist *cube, float mag, float exptime, int llx, int lly, int halfbox_x, int halfbox_y, int *check)
 Determines the convertion factor for an instrument.
void sinfo_focus_determination_config_add (cpl_parameterlist *list)

Detailed Description

TBD

TBD

TBD

TBD


Function Documentation

float sinfo_new_determine_conversion_factor cpl_imagelist *  cube,
float  mag,
float  exptime,
int  llx,
int  lly,
int  halfbox_x,
int  halfbox_y,
int *  check
 

Determines the convertion factor for an instrument.

Parameters:
cube reduced data cube of a standard star
mag brightness of the standard star
exptime exposure time read from the fits header
llx lower left point of fitting box
lly lower left point of fitting box
halfbox_x half width of a box inside which a 2D-Gauss fit is carried out
halfbox_y half width of a box inside which a 2D-Gauss fit is carried out
check if search box is outside image definition.
Returns:
intensity conversion value: magnitude per counts/s. -FLT_MAX if error occurred.
determines an intensity conversion factor for the instrument by fitting a 2D-Gaussian to an collapsed image of a standard star with known brightness (only for non-AO observations). Then the resulting Gaussian is integrated and the counts are divided by the exposure time (Fits header information)

Definition at line 1452 of file sinfo_focus.c.

References sinfo_msg_error, sinfo_msg_warning, sinfo_new_fit_2d_gaussian(), and sinfo_new_gaussian_ellipse().

Referenced by sinfo_new_stdstar().

int sinfo_new_fit_2d_gaussian cpl_image *  image,
double *  fit_par,
double *  derv_par,
int *  mpar,
int  lleftx,
int  llefty,
int  halfbox_x,
int  halfbox_y,
int *  check
 

fits the image of a point source by using a 2-D Gaussian fit.

Parameters:
image reconstructed image of a point source
fit_par array of 7 free fit parameters of a 2D-Gauss
derv_par derivatives of the fit_par array
mpar mask to set free parameters, 1: free, 0: fixed.
lleftx lower left starting point of the box in which the fit is carried throught to find the maximum of point source image
llefty lower left starting point of the box in which the fit is carried throught to find the maximum of point source image
halfbox_x half box length in x-direction in pixels inside which the fit is carried through
halfbox_y half box length in y-direction in pixels inside which the fit is carried through
check check switch (start at 0 and is increased in case of failure
Returns:
number of needed iterations # -1 if an error occurred.
Remark on the fit results for the fit parameters (fwhmx and fwhmy and theta): theta will always be between -PI/4 and +PI/4, exchange of the fwhmx and fwhmy values corresponds to a shift of theta by PI/2. Consequently, an expected theta > |PI/4| will result in an exchange of the fwhm values and a shift of theta by PI/2 to a value < |PI/4| what yields exactly the same image.

Definition at line 923 of file sinfo_focus.c.

References NPAR, sinfo_msg_error, sinfo_msg_warning, and sinfo_new_lsqfitd().

Referenced by sinfo_new_determine_conversion_factor(), and sinfo_new_stdstar().

double sinfo_new_gaussian_ellipse double *  xdat,
double *  parlist
 

Compute the value of a 2d Gaussian function at a given point.

Parameters:
xdat position array
parlist parameters array:
# parlist[0]: center of Gaussian in x direction # parlist[1]: center of Gaussian in y direction # parlist[2]: Amplitude of the 2d Gaussian # parlist[3]: Background level # parlist[4]: FWHMx, fwhm of the axis of the ellipse near the x-axis # parlist[5]: FWHMy, fwhm of the axis of the ellipse near the y-axis # parlist[6]: theta, position angle of the fwhmx line (-PI/4 to PI/4)

Returns:
double value of the 2d Gaussian at position xdat.
Compute the value of a 2d Gaussian function at a given point. The ellptical 2D Gaussian is: F(x,y) = par(2) * EXP( -4.0*log(2.0)*[(xr/par(4))^2+(yr/par(5))^2]) + par(3), where: xr = x0 * cos(par(6)) + y0 * sin(par(6)) yr = -x0 * sin(par(6)) + y0 * cos(par(6)) and: x0 = x - par(0) y0 = y - par(1)

Definition at line 251 of file sinfo_focus.c.

Referenced by sinfo_new_determine_conversion_factor(), and sinfo_new_plot_gaussian().

void sinfo_new_gaussian_ellipse_deriv double *  xdat,
double *  parlist,
double *  dervs
 

calculates the partial derivatives for a 2d Gaussian i function with parameters parlist at position xdat

Parameters:
xdat positiona array
parlist parameter list: # parlist(0): center of Gaussian in x direction # parlist(1): center of Gaussian in y direction # parlist(2): Amplitude of 2d Gaussian # parlist(3): Background level # parlist(4): FWHMx # parlist(5): FWHMy # parlist(6): theta
dervs derivative value of a 2d Gaussian function at position xdat: # dervs[0]: partial derivative by center x # dervs[1]: partial derivative by center y # dervs[2]: partial derivative by the amplitude # dervs[3]: partial derivative by the background # dervs[4]: partial derivative by FWHMx # dervs[5]: partial derivative by FWHMy # dervs[6]: partial derivative by theta
Returns:
nothing, void

Definition at line 309 of file sinfo_focus.c.

int sinfo_new_lsqfitd double *  xdat,
int *  xdim,
double *  ydat,
double *  wdat,
int *  ndat,
double *  fpar,
double *  epar,
int *  mpar,
int *  npar,
double *  tol,
int *  its,
double *  lab
 

Least-squares fit of a function to a set of data points.

Parameters:
xdat,: position, coordinates of data points. xdat is 2 dimensional: XDAT ( XDIMG, NDAT )
xdim,: dimension of fit
ydat,: data points
wdat,: weights for data points
ndat,: number of data points
fpar,: on input contains initial estimates of the parameters for non-linear fits, on output the fitted parameters.
epar,: contains estimates of the errors in fitted parameters
mpar,: logical mask telling which parameters are free (non-zero) and which parameters are fixed (0)
npar,: number of function parameters ( free + fixed )
tol,: relative tolerance. sinfo_lsqfit stops when successive iterations fail to produce a decrement in reduced chi-squared less than tol. If tol is less than the minimum tolerance possible, tol will be set to this value. This means that maximum accuracy can be obtained by setting tol = 0.0.
its,: maximum number of iterations
lab,: mixing parameter, lab determines the initial weight of steepest descent method relative to the Taylor method lab should be a small value (i.e. 0.01). lab can only be zero when the partial derivatives are independent of the parameters. In fact in this case lab should be exactly equal to zero.
Returns:
returns number of iterations needed to achieve convergence according to tol. When this number is negative, the fitting was not continued because a fatal error occurred: # -1 too many free parameters, maximum is 32 # -2 no free parameters # -3 not enough degrees of freedom # -4 maximum number of iterations too small to obtain a solution which satisfies tol. # -5 diagonal of matrix contains elements which are zero # -6 determinant of the coefficient matrix is zero # -7 square root of a negative number
This is a routine for making a least-squares fit of a function to a set of data points. The method used is described in: Marquardt, J.Soc.Ind.Appl.Math. 11. 431 (1963). This method is a mixture of the steepest descent method and the Taylor method.

Definition at line 698 of file sinfo_focus.c.

References NPAR.

Referenced by sinfo_new_fit_2d_gaussian().

cpl_image* sinfo_new_plot_gaussian cpl_image *  image,
double *  parlist
 

image of the 2D-Gaussian

Parameters:
image,: image which should be fitted
parlist,: parameters of 2D-Gaussian
Returns:
image of the 2D-Gaussian

Definition at line 1328 of file sinfo_focus.c.

References sinfo_msg_error, and sinfo_new_gaussian_ellipse().


Generated on Wed Jan 17 08:33:45 2007 for SINFONI Pipeline Reference Manual by  doxygen 1.4.4