I have a large grid of data point grid that I created from simulations, and associated with each point in the xy plane is the value z (simulation result).
I have x, y, z values dumped into a text file, and what I would like to do is measure the volume between the xy plane (ie z = 0) and the “plane” defined by the data. Data points are currently not evenly spaced, although they MUST be after the simulations have ended.
I look through the scant documentation and I'm not sure that scipy.integrate provides the functions I need - it seems that there is only the ability to do this in 2d, and not in 3d, as I need.
To begin with, if necessary, I can do without interpolation, integration based solely on the "trapezoid rule" or a similar approximation is a good basis for a start.
Any help is appreciated.
thank
EDIT: Both of the solutions described below work well. In my case, it turns out that the spline can cause ripples around sharp maxima in the plane, so the Delaunay method works better, but I would advise people to check both.
source
share