igor vs. IDL
uhe
- Has someone compiled a dictionary of the Igor equivalents of common IDL commands?
- A very common programming technique in IDL is the creation of index arrays to produce subsets of other arrays, that fullfill a certain criterion. Adressing an IDL array with another array produces a new array, that is automatically created. My translation of this into Igor reads clumsy:
•make /i/u/n=1000 list
•list = p // in IDL, this and the preceding statement could be cast into one
•extract /indx list, mask, list <= 500
•make /i/u/n=( numpnts( mask)) sublist
•sublist = list[ mask[p]] // again, in IDL sublist would be created automatically
•display sublist
•list = p // in IDL, this and the preceding statement could be cast into one
•extract /indx list, mask, list <= 500
•make /i/u/n=( numpnts( mask)) sublist
•sublist = list[ mask[p]] // again, in IDL sublist would be created automatically
•display sublist
Is there a way to simplify?
Regards, UHe
extract /indx list, mask, list <= 500
make /i/u/n=( numpnts( mask)) sublist = list[ mask[p]]
display sublist
If you don't necessarily need the index wave, you might get away with
MatrixOP
depending on your subset criteria. I think the above is equivalent toMatrixOP/O sublist = list / greater(501,list)
WaveTransform zapInfs sublist
display sublist
but it's the same number of lines and the number type of the output changes.
August 31, 2016 at 05:42 am - Permalink
UHe
August 31, 2016 at 05:52 am - Permalink
MatrixOP WaveMap()
MatrixOP WaveIndexSet()
as well as the more trivial:
MatrixOP subWaveC()
MatrixOP subWaveR()
MatrixOP subRange()
A.G.
August 31, 2016 at 07:32 am - Permalink