Concatenate No Longer Works

Hello:

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>
You are probably running into the #pragma rtGlobals=1 default that means you need to use WAVE statements in functions instead of bare $string.

Change
Concatenate/O list1, $Pathname

to
WAVE/T w=$Pathname // Tell Igor that $PathName refers to a wave. We'll call that reference "w".
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:
DisplayHelpTopic "Direct Reference To Globals"


--Jim Prouty
Software Engineer, WaveMetrics, Inc.
JimProuty wrote:
You are probably running into the #pragma rtGlobals=1 default that means you need to use WAVE statements in functions instead of bare $string.

Change
Concatenate/O list1, $Pathname

to
WAVE w=$Pathname // Tell Igor that $PathName refers to a wave. We'll call that reference "w".
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:
DisplayHelpTopic "Direct Reference To Globals"

--Jim Prouty
Software Engineer, WaveMetrics, Inc.


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".

Jim,

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

Well, now *I'm* confused, because I tried this example code with Igor 6.32A and it created a nice 2-D wave just fine:

#pragma rtGlobals=1     // Use modern global access method and strict wave access.

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.
mschulze wrote:
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?

Is it possible that your waves don't all have the same number of points?

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
johnweeks wrote:
mschulze wrote:
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?

Is it possible that your waves don't all have the same number of points?

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com



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!