Renaming Multiple Waves

Hello,
I am very new to Igor and programming in general and I need some help renaming multiple waves using one command. I have loaded a file containing 413 waves corresponding to spectral data recorded in sequential time intervals over a specified wavelength range. The first row in the .csv file I loaded contains the time interval (a numerical value only, no units) that corresponds to each spectral scan and the first column in the .csv file contains the wavelength range for all of the remaining 412 waves of spectral information. I want the use the time intervals as the name of each wave instead of "wave0, wave1,...,wave413" but I can't quite get it to work in LoadWaves. I tried using the "tweaks" button to specify that I wanted the first row of values to be used as the names of the waves, but it isn't working. I have tried converting the row of numerical time interval values to "text" format in excel and then loading the excel file and changing several other of the "tweaks", but nothing has produced the desired result thus far. Some of the values in my .csv file did read NaN, I am not sure if this will cause a problem or not. Can you please suggest a way to do this without having to rename each wave by hand using the "Rename Waves" functionality? Thanks!

-Megan
Create a zip archive of you data file or of a representative subset of it and attach it to a post. I will take a look at it.
hrodstein wrote:
Create a zip archive of you data file or of a representative subset of it and attach it to a post. I will take a look at it.


Here is the .csv file. Thanks!
:) Megan
MSL1-IrPBbpy_scan1.csv.zip (289.91 KB)
Igor is looking at the first line in the file and saying "This looks like data to me, not names, so I will treat it as data". Thus to use the first line as wave names will take some extra effort.

I have written a procedure to load your file and set the wave names. The procedure is in the attached file.

The procedure works as follows:
1. Load the first line using FReadLine
2. Create a string suitable for the LoadWave /B flag to control the wave names
3. Call LoadWave

NOTE: The first row contains some duplicate numbers. For example, "-2.50000" appears twice. This causes Igor to display a dialog in which you can fix the name conflicts, for example by changing one of them to "-2.50000A". Once you fix all of the duplicates the dialog will let you proceed with the load operation.

To run the procedure execute Data->Load Megan File.

To view the procedure code choose Windows->Procedure Window.

The procedure loads the waves into a new data folder named after the file. You should familiarize yourself with data folders by executing:
DisplayHelpTopic "Data Folders"

Names like "-2.50000" are what we call "liberal" names. Standard names can't contain punctuation like minus and dot. Using liberal names is a bit more involved than using standard names. To learn about this, execute:
DisplayHelpTopic "Object Names"

It may be that you would be better off loading the data into a matrix rather than into 413 separate waves. You would need one wave for the wavelengths and one matrix wave for all of the data. But it depends on how you will use the data. To load into a matrix use LoadWave/J/M. I would load all of the data with one call to LoadWave and then split the wavelength column into a separate 1D wave using Duplicate/R. Then I would delete the first column from the matrix using DeletePoints.

Once you have this working to your satisfaction you should save it as a "global" procedure file so you can use it from any experiment. To learn about this, execute:
DisplayHelpTopic "Global Procedure Files"
Load Megan File.pxp (50.64 KB)