|
|
|
The Computing for Science (CS) group supports ILL scientists, students and visitors in a number of activities including data analysis, instrument simulation and sample simulation.

sasfit4 - fitting up to four peaks for sequences of SANS dataversion 1.3 R. Ghosh, ILL, April 2000 SummaryThis program uses the fitfun package to refine the starting parameters for fitting a sequence of diffraction patterns. A sequence of single runs with the same extension can then be analysed or runs which have been sectored with several resulting file extensionnumbers. Simple graphics are incorporated to enable the variation of derived peak parameters to be viewed and printed. The program fits up to four peaks, Gaussian, Lorentzian or Voigt profiles, which allow an interesting peak to be analysed when it is merging with other unchanging peaks. Fitting SequencesThere are two methods for fitting data (T or U). In the first case the trial fit parameters are re-used again and again. In the second, the previous fit serves as a starting point for the next in sequence. The first works well when the peak does not move. The second will follow a peak moving as the sequence evolves Example of sasfit4is1 109% sasfit4 Typically the user must use option F to choose some regrouped data to examine and trial fit an initial pattern: At this stage the program enters the fitfuns routines and a secondary choice of options is offered.
TYPE HELP OR OPTION: H,R,D,X,Y,V,F,O,P,L,W,C,E,J,S,T,Z FITTING..... Having now obtained a good set of starting parameters for fitting the sequence this is now performed: fit4>e SEQfit option F,C,D,P,T,U, Help or Exit : p 1 8 Summary of using fitfun to set up initial parametersThe pattern is read-in using the R command. The fitfun package offers a D (display option) to view the input data and cursors/scale settings etc. as well as the ability to trial fit the data manually, and with a number of automatic iterations. The current parameters are listed with the V command. The starting parameters can be modified with the V command setting an initial non-zero step if the parameter is to be refined. Normally the step is about unity. This is used as a local multiplier for the standard step defined in parameter 300 (typically 2%). When the fit appears very sensitive to the step size then reduce the individual parameter step, say to 0.05. If the fit appears very insensitive to the step increase the individual parameter step by a factor of say 20. Do not attempt to set steps for the parameters which control the type of model fit! The current variables can be saved with the S command manually. These will be reread should the program be interrupted and restarted. The fit is then started limiting the number of iterations to a maximum of 100. When the fit terminates these parameters can be transferred to the sequence treatment by exiting E from this manual phase. The results are stored temporarily. Fitting a sequence of SANS regrouped data filesThe principal program options now reappear and a sequence of runs and subpatterns may then be treated with the T or U command depending on whether the starting parameters are to be reinitialised or not. The program will treat ascending or descending series, to allow the best, but disappearing, peaks to be used to set the initial search state. When fitting becomes progressively more difficult certain parameters, notably the position, should be held fixed (step 0.0) which will limit the program from diverging when the peak is really difficult to resolve distinctly. The D command allows any of the fitted parameters to be plotted as a function of run number (D 1 n or extension number D 2 n. A hardcopy PostScript plot is generated using the P command similarly. The program produces a listing file of the summary, and the plot file is a PostScript plot. For spread-sheet use a summary file of twenty columns is produced including data on backgrounds. The flat background value is set at the center of the first peak (parameter 8). The final column contains a fit result. Usually this is 0, indicating that a minimum has been found without any problems. When set to 1 the final fit may not be the absolute minimum because the step sizes are typically too small for peak areas, or too large for positions. The manual fitfun option F can be used to modify this, or to examine the fit for any individual component, by opening that data file O, going back into fitfun F, and selecting the subspectrum in doubt, and reperforming the fit. Environment Variables used by the programsasfit4 uses environment variables to avoid repitition of questions concerning which type of graphics to use etc. Typical commands to set up this environment are: setenv PGPLOT_DIR /usr/ill/lib These control the graphical output. Feedback on these programs will be welcomed by the author, ron(at)ill.fr |