Peakgen()

Generates peak data from an X-array and peak parameters.

PEAKGEN() x=Realarray pars=Realarray Fits a selction of peaks to supplied data.
[:GAUSS] Gaussian
[:GEXP] Gaussian convolved with exponential
[:LOREN] Lorentzian
[:LEXP] Lorentzian convolved with exponential
[:VOIGT] Voigt
[:VEXP] Voigt convolved with exponential
[:POLY] Polynomial

example:

	# Produce data to show goodness of a previous fit
	>> y_fit = Peakgen:Lexp(centre_bins(w.x), res.pars)
	>> y_goodness = w.y - y_fit  # difference for plotting

Note: Centre_bins() reduces X-array length by one and picks bin centres.

 

Peakgen

The peakgen command is designed to be used in conjunction with the Peakfit() command, it allows a regeneration of the fitted peak, usually to allow a graphical comparison of the goodness of the fit.

Note that it is not essential to have done a Peakfit() command for the Peakgen() command to work. By supplying an X-array and suitable parameters, any of the peaks may be generated.

Parameters:

X (Realarray)

One dimensional X array, usually the same X-array which was supplied to the corresponding Peakfit() command.

Pars (Realarray)

The parameters defining the peak. See the Peakfit() command for a description of the individual parameters for each type of peak.

RESULT = (Realarray)

The result of the Peakgen() command is an array of Y-values, the same length as the supplied X-array which if plotted will give the required peak.