1D waves -> Multidimensional wave issue. (Indexing?)
reepingk
waterfallWave[][0] = 'wave1.0'
waterfallWave[][1] = 'wave1.1'
waterfallWave[][2] = 'wave1.2'
waterfallWave[][3] = 'wave1.3'
waterfallWave[][4] = 'wave1.4'
waterfallWave[][1] = 'wave1.1'
waterfallWave[][2] = 'wave1.2'
waterfallWave[][3] = 'wave1.3'
waterfallWave[][4] = 'wave1.4'
The above is in the command line, not in a procedure yet.
The first command works as expected. However, the remaining 4 do not. I'm guessing that igor is attempting to assign the "nth" column in wave1.# to whatever column in the waterfallWave, however the wave1.#s do not have nth columns, so igor gets confused. (Or perhaps it's me that's confused.)
What does happen is that for the (indexed) 1-4 columns in the multidimensional wave, igor just assigns the last value in the single dimensional wave to every row in the multidimensional wave. So the last four columns in the multidimensional wave are just a constant. I can force the correct values by doing something like this.
waterfallWave[0][1] = 'wave1.1'[0]
However that's painful and can't be correct. Even in a procedure it seems like a waste of cycles to use a loop for such a thing. (My data have thousands of data points per column, not a ton, but enough to be slow.)
What am I doing wrong here?
EDIT: Quite literally. My posts are 3 minutes apart. I was guessing at first though!
June 24, 2016 at 09:45 am - Permalink
All the waves must have the same number of points. No exceptions. (In all honesty I'm not sure how the program would handle it, and I don't care to try because all of my data have the same number of points.)
The "hidden" and "angle" variables are explained in the "modifywaterfall" command help.
The function is certainly not public ready, as there is no error checking and I have it set up to require an X scaling wave with no option for a z scaling wave. But it's a good enough start.
String windowName="WaterFallPlot", yStringName="bExtended1.0_1", xStringName="bExtended1.0_0"
Variable numTraces, hiddenVar=1, angleVar=70, loopi
Prompt windowName, "Name of Window?"
Prompt numTraces, "Number of traces?"
Prompt hiddenVar, "Hidden Variable value? (0-4)"
Prompt angleVar, "Angle of Plot? (10-90 degrees)"
DoPrompt "Enter Things", windowName, numTraces, hiddenVar, angleVar
Prompt xStringName, "Name of X Wave?"
Doprompt "Name of X Wave?", xStringName
Wave xWave = $xStringName
Wavestats/Q xWave
Make/O/N=(V_npnts,numTraces) $("w_" + windowName)
Wave matrixWave = $("w_" + windowName)
for(loopi=0;loopi<numTraces;loopi+=1)
Prompt yStringName, "Name of Y Wave #" + num2str(loopi+1)
Doprompt "Name of Y Waves?", yStringName
Wave yWave = $yStringName
matrixWave[][loopi] = ywave[p]
endfor
newwaterfall/N=$windowName matrixWave vs {xWave,*}
modifywaterfall angle = angleVar
modifywaterfall hidden = hiddenVar
End
June 24, 2016 at 10:30 am - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
June 27, 2016 at 11:03 am - Permalink