return the values of fitted peaks from multipeak fit

Hi all,

Is it possible to "remake" the fit_name curve that is produced by multipeak fit? I would like to extend the fit on the x-axis; I have some spectroscopic data with partial peaks that i would like to model in.

Here is the trouble i am running into:

junk = gauss1d(W_coef, xWave) can rebuild a single Gaussian peak produced by curvefit

junk = gauss1d('Peak 0 Coefs', xWave) cannot rebuild a single Gaussian peak produced by multipeak fit

Any clues as to why I can't remake a Gaussian using 'Peak 0 coefs'?
without having tried it and without having much experience with the multipeak fit package, but my first guess is that liberal names don't work here, e.g. names which require single quotes. Execute

displayhelptopic "wave names"

Try to avoid those liberal names wherever possible (rename to e.g. "Peak_0_Coefs")... usually they cause trouble especially in user defined functions.
The MultipeakFit package doesn't use the built-in gauss fit, that's why you can't do what you're trying to do. The actual fit function used by MultipeakFit is in an XOP, but there's a user-defined function version of it in the procedure file PeakFunctions2.ipf. To see it, select Windows->Procedure Windows->PeakFunctions2.ipf. The function is called GaussPeak(). Since it's an all-at-once fit function, you would have to call it like this:
GaussPeak('Peak 0 Coefs', junk, xWave)
It's not hard to make a new version that's not all-at-once:
static Constant SqrtPi = 1.77245385090552
static Constant sqrt2 = 1.4142135623731

Function GaussPeak(w, x)
    Wave w
    Variable x
   
    return w[2]*w[1]*SqrtPi*gauss(x, w[0], w[1]/sqrt2)
end


John Weeks
WaveMetrics, Inc.
support@wavemetrics.com