fittri in device=? mask1=? mask2=? ncomp=? cont=? centre=? peak=? fwhm=? cf=? pf=? wf=? comp=? logfil=?
This routine fits up to six triangular profiles at a time to a one-dimensional data set. This can be specified as an NDF section. The data set must extend along the spectroscopic axis.
mask = [MASK1(1);MASK2(1)] U [MASK1(2);MASK1(2)] U ... U [MASK1(MSKUSE);MASK2(MSKUSE)].
The elements of the MASK parameters are not checked for monotony. Thus intervals may be empty or overlapping. The number of intervals to be used is derived from the number of lower/upper bounds entered. Either MASK1 or MASK2 should be entered with not more numbers than mask intervals required.
F I T T R I After accessing the data and the (optional) plot device, the data will be subjected to a mask that consists of up to six abscissa intervals. These may or may not overlap and need not lie within the range of existing data. The masking will remove data which are bad, have bad variance or have zero variance. The masking will also provide weights for the fit. If the given data have no variances attached, or if the variances are to be ignored, all weights will be equal. After the data have been masked, guessed values for the fit are required. These are - the number of components to be fitted, - the value of any underlying constant continuum (this must be an a-priori known constant), - the components' guessed centre positions, - peak heights and - full widths at half maxima. Finally, - fit flags for each of the triangle parameters are needed. The fit flags specify whether any parameter is fixed, fitted, or kept at a constant ratio or offset to another fitted parameter. The masked data and parameter guesses are then fed into the fit routine. Single or multiple triangle fits are made to line features. Triangle fit parameters may be free, fixed, or tied to the corresponding parameter of another triangle component fitted at the same time. Peak and width are tied by fixing the ratios, the centre is tied by fixing the offset. Up to six triangle components can be fitted simultaneously. The fit is done by minimising chi-squared (or rms if variances are unavailable or are chosen to be ignored). The covariances between fit parameters - and among these the uncertainties of parameters - are estimated from the curvature of psi-squared. psi-squared is usually the same as chi-squared. If, however, the given data are not independent measurements, a slightly modified function psi-squared should be used, because the curvature of chi-squared gives an overoptimistic estimate of the fit parameter uncertainty. In that function the variances of the given measurements are substituted by the sums over each row of the covariance matrix of the given data. If the data have been re-sampled with a Specdre routine, that routine will have stored the necessary additional information in the Specdre Extension, and this routine will automatically use that information to assess the fit parameter uncertainties. A full account of the psi-squared function is given in Meyerdierks, 1992a/b. But note that these covariance row sums are ignored if the main variance is ignored or unavailable. If the fit is successful, then the result is reported to the standard output device and plotted on the graphics device. The final plot view port is saved in the AGI data base and can be used by further applications. The result is stored in the Specdre Extension of the input NDF. Optionally, the complete description (input NDF name, mask used, result, etc.) is written (appended) to an ASCII log file. Optionally, the application can interact with the user. In that case, a plot is provided before masking, before guessing and before fitting. After masking, guessing and fitting, a screen report and a plot are provided and the user can improve the parameters. Finally, the result can be accepted or rejected, that is, the user can decide whether to store the result in the Specdre Extension or not. The screen plot consists of two view ports. The lower one shows the data values (full-drawn bin-style) overlaid with the guess or fit (dashed line-style). The upper box shows the residuals (cross marks) and error bars. The axis scales are arranged such that all masked data can be displayed. The upper box displays a zero-line for reference, which also indicates the mask. The Extension provides space to store fit results for each non-spectroscopic coordinate. Say, if you have a 2-D image each row being a spectrum, then you can store results for each row. The whole set of results can be filled successively by fitting one row at a time and always using the same component number to store the results for that row. (See also the example.) The components fitted by this routine are specified as follows: The line names and laboratory frequencies are the default values and are not checked against any existing information in the input's Specdre Extension. The component types are 'triangle'. The numbers of parameters allocated to each component are 4, the three guessed and fitted parameters and the line integral. The parameter types are in order of appearance: 'centre', 'peak', 'FWHM', 'integral'.
fittri in device=xw mask1=-1.5 mask2=2.5 ncomp=1 cont=1.0 centre=0.5 peak=-0.5 fwhm=1.5 cf=0 pf=0 wf=0 comp=1 logfil=line This fits a single triangular profile to the x range [-1.5,2.5]. The continuum is assumed to be constant at 1.0. The triangle is guessed to be centred at 0.5 with width 1.5. It is guessed to be an absorption line with an amplitude of -0.5. All triangle parameters are free to be fitted. The fit result is reported to the text file LINE and stored as component number 1 in the input file's Specdre Extension. Since DIALOG is not turned off, the user will be prompted for improvements of the mask and guess, and will be asked whether the final fit result is to be accepted (stored in the Extension and written to line). The xwindows graphics device will display the spectrum before masking, guessing, and fitting. Independent of the DIALOG switch, a plot is produced after fitting. fittri in(,5) device=! mask1=-1.5 mask2=2.5 ncomp=1 cont=0.0 centre=0.5 peak=13.0 fwhm=1.5 cf=0 pf=0 wf=1 comp=0 logfil=! dialog=f This fits a single triangular profile to the x range [-1.5,2.5] of the 5th row in the 2-D image IN. The baseline is assumed to be constant at 0.0. The triangle is guessed to be centred at 0.5 with width 1.5. It is guessed to be an emission line with an amplitude of 13. Centre position and peak height are free to be fitted, but the width is fixed to 1.5. User interaction (DIALOG) and plotting (DEVICE) are de-selected. There is also no log file where to the results are written. If INFO were also switched off, no report whatsoever would be made. However, the results are stored as a new component (COMP=0) in the Specdre Extension of the input file.
This routine works in situ and modifies the input file.
Meyerdierks, H., 1992b, Fitting resampled spectra, in P.J. Grosbol, R.C.E. de Ruijsscher (eds), 4th ESO/ST-ECF Data Analysis Workshop, Garching, 13 - 14 May 1992, ESO Conference and Workshop Proceedings No. 41, Garching bei Muenchen, 1992
FIGARO A general data reduction system