Concatenate No Longer Works
mschulze
I made a code a long time ago that worked very well, but now, does not.
This code generates a list of waves (using Wavelist), which is then sorted, and then uses concatenate to form the waves of the list into a 2-D wave. However, now, with a list of waves (saved in a string), concantenate no longer expands the dimension of the wave. So, when I try to generate a Waterfall plot (using NewWaterfall), I get the error "expected 2D wave". I do not understand why after a few months of not using this code, Igor seems to have changed. I would sincerely appreciate your help.
The first portion of my code that generates the list to concantenate is posted below. (Also, I really need help in using this method via a generated list of waves, because I have over 100 data files I am working with.)
<br />
<br />
Function Waterfall(Pathname) <br />
string Pathname<br />
string list1 = WaveList("mws*",";","DIMS:1")<br />
list1 = SortList(list1, ";", 16) //alpha numeric, non-case sensitive sort <br />
Concatenate/O list1, $Pathname<br />
</span>
<br />
Function Waterfall(Pathname) <br />
string Pathname<br />
string list1 = WaveList("mws*",";","DIMS:1")<br />
list1 = SortList(list1, ";", 16) //alpha numeric, non-case sensitive sort <br />
Concatenate/O list1, $Pathname<br />
</span>
Change
to
Concatenate/O list1, w // Now Igor knows that the second parameter is a wave.
For more about this change, execute this in Igor's command line:
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
September 9, 2013 at 10:52 am - Permalink
Hi Jim:
I really appreciate your help and feedback. Unfortunately, I made this change, but wave "w" that is generated is just all my data waves concatenated in one column (the dimension still is not changing). And so, I am still getting the error for "expected 2D wave".
September 9, 2013 at 10:58 am - Permalink
I also tried just making a few waves: wave0=p, wave1=p+1, wave2=p+2, etc. I formed a list of these (sorted it, although unnecessary in this instance) and tried to use concatenate. This actually did work and expanded the dimension of the destination wave.
Is there something that could be inherently wrong with my waves that it won't expand the dimension of the destination wave?
Thanks,
Morgan
September 9, 2013 at 11:14 am - Permalink
Function Waterfall(Pathname)
string Pathname
string list1 = WaveList("mws*",";","DIMS:1")
list1 = SortList(list1, ";", 16) //alpha numeric, non-case sensitive sort
Concatenate/O list1, $Pathname
Wave ww= $Pathname
print GetWavesDataFolder(ww,2), "cols= ", DimSize(ww,1)
End
Macro TryIt()
Make/O/N=10 mws1=p
Make/O/N=10 mws2=p*2
Make/O/N=10 mws3=p*3
Waterfall("waterfallWave")
NewDataFolder/O root:subfolder
Waterfall("root:subfolder:waterfallWave")
End
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
September 9, 2013 at 02:35 pm - Permalink
Is it possible that your waves don't all have the same number of points?
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
September 9, 2013 at 03:23 pm - Permalink
Omgosh! You are a genius! Somehow 1 out of 100 waves ended up having 1 extra data point (and this has never happened before)!
Thank you so much! I have toiled and been frustrated by this all day. My code works again. Way to go!
September 9, 2013 at 03:56 pm - Permalink