Muli peak fitting and batch fitting

I'd like some advice on MPF_AutoMPFit()

I have a bunch of 1d waves that can be described by two gaussians. They are reasonably well spaced apart with some overlap. I'm trying to write a function to look at the relative distances between peaks (wave to wave). I figured the best way to automate this was to use MPF to find both peaks for all waves. However, the data is noisy and the auto peak fit finds other peaks in the noise. Is it possible to constrain MPF so that it will only look for two Gauss?

As usual apologies if this is covered elsewhere. I can see how to persuade MPF 2.0 to only find two peaks by altering smoothing but I'm not sure that this is a good solution and how this would work in a batch case. Any help or comments would be appreciated.

I think the solution would be to use a different initial guess mode, probably in your case the best would be 0 or 1. With these modes, you create the first of the result data folders and put initial guesses in appropriate coefficient waves. A copy of the MPF_SetFolder_n that is created when you do a manual fit using the GUI, found in root:Packages:MultiPeakFit2: is an excellent way to create the waves you need, but it isn't required. The only difference between mode 0 and 1 is that with mode 0 your initial guesses are used for every data set, whereas with mode 1 each data set used the previous solution as the initial guess for the next. Mode 1 is often the best- it will track a drifting peak, and can save time by providing a better guess especially in the case of a peak that gradually moves or changes height. Mode 0 would be more appropriate for data sets with random small variations.

For you the advantage of these modes is that you don't depend on the auto peak picker doing the right thing automatically. The auto peak picker is pretty good but it is based on heuristics that are decidedly fallible. With data sets like yours that have a good deal of regularity, you are better off not using it if you don't have to.

John Weeks
WaveMetrics, Inc.