Calculating an Area between a curve and a line

Hi,

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!
Sounds like a simple subtraction.

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:
MatrixOP/O w2=greater(0.05,w1)*w1+0.05*greater(w1,0.05)


Note that if w1 has non-default wave scaling you should copy it to w2 before calculating the area:
Print area(w1)-area(w2)


A.G.
WaveMetrics, Inc.

#include <AreaXYBetweenCursors>


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.
JimProuty wrote:
#include <AreaXYBetweenCursors>


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.


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?
Igor wrote:
Sounds like a simple subtraction.

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:
MatrixOP/O w2=greater(0.05,w1)*w1+0.05*greater(w1,0.05)


Note that if w1 has non-default wave scaling you should copy it to w2 before calculating the area:
Print area(w1)-area(w2)


A.G.
WaveMetrics, Inc.


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.
By the way, I'd also like to know how to fill the area calculated with color. Any suggestion would be appreciated.

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!
Igor_user wrote:
By the way, I'd also like to know how to fill the area calculated with color. Any suggestion would be appreciated.

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!


Just include the baseline (same number of points) in the graph and use the 'Fill to Next' mode.
filltonext.jpg (35.08 KB)
chozo wrote:
Igor_user wrote:
By the way, I'd also like to know how to fill the area calculated with color. Any suggestion would be appreciated.

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!


Just include the baseline (same number of points) in the graph and use the 'Fill to Next' mode.


Thanks, how to create a single baseline that has all points with y=0.05?
Duplicate ywave, basewave
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
Igor_user wrote:
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?


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.