GAUSS
program GAUSS online helpLast update: 17 July 1998
Load and start GAUSS by the commands:
% gauss # in Unix gauss> open spc,spectrumfile # in program gauss gauss> open plot,plotfile, gauss> open log,logfile.New in version 6:
- data to be fitted need not be in 'spc' format. See NEW M.
- Nerr, condition code for fit success, available to CIO programs. See NERR.
log and plot files are created, if they don't exist already. DEFAULT for logfile is stdoutGeneral input conventions. Real and integer numbers are in free format, and separated by space, comma,end of line, or semicolon. semicolon also means: take default values for remaining arguments. Some sets of numbers MUST be on one and the same line. Type-ahead of numbers and strings is possible.
Example: M 580 620;SCAN;D 1 : set markers; scan for peaks; display.
What next
- Command survey
- The fitted function
- Fixers
- Supporting equations
- Initial estimates
- Further remarks
- Alphabetical list of GAUSS commands
CIO syntax is described in CIO command language
Command survey
- Get spectrum in memory
a) For spectra of integers, residing on disk, in "spc" format (The format produced by program CONTROL, command PUT) NEW D (only needed after previously used NEW M) OPEN spc, spectrumfile GET seq.nr. define current spectrum NEXT incr. of seq.nr. " " " b) For spectra already in memory, in a CIO array. NEW M array-name define current spectrum in memory. Alternative to GET and NEXT, for data read in by other commands. See RDAS, IMPORT. OFFSet ch.nr. define first channel's number Mark ch1,ch2 define fit region SHIft shift fit region
- Inspect fata
DIS display GOP set options for graphic output. SCAN peak search
- Prepare for fit
NPAR nlines,shape must be given before any of the following X,AMPL,FWHM,H,W,STEP enter initial estimates of peak parameters BKD " " " " background parms. ZX,ZAMP...ZBKD set fixers SUPport enter supporting equations
- Sstart fitting
FIT
- Output of results
Note enter a comment string to be put in output Type output results on terminal Log output results on log file GOP set options for graphic output. GRaph output on graphics terminal PLot output on plot file LPRINT After a fit some of the results are stored in CIO arrays with names X0, Centroid, Area,dArea, Gausar, Tail, and CIO variable Nerr. They may be written to the log file with command lprint, in any layout. Example: lprint area1= $(Area[1]) +- $(dArea[1]) One may also use general CIO command fprint, e.g.: fprint 8 $((i-3)*0.25+30) $(Area[1]+Area[2]) $(Gausar[3])
- Miscellaneous
FILL transfer of initial estimates to fit parameters. fill is executed automatically by 'fit' but must be given to output initial estimates by the commands under 5 above. POP transfer of fit parameters to initial estimates. STOP stop the program HELP For a list of available commands, type HELP * For help on a specific command, type HELP command For a general introduction, type HELP GAUSS
- CIO commands
Descriptions of various CIO commands may be found in the CIO online help file CIO online help. The CIO syntax is described in CIO command language.
The fitted function
The fitted function is: const+lin*(X-Xav)+quad*(X-Xav)**2 +sum-over-all-peaks of gaussian: A1*exp(-0.5 * { ( X-X0)/sigma }**2)+ optional foot: A2*exp((X-X0)*W/sigma)), optional step: height=A*S . foot and step cut off at X0 and folded with gaussian X0,A,Fwhm,Hv,W and S are peak parameters where A is such that peak area=A*Fwhm/), Fwhm = 2.35482*sigma, and Hv = A2/A1. In absence of a foot A=A1*1.06... Optionally, the exponential tail, exp(X0-X), and 'step' functions extend from X0 to infinity, instead of -inf to X0 (see NPAR).what next
Fixers
Fixers are used to set or release rigorous constraints on the fit. fixer=0: parameter free fixer=1: parameter fixed fixer=2: difference with param. of preceding peak is fixed fixer=3: ratio to param. of preceding peak is fixed The default values for fixers of peak shape parameters (F, H, W, S) are: fixer=0 for the first peak, and fixer=2 for the second and further peaks. If the initial estimates of these parameters are set to 0 for the second and further peaks, then this default causes all peaks to have the same shape. (See below for special interpretation of the value 0 for initial estimates) Examples: To get a linear background (no quadratic terms): B 0 0 0 ZB 0 0 1 To force the FWHM of peak1 and peak2 to be equal, while the value of this FWHM is to be fitted (initial estimate say 4) one may give the commands: Fwhm 4.0,4.0 [ or 'Fwhm 4.0, 0' ] ZFwhm 0, 2what next
Supporting equations
Supporting equations define constraints of an approximate nature, and may be used to supply a priori information, or to stabilize a singular fit. INPUT FORMAT SUPPORTING EQUATIONS: expression=r,dr expression consists of items separated by + - * or / item consists of letter, or letter followed by peak number letter=C,L,Q,X,A,F,H,W,S, for Const,Lin,Quad,Xc,A,Fwhm,H,W,S r and dr estimated value and error per eqn only + and -, or only / and *, and max. 4 items Use one line per equation, and terminate the list of equations by an empty line. The limit to the number of supporting equations allowed is 24. Supporting equations are saved and used again in subsequent fits, unless a new command 'support' is given, or the line shape is changed by command NPAR. A new command 'support', or a new command npar, cause previously given supporting equations to be forgotten Examples: To prevent parameters H and W to run out of control one might give: H=0,1 (meaning the relative foot height is 0 +/- 1) W=0.5,1 If the intensity ratio of peaks 3 and 4 is known to be 3 +/- 0.5: F3*A3/F4/A4=3.0,0.5what next
Initial estimates
Initial estimates and fixers are saved, and used again in subsequent fits. They are n o t overwritten by the results of the fit, except for the positions. The position estimates are overwritten by the results of the fit, and also by the estimates found by the command SCAN. SCAN also sets the number of lines, normally set by command NPAR. Apart from this, initial estimates retain their current value when they are not specified by the user, also if ',,' or `;' is given when a value is asked. If an estimate is set to zero, and its 'fixer' is not 1, a default value will be used in the fit, as follows. Parameter Default --------- --------------------------------------------------- C average of first and last data point L straight line through first and last data point Q 0 Xn 0 ?! (the program does not try to solve this for you) An data point at Xn, minus linear background. Fn if n=1, F=4 ; if n>1, Fn=F(n-1) Hn if n=1, H=0.2 ; if n>1, Hn=H(n-1) Wn if n=1, W=0.5 ; if n>1, Wn=W(n-1) Sn if n=1, S=0.005; if n>1, Sn=S(n-1) For not too complicated cases it will therefore be sufficient to specify the positions of all components, and the parameters F..S for the first component only. For close doublets and small peaks on a high background parameters A should also be specified. Others parameter estimates may then be set to zero, or left at zero; the fitting procedure won't change these values. The estimate for F of peak 1 is also the filter width used by SCAN. For the case you want to transfer the result of a fit to the list of begin estimates the command POP is provided.what next
Further remarks
The spectrum file may be a .DAT file, such as produced by command PUT in program APC, or program CONTROL. It is assigned to logical unit 1. One may change to a different file, without leaving program GAUSS, by the command: OPEN 1,filename; Files of other formats should be read into a user defined CIO array, e.g. by one of the CIO commands RDAS or IMPORT, and presented to the GAUSS subsystem by the command NEW M.what next
CIO variable Nerr
CIO variable Nerr should be tested in automated fit programs. It's value is one of the following 1 : succesful fit 2 : non-convergent 3 : singular 4 : parameter 0 or negative 5 : nothing to fit Examples: if Nerr > 2 ; error gauss fit error ; endif repeat 3; if Nerr == 2; pop; fit; endif; endrep;what next
Alphanetical list of GAUSScommands
Ampl
Set initial estimates of amplitudes.
Bkd
Set inital estimates of background parameters CONST, LIN, QUAD.
Dis
Display current spectrum region.
FILL
Transfer of initial estimates to fit parameters. FILL is executed automatically by FIT but must be given to output initial estimates by TYPE, PRINT, GRAPH, or PLOT.
FIT
Start fitting.
Fwhm
Set initial estimates of FWHMs.
GET
Get <seq.nr.> Get a spectrum from the diskfile assigned to LU 1. A command OPEN should have been given before. See also NEXT.
GOP
Set options for graphic output.
GRaph
Output results to graphics terminal. Output options may be set using GOP.
Hfoot
Set initial estimates of foot height parameter H.
Log
Output results to log file. A log file should be defined first using OPEN LOG <file name>.
LPRINT
Lprint <text> The line of text is written to the file to the log file. Special symbols such as '$', or a leading '?', are recognized. Numerical values may be converted to text with the $(expression,format) feature. Useful to output results of computations. See also: PRINT (a similar command for output to the screen) FPRINT (a similar command for output to other files) OPEN (how to open a log file) LOG (write results of last fit to the log file) NOTE. To mix output from GAUSS command LOG with other notes, use LPRINT, not "FPRINT 7". For text output to other files then "the" log file however, use of FFPRINT is the thing to do.
Mark
Mark <ch1> <ch2> Define the region to be fitted. Command GET should have been given before.
NEXT
NEXT <increment of seq.nr.>
NEW D, NEW M
Specify the type of input medium for data to be fitted. NEW D data on Disk, in spc format The command NEW D asks no further input. The user may give commands OPEN spc, GET, NEXT. NEW M <spectrum array> <notes> data in Memory. This commands disables GAUSS commands GET, NEXT (but not the CIO command GETSP). The user should fill the specified spectrum array by some command, e.g. RDAS or IMPORT.
NOTEs
NOTEs <string> Enter a comment string to be put in output
NPar
NPar <npeaks> <peak shape> Specify number of peaks to fit, and peak shape to use: peak shape 0=GAUSS pure gaussian 1=FOOT gaussian with low energy exponential tail 2=STEP gaussian with low energy step 3=FOOT+STEP gaussian with low energy tail and step -1=TAIL gaussian with high energy exponential tail -2=STEP gaussian with high energy step -3=TAIL+STEP gaussian with high energy tail and step The limit to the number of peaks that may be fitted simultaneously is currently set to 9.see The fitted function
OFFSet
OFFSet <ch.nr.> Define first channel's number. Example: To analyze a subspectrum starting at channel 1024 of the disk spectrum, type 'offset -1024'.
OPEN
The GAUSS command OPEN has two different forms a) OPEN <filetype> <filename> b) OPEN <unit number> <filename> <filetype> must be one of the strings spc, plot, or log. Standard assignments of unit numbers are: open spc,spectrumfile = open 1,spectrumfile open plot,plotfile = open 9,plotfile open log,logfile = open 7,logfile (see commands LOG, LPRINT) open pro,programfile = open 15,programfile (see command RUN) Files are created, if they don't exist already. If the file exists, output is appended (but not for the plotfile!!). For unit numbers other then the above, a file is opend for input/output via CIO commands, such as FPRINT, RDAS. Unit number must be in the range 0..15. In some versions command OPEN PLOT has no effect, and, for each plot, a separate plot file name is asked instead.
PLot
Output results to plot file. Output options may be set using GOP. A plot file should be defined first using 'open plot,file name'. In some versions command OPEN PLOT has no effect, and, for each plot, a separate plot file name is asked instead.
POP
Transfer fitted parameters to initial estimates. Useful to 'refine' a fit. (fit; pop; fit)
SCan
Peak search The current fit region is searched for peaks. The peak search routine makes use of the current value of FWHM, which should be set to an estimate of the half-width of a 'typical peak'. Estimated peak positions are output, together with a figure of merit, S. The number of peaks and the peak positions are also saved and may be used as default values in subsequent commands NPAR and X.
SHIft
Shift the fit region, by an amount equal to the size of the current region. See command MARK.
SUPport
See Supporting equations
Step
Set initial estimates of step height parameter S.
Type
Output results of a fit to the terminal
Wfoot
Set initial estimates of foot width parameter W. Remember that W is inversely proportional to the width of the foot.
X
Set initial estimates of foot height parameter H.
ZAmpl
Set fixers for the amplitudes. See Fixers
ZBkd
Set fixers for the background parameters CONST LIN, QUAD. See Fixers
ZFwhm
Set fixers for the FWHMs. See Fixers
ZHfoot
Set fixers for the foot heights. See Fixers
ZStep
Set fixers for the step heights. See Fixers
ZWfoot
Set fixers for the foot widths. See Fixers
ZX
Set fixers for the peak positions. See Fixers