PeakFucntions2 Gauss Peak Function Help

Hi All,

I've been writing a batch curve fit procedure using the MPF2_AutoMPFit() function.
I'm fitting gaussian peaks.
My resultant Peak Coefs wave, w, has w[0]=location, w[1] = mystery, w[2] = height.

I see that the three coefficients are related as follows: (form the PeakFunctions2.ipf)
Function GaussPeak(w, yw, xw)
    Wave w
    Wave yw, xw
   
    yw = w[2]*w[1]*SqrtPi*gauss(xw[p], w[0], w[1]/sqrt2)
end


I also see that there Gauss(r,c,w) function is different from the Gauss1D(w,x) which I'm a lot more familiar with. It states in the fitting procedure that default gauss peak is more accurate than the Gauss1D(w,x) version which I'm guessing is due to the iterative procedure which calculates the fit.
So the my questions are:
1) what is w[1]? It must be related to the width in some way?
2) How can I use these peak coefficients to calculate the FWHM of my fitted peak?
3) As a bonus can I calculate the peak area using these coefficients?

As using the MPF2 package outputs these results I'm sure there must be a way to use the already written functions in my batch procedure to extract the relevant data. Ultimately I'd like to have the peak position, peak height, peak FWHM and as a bonus peak area.

Thanks for your help!

Nicola



If you look at the next function after GaussPeak in PeakFunctions2.ipf I think you will find the answers to your questions. John Weeks will correct me if I'm wrong, but I think that GaussPeakParams(cw, sw, outWave) takes the coefficient and sigma waves (cw and sw) and uses these to calculate user-friendly parameters and their propagated uncertainties for MFP2 output.

So location = w[0], amplitude=w[2], width (i.e., sigma of the normal distribution represented by the peak * sqrt(2))=w[1], FWHM=width*2*sqrt(ln(2)), and area=amplitude*width*sqrt(Pi).
Hi Tony,

Thanks for your reply. That really helped me out. It turns out the reason I couldn't get my numbers to calculate a FWHM from the width was due to my inability to press enter on my computer's calculator!
I've just gone through the numbers again (using my calculator correctly) and it works fine. It's times like these I miss my casio.

Thanks for your help! I was convinced I was going mad for a bit there.

Nicola


I might also point out that MPF2_AutoMPFit() has a (recently added) input parameter called "doDerivedResults" which requests that all those friendly outputs should be generated by the function. It also appears that I have failed to update the help for MPF2_AutoMPFit(), so you need to check out the comments above the code. :(

The mysterious coefficient is, indeed, a version of the width. It is- get ready for this- sqrt(2)*stdev. This peculiar formulation has its roots in Igor's misty history from 30 years ago when floating-point computations were very slow...

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
n.black wrote:

Thanks for your reply. That really helped me out. It turns out the reason I couldn't get my numbers to calculate a FWHM from the width was due to my inability to press enter on my computer's calculator!
I've just gone through the numbers again (using my calculator correctly) and it works fine. It's times like these I miss my casio.
Nicola


Then maybe I have just the thing for you: http://www.igorexchange.com/project/CalcPad
:)