Retrieving Curve Fit coeficients in procedure
| ltizei | February 25, 2010 - 05:50 | ||
|---|---|---|---|
|
Hello, I have written a script which automatically loads a sequence of spectra and fits gaussians to them. At each interation of while a new spectrum is fitted. I need to store information from the fitting coeficients, which are stored in W_coef wave. However, I cannot do it. I can make a graph with the fitted wave, but I cannot manipulate the coeficients one. Here is how I have been doing it. Luiz #pragma rtGlobals=1 // Use modern global access method. Prompt numspect, "How many spectra are there?" do End |
|||

Joined: 2007-06-29
Location: United States
In order to access the coefficient wave created by the fit, use a Wave statement:
Wave W_coef
right after the call to CurveFit. The Wave statement has two effects:
1) At compile time, it tells Igor's compiler that "W_coef" is the name of a wave. Otherwise, the compiler doesn't know what that name refers to. The Display operation doesn't need this because it can only take a wave as input, so it just assumes that it is the name of a wave.
2) At run time, it tells Igor to go look for a wave called "W_coef". It connects the real wave with a local symbolic name, "W_coef" that just happens to be the same name as the real name of the wave.
To read more about WAVE statements, execute this Igor command:
DisplayHelpTopic "Wave References"
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Joined: 2010-02-24
Location: France
Thank you johnweeks. It worked
Sorry for taking this long to reply.