Extracing values at a point from a series of traces

Hello, I was wondering what the best way to extract values from a graph with many individual traces on it with the same X scaling. I have attached an example graph, in this case for example, how would I extract the value of all the traces at a point (for example the cursor A, point 339) into a separate wave without having to edit all waves and copy and paste into excel and transpose the data which is a bit clunky. 

 

thanks, 

Bryant

Graph12k_c_1.pxp (97.38 KB)

Here's a function that will do it:

Function ExtractDataAtPoint(String gname, Variable pointNum, String newWaveName)
    if (strlen(gname) == 0)
        gname = WinName(0,1)
    endif
   
    String tlist = TraceNameList(gname, ";", 1)
    Variable ntraces = ItemsInList(tlist)
    Make/O/N=(ntraces) $newWaveName/WAVE=w
   
    Variable i
    for (i = 0; i < ntraces; i++)
        String oneTrace = StringFromList(i, tlist)
        Wave yw = TracenameToWaveRef(gname, oneTrace)
        w[i] = yw[pointNum]
    endfor
end

I didn't add a nice GUI, and it lacks some sanity testing. I have attached a modified copy of your experiment file. It has a table with a new wave, Data532 with data from the point 532 of each wave, which is the point where the A cursor is. I generated the wave with this command (which you can find in the history):

ExtractDataAtPoint("", pcsr(A), "Data"+num2str(pcsr(A)))

 

Graph12k_c_1_JW.pxp (105.3 KB)

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More