Wavestats on all waves in a graph window
Using a graph window, I am placing cursors and repeatedly performing Wavestats on each of the tracings in the window to get the average of points between the cursors for each of the waves. I would really appreciate some help with a function or macro that could automate this, ideally making a new wave out of the successive averages for each wave.
Thanks!
I hope this helps,
A.G.
WaveMetrics, Inc.
October 24, 2016 at 12:31 pm - Permalink
I'd recommend to do the tour and read the chapters about programming in Igor first.
Later on, several keywords might become handy
and their documentation can be found in the online help.
As a fist step, try to understand, what happens in the history window. I gives a good idea what should be in your procedure (basically wrap it in a loop).
If the position of the cursors varies from trace to trace, it might get tricky.
If you are lost at some point, please feel free to ask again. If you need a complete procedure, some sample data would be useful --- but let's be honest, that would be unsportsmanlike.
HJ
PS: AG was faster and I missed and :-)
October 24, 2016 at 12:41 pm - Permalink
However it's getting hung up on the graphNameStr
For example, if I am looking at Graph0 and input "traceStats(Graph0,100,200)",
I get "Got 'Graph 0' instead of a string variable or string function name".
October 24, 2016 at 01:29 pm - Permalink
10-4 - wanna be a good sport!
October 24, 2016 at 12:51 pm - Permalink
You need to invoke like this:
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
October 24, 2016 at 01:18 pm - Permalink
is strange: where does the blank come from -- maybe it's just a typo?
As far as I see it should be invoked like
HJ
PS:OK, I give up and go to bed now
October 24, 2016 at 01:21 pm - Permalink
Thanks! I was leaving out the parentheses. Getting closer!
Now I get an error that says "While executing a wave read, the following error occured: Index out of range for wave "M_WaveStats"."
October 24, 2016 at 01:41 pm - Permalink
I'm guessing that is because you are using an older version of Igor where M_WaveStats did not contain 33 points (as in IP7).
I would strongly second HJ Drescher's suggestion above and in the meantime replace 33 by 27 and your code should run.
A.G.
WaveMetrics, Inc.
October 24, 2016 at 04:10 pm - Permalink