PyNGL Home > Functions > Interpolation

Ngl.ftcurvpi

Calculates an integral of an interpolatory spline between two specified points.

Prototype

```iarray = Ngl.ftcurvpi(xl, xr, p, xi, yi)
```

Arguments

xl

A scalar value containing the lower limit of the integration.

xr

A scalar value containing the upper limit of the integration.

p

A scalar value specifying the period of the input function; the value must not be less than xi(npts-1) - xi(0).

xi

An array containing the abscissae for the input function, with rightmost dimension npts. If xi is multi-dimensional, it must have the same dimension sizes as yi.

yi

An array of any dimensionality, whose rightmost dimension is npts, containing the functional values of the input function. That is, yi(...,k) is the functional value at xi(...,k) for k=0,npts-1.

Return value

iarray

The integral of the interpolated function from xl to xr - a scalar if yi is a one-dimensional array, otherwise an array with the same dimensions as all but the last dimension of yi.

Description

This function calculates an integral between two specified points.

The first two arguments specify an interval of interpolation. No order for the two points is required; the integral will be calculated from the first point in the interval to the second. The second argument specifies the period of the function and the final two arguments are multi-dimensional arrays (Python lists, tuples, or NumPy arrays) specifying function values.