Performing operation on waves in multiple data folders
Agmals
First time diving into procedures with Igor. I was able to find and modify a procedure to load *.csv data into individual data folders in my experiment. Data browser snippet is shown as an example. Now I am trying to automate Smoothing function for all "Int" waves. However, I can not figure out how to make the procedure to look through each data folder. Any help is much appreciated.
GetIndexedObjName
andWaveList
and the example therein.Basically you would iterate over all datafolders, get a list of all desired waves in each of them and then do your operation on the waves.
PS:
First time Igor coders might benefit from the Guided Tour :)
October 15, 2013 at 07:22 am - Permalink
Wave/DF dataFolderList
String name // Name of wave to smooth
Variable numSmoothingPasses // e.g., 7
Variable numDataFolders = numpnts(dataFolderList)
Variable i
for(i=0; i<numDataFolders; i+=1)
DFREF df = dataFolderList[i]
Wave w = df:$name
Smooth numSmoothingPasses, w
endfor
End
Function Demo()
// Make sample data
NewDataFolder df0; DFREF df0; Make/O/N=100 df0:data = gnoise(1)
NewDataFolder df1; DFREF df1; Make/O/N=100 df1:data = gnoise(1)
NewDataFolder df2; DFREF df2; Make/O/N=100 df2:data = gnoise(1)
Make/O/N=3/DF/FREE dataFolderList
dataFolderList[0] = df0
dataFolderList[1] = df1
dataFolderList[2] = df2
SmoothWavesInDataFolders(dataFolderList, "data", 7)
End
Also there is a tutorial. Choose File->Example Experiments->Tutorials->Data Folder Tutorial.
The tutorial was written a long time ago before Igor had data folder references but it will still be useful.
October 15, 2013 at 07:25 am - Permalink
October 16, 2013 at 05:20 am - Permalink