Automatically demote wave duplication outputs when the highest dimension has one index
Fri, 10/11/2019 - 08:49 am
I often run into trouble when I don't realize that a 1-column 2D wave is not a 1D wave. Usually, these result after I run duplicate/o/r=[columnOfInterest] sourceWv,columnWave and forget to follow it with redimension/n=(-1) columnWv
I think it would be better if duplicate's default was to demote the wave (i.e., to 1D in this case) if possible.
Would it be possible to use the following syntax to get either behavior in some future version of Igor?
•print dimsize(columnWv,1) //currently prints one. In the future, let the duplicate result in 0, indicating 1D wave
•print dimsize(columnWv,1) //current also prints one. In the future, this behavior should be unchanged
The advantage of this change in syntax would be that the simpler syntax produces the more intuitive result (in my opinion). I suppose the main danger is that someone accidentally erases the dimension label for the duplicated column (or layer, etc.)
For backwards compatibility and transparency, perhaps instead duplicate could just have a flag (e.g., /dem) to demote if the highest dimension if the output wave has only one index.