[SciPy-user] Integrating Array

Sebastian Haase haase@msg.ucsf....
Fri Oct 19 03:44:52 CDT 2007

I'm definitely no expert - but I think to remember that once you have
a spline interpolation of your original data, there essentially comes
a spline-based intergral with it.  Look through the spline related
functions in scipy to see if I'm right ....
Hope to hear back.

Sebastian Haase

On 10/18/07, rgold@lsw.uni-heidelberg.de <rgold@lsw.uni-heidelberg.de> wrote:
> Hi everybody,
> I need to integrate a set of data points stored in a 1-dim array. That
> means I can only use scipy.integrate.simps and scipy.integrate.trapz but
> these methods are not as accurate as the routines for function-input like
> scipy.integrate.quadrature which efficiently use more samples where the
> integrand oscillates faster,etc.
> The problem is that I need a high accuracy because the integrand IS
> oscillating fast!
> I already interpolated the data using the scipy.interpolate.splrep but
> interestingly it turns out that simpsons rule now produces NANs and I am
> left with good old trapz!
> Is there a way of implementing quadrature for data-like-arrays?
> Still I could try romberg. But then I have to interpolate exactly in such
> a way that the "number of samples = positive power of 2) +1" (equally
> spaced if I remember correctly).
> Is this the best way or does anyone have another idea?
> Thanks in advance!
> Roman
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user

More information about the SciPy-user mailing list