![](/profiles/wavemetrics/themes/wavemetrics/logo.png)
Two newbie problems: Igor can't "find" waves in an open table, and how to multipeak-fit all columns
![](/sites/www.wavemetrics.com/files/styles/thumbnail/public/default_images/Artboard%201_1.png)
Joshua_04
Sat, 02/18/2012 - 07:46 am
Would really appreciate any input on the following two things:
1) I use Igor 6.12A, and use excel import. Each wave is named by the excel column header. No problem. But after loading some different sheets and files etc into one experiment, when I go to Window->New Graph, I can't find any of the waves that I've imported. Even though they are in a table right in front of me. If I start a new experiment, reimport the excel file, then I can graph the columns, but I want to use my main experiment with all the graphs etc. Is this a bug or am I missing some fundamental thing?
2) What I really want to do, is import an excel file with arbitrary column names "alpha, beta,, etc", and process each of the waves (columns) in the following way: multipeak fit (like package version2), and extract the fit line fit_alpha, and save the fit_alpha. For simplicity, I can even overwrite the original alpha wave because I only want to process the fit.
Any help would be great.
If you have not already done it, take an hour or two and go through the first half of the Igor guided tour. Choose Help->Getting Started. This will save you many more hours than it takes and will make the Igor learning curve a lot less painful.
You can update for free to the latest, 6.22A. Choose Help->Updates for Igor.
Most likely the data was imported into text waves. This may be because of how it is stored in Excel or may be because you inadvertently selected "Treat all columns as text" in the Load Excel Binary File dialog. You need to load the data into numeric waves. If you can't figure this out, send the file and the command you used to load it to WaveMetrics support and I will investigate.
You can check the type of a wave using Data->Browse Waves.
Now I am thinking that the problem is that you loaded the data into different data folders. To learn about data folders, execute:
If you want to force specific wave names you can use the XLLoadWave /NAME flag. This is not available from the dialog, you must do it from the command line or from a user-defined function. To get help for XLLoadWave, choose Help->Command Help.
I presume that you want to automate this. I'm not familiar with programmatically using the MultiPeak Fit package. At any rate, start by getting everything working manually. To automate it you will need to learn at least the basics of Igor programming.
February 18, 2012 at 11:38 am - Permalink
I had basically done it, but I went back and had another go at the introduction.
I went ahead and did that, and noticed that actually the multi-peak fit function had been improved, which is nice.
The data seemed to have been loaded as numerical data, because I had been able to create both a table and graph up in front of me, but Data->Browse Waves wasn't showing them. Further investigation shows that all the waves seemed to have been moved into a nested folder (there are many) as a result of the multi-peak fitting function. This happened 3 times in a row, I kept starting a new experiment, loading data, plotting it, then fitting it and the waves would seem to disappear and I couldn't find it.
Anyway, for now I can find it, so that's some progress.
Thanks for that XLLoadWave /NAME flag tip, I'll look into it. I got the multipeak fit working manually. I had a look at the code for multi-peak fit, and it's a huge amount of code. I'm sure automating the input and output won't be easy, but I had assumed that running some operation on all arbitrarily named waves in a table or something would be trivial, but I couldn't figure out how to approach the problem. I'll keep working on it.
February 19, 2012 at 09:04 am - Permalink
I have a vague recollection that this may have been a bug in MPF2 (multi peak fit 2) in Igor Pro 6.12 that was corrected later.
If it is still happening in 6.22A then you will need to manually reset the current data folder. For a discussion of the "current data folder":
You're wading into the deep end of the pool. That said, the expert on MPF2 wrote this to another Igor user:
Here is a function that shows how to iterate through the waves in the top table:
String tableName = WinName(0, 2, 1) // Name of top visible table
if (strlen(tableName) == 0)
Abort "There are no visible tables"
endif
Variable index = 0
do
Wave/Z w = WaveRefIndexed(tableName, index, 1)
if (!WaveExists(w))
break // No more waves
endif
String path = GetWavesDataFolder(w, 2)
Print path
index += 1
while(1)
End
February 19, 2012 at 11:34 am - Permalink
HRodstein is correct- earlier versions of Multipeak Fit would, under certain circumstances, leave the current data folder set to the wrong data folder. It didn't move your waves, it moved the "view". Using MPF2 from 6.22a should not have that problem, but if you saved an experiment file with the current data folder incorrectly set, it will still be incorrectly set when you re-open it. All you need to do is drag the red arrow in the Data Browser back to root.
I don't know if it would be helpful- I wrote a function for another customer (quite a while ago) to apply MultipeakFit to all the rows or columns in a matrix. I could send you a copy if you like- write to support@wavemetrics.com.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
February 20, 2012 at 09:30 am - Permalink