Multi-Peak Fitting Repetitive function

Hello,

I am treating temperature dependent Infra-red spectra and therefore trying to code a function that will perform a multi-peak fit on a definite region on the spectra.
My data is organised as a single X wave and several Y waves (one per degree). I have managed for now to code this for a simple gaussian fit and now i am struggling to make it perfrom a multi-peak fitting.

Here is the basic code i have written if it can help.

Function TEST(baseName, fitname, startIndex, endIndex)
String baseName, fitname
Variable startIndex, endIndex

Variable index = startIndex
do
Wave w = $(baseName + num2istr(index))
Display w vs wave0
Setaxis bottom 2200, 2300
Make/D/O/N=4 $(fitname + num2istr(index))
Wave v= $(fitname + num2istr(index))
CurveFit/NTHR=0/M=2/W=0/TBOX=(0x309) gauss kwCWave=v, w[3722,3837]/X=wave0[3722,3837] /D
Index +=1
while (index<= endIndex)
End


I would be extremly grateful if someone could find the time to help me.

Thank You.

Corbeau Mort
Using Multipeak Fit is quite different from doing a single curve fit. If you haven't used Multipeak Fit before, I suggest you try it out on a single data set first, using the GUI. That will let you get some experience with how it works.

Multipeak Fit comes with a function for doing batch fits that you may be able to use, or at least that you might be able to modify for your needs:

DisplayHelpTopic "MPF2_AutoMPFit()"

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Thanks for the advice.

Sorry to bother you once more but how can I impose a subrange with the "MPF2_AutoMPFit" function??
Corbeau_Mort wrote:
Thanks for the advice.

Sorry to bother you once more but how can I impose a subrange with the "MPF2_AutoMPFit" function??

That is one of the things that will require modifications to MPF2_AutoMPFit(). Interestingly, another of our programmers recently answered a similar question as a tech support incident. If you e-mail support@wavemetrics.com, perhaps he would share his answer with you.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Thanks Again,

I solved this problem by interpolating my waves and creating duplicate over the specific subrange and finally fitting the duplicates.

Corbeau Mort