Area under curve

I'm currently writing a script to measure the volume of a 2D peak*. The two approaches I've taken thus far are:

1) Dividing the peak into a series of 1D waves and using the Area function to get the area of each peak and adding these together for the total volume. However I'm curious since the Igor Manual states that this function uses trapezoidal integration, as there are no missing points within the wave would this not give a similar answer to simply summing all data points within the wave?

2) Using CurveFit gauss2D in combination with the formula suggested by John Weeks in this thread: http://www.igorexchange.com/node/1553 unfortunately the volumes acquired using this technique have been very inconsistent. Is there a similar formula that could be used to calculate the volume from the output variables of poly2D?

As always thank you very much for the help.
Jon
Hello Jon,

I assume that you have a peak that is represented numerically rather than analytically.

Fitting the peak is in general not an ideal approach for volume determination because it depends on the quality of the fit. If you are lucky and you find a good functional fit then you can use analytic methods to determine the volume. Otherwise you have to resort to some approximation. Here are a few ideas that you can try assuming that you have a 2D matrix of z-values:

1. Use the fact that the Fourier transform at zero frequency is equal to the integral of the function. This, in general is the fastest method but it may be affected by your sampling. Also, make sure that your data are identically zero outside the peak.

2. Use the 2D form of the built-in function Integrate1d() where the user function returns an interpolated value from your data.

3. Use a modified form of the built-in Integrate operation by first running over the rows and then over the columns.


A.G.
WaveMetrics, Inc.

If you split your 2d array into 1d slices and try to sum the areas under those curves, you will lose all the volume information from between the slices in the second dimension.

Instead, you can force a polygon approach and take four nearest neighbor data points that form the smallest square possible, and think of this as a tower. Split the tower into two conjoined triangular towers depending on the roof heights, and caculate each half of the volume using simple geometry and assuming a planar, triangular roof. Iterate thru each tower and sum these volumes up, and you will have an approximate value that approaches the true value as the datapoint resolution increases, ala the fundamental theorem of calculus. The approach will over-approximate concave surfaces, and under-estimate convex ones, so this may or may not cancel somewhat out depending on your overall curvature, as well. That is, if you want to try it along the methods you have already thought of. Igor is right of course, fitting is not a good idea for trying to fill in an analytical defintion of your curve, in case this method isnt accurate enough either.