After a raw spectrum is computed on the grid specified by **s=**, it can be
optionally smoothed using **fwhm=**, after which it is binned on the grid specified
by **g=**. This binning can be done in a number of ways (e.g. see **bin=** below).
Note that both grids need to be regular (use the notation *min:max:step*)
and *min<max*. An optional simple (0.5,1,0.5) hanning smoothing can be applied.
As last step before output noise can be added.

**x=***x1,x2,...*- X coordinates of the centroid(s) line(s). Multiple coordinates can be given here. There is no default, at least one value needs to be specified here.
**a=***a1,a2,...*- Amplitudes
for each line. If not enough values are given, the last value repeats.
The number of values should be the same as those in
**x=**. [1] **d=***d1,d2,...*- FWHM
of the lines (FWHM=2.355*sigma). If not enough values are given, the last
value repeats. The number of values should be the same as those in
**x=**. [1] **s=***min:max:step*- Points where to sample the lines. The values need to be
regular and increasing. Use Bmode=0 with specified
**x,a,d,s**to look at the raw spectrum. [Default: -16:16:0.01] **g=***min:max:step*- Points where to lay
the grid for binning. The values need to be regular and increasing, these
values are the midpoint of their cells, not the edges. (see
**bin=**). [Default: -16:16:1] **fwhm=**- If non-zero, smooth the raw points with a gaussian beam with given FWHM. [0]
**bin=t|f**- Use the simple way of binning by using a fine sample grid and sprinkling them into the bins? Or properly integrate the sample grid onto the bins? The latter prevents edge effect if Sample and Grid are commensurate. Default: t
**hanning=t|f**- Optional hanning applied to the gridded data. [Default: f]
**fft=t|f**- Use FFT to compute observed spectrum? (not implemented yet).
**rms=**- RMS value for the noise added to the spectrum before output. This can be done to either raw (mode=0) or binned (mode=1) spectrum. [Default: 0]
**seed=**- The usual random seed (see also
*xrandom(1NEMO)*). [Default: 0] **mode=**- Output mode. 0 will output the raw spectrum before smoothing and binning etc. 1=will output the final spectrum, after all binning and noise addition. [Default: 1]

tabblend x=-4,0,2 a=0.5,1,0.5 | tabplot - line=1,1 point=2,0.1and fitting a single gaussian

tabblend x=0 d=2.355 | tabnllsqfit - fit=gauss1d ### Warning [tabnllsqfit]: No initial estimates for gauss1d, attempting to get some Fitting a+b*exp(-(x-c)^2/(2*d^2)): a= -2.28081e-05 1.99529e-05 b= 0.960098 9.51577e-05 c= 1.11565e-20 0.000118163 d= 1.04196 0.000121485 rms2/chi2= 3.1717e-07Note the width d=1.04 is about 4% higher than expected due to some moderate binning.

To view a the line and the residuals from the fit:

tabblend x=0 d=2.355 rms=0.1 | tabnllsqfit - fit=gauss1d out=- | tabplot - 1 2,3 line=1,1 color=2,3

21-dec-2011V0.1 CreatedPJT 30-dec-2011V0.5 added rms to both mode=0 and mode=1PJT 1-jan-2012V0.8 added bin=PJT