Hashmap based wave indexing

Quick and Dirty hack to play with hash map based wave indexing in igor.

UpdateIndex is used to create an index of all waves in the current folder.
Then FetchWave can be used to convert the wave name to a wave reference.

Example
        variable numWaves = 1000
    for(i = 0; i < numWaves; i+=1)
        string wvName = "X_" + num2str(i)
        Make/O/D $wvName
    endfor
   
    UpdateIndex

    Make/O/I/N=(numWaves) indexWave
    indexWave[] = abs(enoise(numWaves-1.0))

    Wave/Z wv
    for(i = 0; i < numWaves; i+=1)
        wvName = "X_" + num2istr(indexWave[i])
        FetchWave/L=wvName /DEST=wv
       
        if(!WaveExists(wv))
            printf "Error at %s\r", wvName
        endif
    endfor


The experiment in the zip archive was then used to create the attached benchmark.

DO NOT USE THAT IN PRODUCTION CODE AS IT MIGHT FAIL HORRIBLY!
Hashmap_XOP_0.01.zip
Hi Thomas,
interesting XOP, might all go a bit wrong if someone kills a wave and your XOP tries to access it at a later stage. Still, you did mention it was a playground.

A.
Hi Andy,

yes its definitly a proof-of-concept XOP. Involving HoldWave and ReleaseWave would be good idea if you want to delete waves between UpdateIndex and FetchWave.

Thomas

Forum

Support

Gallery

Igor Pro 8

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More