Multi-peak fitting on a graph with multiple data waves

I've been trying to perform some a multi-gaussian fit on some of my histogram data. However, I have multiple data waves on the same graph. I cannot seem to be able to get the multi-peak fitting package to be able to do the fitting on multiple data waves for the same graph. It keeps fitting to the same data wave. Is there a way around this?

Multipeak Fit was conceived for fitting one data set at a time. You might conceivably be able to do what you want if you start with a new MPF fit set for each data set. But all the extra stuff- the peak traces, fit curves, etc., are going to get at least jumbled and quite possibly re-drawn or totally munged (a technical term :).

I would recommend fitting with the Start Fresh option and not re-using a graph with multiple data sets on it.

Can you tell me how you conceive this working? That is, why do you want to do it that way?

I second the suggestion for fitting the data independently of the graph. Of course, you might use the graph to conveniently select the data by using the From Target checkbox. But then select New Graph from the Use Graph drop-down to fit in a separate graph. You can then append the fit results to your original graph at a later stage. For this, navigate to Packages:MultiPakFit2:MPF_SetFolder_XX (where XX corresponds to the set number of the fit). There you will find a wave 'fit_...' which is the total fit of your data, and Peak XX which are the individual peaks. Just append these waves to the original graph. They will also change should you update the fit at a later stage (however, if you add or remove peaks this might not go so well).

Would this be a point to propose a function+panel to shuffle a specific trace back and forth robustly from a stacked set to an individual graph? IOW, rather than modifying MPF to handle fitting to a specific trace in a stack/overlay of multiple traces, create a function + panel to pop/push a specific trace in a stack/overlay of multiple traces to its own display graph. At that point, one can run any number of "one trace only" package routines (e.g. baseline fit, MPF, ...).

Or, following the "step through traces" mode in the Scroll Traces package (https://www.wavemetrics.com/project/ScrollTracesPanel), hide all but one trace selectively and modify the functions to work only on the trace that is not hidden on the multiple trace layout.

IMHO, the first option would be more desirable, as it lends itself directly to being a front-end to other packages besides MPF that operate in a "one trace only" mode for their analysis.

One of the issues here is that Multipeak Fit adds lots of stuff to the graph. The option to use a pre-existing graph was to accommodate folks that load data, make a graph, and only then think about fitting peaks. Whether you start "fresh" or take over an existing graph, the graph becomes a stacked graph with individual peaks at the bottom, residuals at the top and in the middle the data being fit, the total fit curve and the background fit curve.

So you see, it becomes a very busy graph!

John ... Pardon ... my ignorance of MPF will show here. Suppose that a users has 10 traces on a graph. Suppose that a function or control panel allowed that user to extract trace 3 onto a stand-alone graph. Suppose this was done by duplicating the wave for trace 3 to a "standalone" wave. Suppose the user did MPF on the standalone wave. At the end, the user wants to store the results for that fit to its own set of waves or data folder location, keep those parameters "resident" for the graph, and substitute (swap out) trace 4 to become the new standalone wave. Before the user started a new fit to the replaced standalone wave, could that user designate a new storage set of waves or data folder? Or does MPF have a way to copy the results to a specific data folder before replacing the wave that is being fit. Almost like making "snap shots" of different options to fitting, where the primary parameter that is changed between snapshots is the underlying wave that is being fit.

In essence, I am proposing that the "pre-existing graph" idea will work with multi-trace graphs simply by having this approach

* display the multi-trace graph with 10 traces for waves wave01 to wave10
NEW PART HERE -->
* generate a one trace graph with wave01 DUPLICATED into standalone wave displayed as standalone trace
* fit to standalone wave
* store the fit results to their own datafolder
* swap out trace02 -> standalone wave
* fit ... and store to a different datafolder
* repeat to wave10

 

JJ, I am not sure I can follow your idea. Basically MPF works on waves, not traces. The option to use a pre-existing graph is just a convenience for the user. I would not recommend to do it that way, since it is always possible to add the fit results afterwards to a clean graph. As John already mentioned, in a multiple trace graph this is a quick route for cluttering up your precious graph.

And yes, one can select the wave being fitted in the graph by simply choosing the target y (and x) data in the startup panel. Also, MPF works in sets, so it is already possible to fit the same data again and again in different sets without ever duplicating the original data. In fact, this is a common way to clutter one's experiment. ;) (For this reason, there is an option to delete the latest MPF set, if one has accidentally created a set.)

I get the feeling we are also starting to move away from the original poster's question. It rather seems to me a question on how to select the desired data for a fit. Having a pre-existing graph or not, the answer is 'by selecting the waves as Y (and possibly X) input in the starter panel'.

chozo -- I imagine I am over engineering an answer to a problem that only exists in a limited corner of my own mind. I'll leave this to a later time when I am retired and have nothing else to do but hypothesize on hypotheticals. :-)