SINFONI Pipeline Reference Manual  2.6.0
Boltzmann function operations

sinfo_new_boltz

calculates the value of a Boltzmann function with parameters parlist at the position xdat

Parameters
xdatposition array
parlistparameter list
                 The parameters are:
     #            parlist(0): background1
     #            parlist(1): background2
     #            parlist(2): central position
     #            parlist(3): width
Returns
function value of a Boltzmann function that is y = (parlist(0) - parlist(1)) / (1+exp((x-parlist(2))/parlist(3))) + parlist(1)
float sinfo_new_boltz (float *xdat, float *parlist)
 

sinfo_new_boltz_deriv

calculates the partial derivatives for a Boltzmann function with parameters parlist at position xdat

Parameters
xdatposition array xdat
parlistparameter list

The parameters are:

parlist(0): background1

parlist(1): background2

parlist(2): central position

parlist(3): width

Parameters
dervsderivative value of a Boltzmann function at\ position xdat: dervs

dervs[0]: partial derivative by background1

dervs[1]: partial derivative by background2

dervs[2]: partial derivative by central position

dervs[3]: partial derivative by the width

Returns
nothing, void
void sinfo_new_boltz_deriv (float *xdat, float *parlist, float *dervs)
 

sinfo_new_lsqfit

makes a least-squares fit of a function to a set of data points.

Parameters
xdatposition, coordinates of data points. xdat is 2 dimensional: XDAT ( XDIM, NDAT )
xdimdimension of fit
ydatdata points
wdatweights for data points
ndatnumber of data points
fparon input contains initial estimates of the parameters for non-linear fits, on output the fitted parameters.
eparcontains estimates of the errors in fitted parameters
mparlogical mask telling which parameters are free (non-zero) and which parameters are fixed (0)
nparnumber of function parameters ( free + fixed )
tolrelative 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.
itsmaximum number of iterations
labmixing 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
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 sinfo_matrix contains elements which

are zero

-6 determinant of the coefficient sinfo_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.

int sinfo_new_lsqfit (float *xdat, int *xdim, float *ydat, float *wdat, int *ndat, float *fpar, float *epar, int *mpar, int *npar, float *tol, int *its, float *lab)
 

sinfo_new_fit_slits_boltz

fits the beginning and end position of the slitlets by using non-linear least square fitting of a Boltzmann function fits a Boltzmann function to the slitlet edges exposed and indicated by the brightest emission lines.

Parameters
lineImageemission line frame
parfit parameter data structure of fitted lines
slit_posallocated dummy array for the slitlet positions [32][2]
box_lengthpixel length of the row box within the fit is done
y_boxsmall box in spectral direction within the slitlet may lie.
diff_tolmaximum tolerable difference of the resulting fit position with respect to the expected position. If difference is greater the expected position is taken.
Returns
slit_pos: beginning and end position of the slitlets to sub-pixel accuracy

0 if it worked,

-1 if there was no line image given,

-2 if there were no line fit parameters given,

-3 if there was no dummy array for the slit positions

allocated

-4 if the given box length is impossible

-5 if the given y box length is impossible

-6 if the given difference tolerance is too small

-7 if there were no emission lines found in the first

image columns

-8 if not all slitlets could be found

fits the beginning and end position of the slitlets by using non-linear least square fitting of a Boltzmann function fits a Boltzmann function to the slitlet edges exposed and indicated by the brightest emission lines. To achieve this, the fit parameters are used to find the brightest emission line and to get its position for each column. The least squares fit is done by using a box smaller than the size of two slitlets


int sinfo_new_fit_slits_boltz (cpl_image *lineImage, FitParams **par, float **slit_pos, int box_length, float y_box, float diff_tol)
 

sinfo_new_fit_slits_boltz_single_line

fits the beginning and end position of the slitlets by using non-linear least square fitting of a Boltzmann function

Parameters
lineImageemission line frame
slit_posallocated dummy array for the slitlet positions [min32][2]
box_lengthpixel length of the row box within the fit is done
y_boxsmall box in spectral direction within the slitlet may lie.
low_pospixel positions in spectral direction between which the line should be located.
high_pospixel positions in spectral direction between which the line should be located.
Returns
slit_pos: beginning and end position of the slitlets to sub-pixel accuracy

0 if it worked,

-1 if it failed,

fits the beginning and end position of the slitlets by using non-linear least square fitting of a Boltzmann function fits a Boltzmann function to the slitlet edges exposed and indicated by the brightest emission lines. The slitlet is searched with user given positions. The least squares fit is done by using a box smaller than the size of two slitlets

int sinfo_new_fit_slits_boltz_single_line (cpl_image *lineImage, float **slit_pos, int box_length, float y_box, int low_pos, int high_pos)
 

sinfo_new_fit_slits_boltz_with_estimate

its the beginning and end position of the slitlets by using non-linear least square fitting of a Boltzmann function

Parameters
lineImageemission line frame
slit_posestimation array for the slitlet positions [min32][2]
box_lengthpixel length of the row box within the fit is done
y_boxsmall box in spectral direction within the slitlet may lie.
diff_toltolerance on slitlets position
low_pospixel positions in spectral direction between which the line should be located.
high_pospixel positions in spectral direction between which the line should be located.
Returns
slit_pos beginning and end position of the slitlets to sub-pixel accuracy

0 if it worked,

-1 if it failed,

Note
fits the beginning and end position of the slitlets by using non-linear least square fitting of a Boltzmann function fits a Boltzmann function to the slitlet edges exposed and indicated by the brightest emission lines. The slitlet is searched within user given positions. The least squares fit is done by using a box smaller than the size of two slitlets
int sinfo_new_fit_slits_boltz_with_estimate (cpl_image *lineImage, float **slit_pos, int box_length, float y_box, float diff_tol, int low_pos, int high_pos)
 

Detailed Description

routines to determine the absolute positions of the slitlets out of an emission line frame