Calculating an Area between a curve and a line
Igor_user
I've a pattern that has a few gaussian peaks. I'd like to calculate the total area under these peaks. But the background is not zero, say it's 0.05, so it'll be more accurate if I draw a straight line which has y=0.05 all across to fit the background and work out the total area between those peaks and this line.
How can I do this?
Thanks!
If you have a wave say w1 that contains the peaks, you can calculate the area of between the peaks and the axis and then subtract the area between the a clipped wave say w2 and the axis:
Note that if w1 has non-default wave scaling you should copy it to w2 before calculating the area:
A.G.
WaveMetrics, Inc.
September 24, 2014 at 11:04 am - Permalink
Then select Macros->AreaXYBetweenCursorsLessBase.
In spite of the "XY" in the name, these macros work with both XY traces and waveform traces.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
September 24, 2014 at 11:10 am - Permalink
Does the 'LessBase' in this macro mean that it'll just calculate and display the area confined by the curve/peak and the line jointed by (X1, Y1) and (X2, Y2) even if the entire curve has a non zero baseline?
September 24, 2014 at 11:32 pm - Permalink
Thanks!
Can please tell me what a clipped wave is?
Because I thought it'd be more staright forward if I can use Print area(w1)-area(w2), where w1 is the curve/peak and w2 is the baseline at 0.05, provided that area(w1)/area(w2) is defined by Igor as the area between w1/w2 and y=0.
September 24, 2014 at 11:38 pm - Permalink
I don't mean the 'Fill to Zero' function in the 'Modify Trace Appearance' dialogue box, but I mean 'Fill to the baseline y=0.05'.
Thanks!
September 25, 2014 at 02:19 am - Permalink
Just include the baseline (same number of points) in the graph and use the 'Fill to Next' mode.
September 25, 2014 at 03:03 am - Permalink
Thanks, how to create a single baseline that has all points with y=0.05?
September 25, 2014 at 05:12 am - Permalink
basewave = 0.05
Replace "ywave" with the actual name of the wave containing y data.
Replace "basewave" with a better name for whatever it is you're doing.
You may benefit from the Guided Tour. Select Help->Getting Started. There is useful basic information there before the Guided Tour. The first half of the Guided Tour steps through example tasks that may help you to do tasks like this wave creation on your own.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
September 25, 2014 at 09:52 am - Permalink
Yes, a baseline is constructed by a straight line between those points and the resulting area is subtracted from the area or the peak.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
September 25, 2014 at 10:10 am - Permalink