Extracing values at a point from a series of traces
bchica
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
Forum
Support
Gallery
Igor Pro 9
Learn More
Igor XOP Toolkit
Learn More
Igor NIDAQ Tools MX
Learn More
Here's a function that will do it:
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)))
February 6, 2020 at 03:47 pm - Permalink
Thank you, this helped alot!
March 11, 2020 at 10:49 am - Permalink