
Batch Multipeak Fitting changing input data wave

hegedus
Hi,
Doing some3 batch multipeak fitting and getting strange result. I have a directory structure with channel_0 - channel_7 each with a y data wave called sqrtdata. Initially I look at them and they are different as expected and are slightly different in length.
I use batch fitting to select the 8 samples and use some initial peak coefficients and baseline. They are all gaussians and set as such. The fit proceeds as expected and upon reviewing the results all the fits are exactly the same. And when I review the y wave used (sqrtdata) then are now also all the same as in directory channel_0.
Where do I go from here?
Andy




Hi,
Some follow up. Changed the initial directory structure to include the initial guesses in ALL the channel folders. In the batch fitting dialog I changed the initial guess option to "2. Provided Coef set for each data" with the same set of 3 waves and baseline wave.
Running with those options seemed to fit each y wave correctly without overwriting.
Andy
June 10, 2025 at 11:08 am - Permalink
Even if it worked for you with the workaround, it might be worthwhile to investigate if there is a bug (e.g., because the input wave name is the same throughout). Would you be willing to share a test experiment file with the setup from your first post?
June 10, 2025 at 06:17 pm - Permalink
Hi,
Attached is an experiment with data that shows the issue.
Two folders - first original which has the initial guesses and baseline in the "_0" folder and workaround which has the initial points in all the sub folders, "channel_X".
I used a custom string for the waves of "Gauss;Gauss;Gauss;" and a starting point of 2500. For the original I set the Initial Guess Values to option 0: Provided same for all data sets. Baseline tis set to constant.
In the workaround the only thing I changed was Initial Guess Values and that was set to "2: Provided Coef set for each data".
The X values are calculated.
Andy
June 11, 2025 at 08:33 am - Permalink
OK I found the issue. Your setup was at odds with the behavior of MPF: The result / output folders are not supposed to contain your input data. To resolve this, simply move your initial guess waves to a folder with a different name, e.g., "result_0" and set the output prefix to "result". The input can stay in your "channel" folders. Then the fit works just fine with guesses = 0. The cause was that mode 0 deletes all folders and then copies the first one. In general, I would not count on the persistence of the output folders, since they are, more often than not, completely wiped upon running AutoMPFit.
June 11, 2025 at 07:49 pm - Permalink