How to export coefficient values for wave generated from curve fitting?

I have fit hundreds of waves to various graphs on my Experiment. I have been collecting the parameters from these fits from the Igor History (using a Python program to parse it). I was wondering, is there a way to directly export wave fitting parameters after they have been fit?

If use "Browse Waves" I can see that the "Wave Notes" includes the fitting parameters and coefficients, but I don't see a way to save these except to save a binary Igor file with "Save A Copy" which won't work, since I want just the Wave Note text.

Thanks!
When you do a fit, by default Igor will create the wave W_coef containing your fit coefficients. Unfortunately, it will get overwritten by the next fit. But if you rename it after the fit, or use your own coefficient wave with a different name, then it will survive and you can export that wave.

Note also that the history report has only six digits of precision. Especially for polynomial fits that may not be enough. Saving the coefficient wave preserves full double-precision accuracy.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
johnweeks wrote:
When you do a fit, by default Igor will create the wave W_coef containing your fit coefficients. Unfortunately, it will get overwritten by the next fit. But if you rename it after the fit, or use your own coefficient wave with a different name, then it will survive and you can export that wave.

Note also that the history report has only six digits of precision. Especially for polynomial fits that may not be enough. Saving the coefficient wave preserves full double-precision accuracy.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com


Thanks John, you are helping me out a lot this week!

I'm not concerned about precision - I only need three digits actually. I thought about setting new W_coef's, and will probably implement that in the future, but currently I need something that will work on previously analyzed data.

Is there not a way to just export the "Wave Note" of each wave to a text file? That would suffice perfectly for what I need (which is just the parameters of each fit). This would be better than my parsing of the history file because then I don't have to keep track of removing old waves and replacing them as I parse the history.

Right now, my colleagues type in the coefficients directly into excel, but this doesn't scale well with thousands of fits.
The wave note can be captured to a text string, dumped to a notebook, and then exported.

I might iterate over the waves using this idea, then post process the note book file as needed.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
jjweimer wrote:
The wave note can be captured to a text string, dumped to a notebook, and then exported.

I might iterate over the waves using this idea, then post process the note book file as needed.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH


Thanks, this is exactly what I was looking for.

Specifically I've found a function note(waveName) which prints out the wave note. I will just make a loop and output this to a file as suggested.

Here is my code, if anyone down the line is interested:

Function DumpData()
    String curvesInExperiment = WaveList("*",";","")
    Variable curveNum = ItemsInList(curvesInExperiment)
    variable i
    for(i=0; i<=curveNum; i+=1)
            String curveN = StringFromList(i,curvesInExperiment)
            Print curveN
            String waveText = note($curveN)
            Print waveText
    endfor
End