waveformtools.integrate
Methods to integrate functions
Functions
|
Implementation of the Driscoll Healy 2D integration that exhibits near spectral convergence. |
|
Evaulate the 2D surface integral using the Gauss-Legendre rule. |
|
Evaulate the 2D surface integral using the midpoint rule. |
|
Implementation of Simpson's 2D integration scheme. |
|
Integrate a function over a sphere. |
|
Fixed frequency integrator as presented in Reisswig et. |
- waveformtools.integrate.DriscollHealy2DInteg(func, info)[source]
Implementation of the Driscoll Healy 2D integration that exhibits near spectral convergence.
- Parameters:
- funcfunction
The function to be integrated
- NTheta, NPhiint
The number of grid points in the theta and phi directions. Note that NTheta must be even.
- ht, hpfloat
The grid spacings.
- Returns:
- integfloat
The function f integrated over the sphere.
- waveformtools.integrate.GaussLegendre2DInteg(func, info)[source]
Evaulate the 2D surface integral using the Gauss-Legendre rule.
- Parameters:
- funcndarray
The data to be integrated
- infosurface_grid_info
An instance of the surface grid info class containing information about the grid.
- Returns
- ——-
- integfloat
The function f integrated over the sphere.
- waveformtools.integrate.MidPoint2DInteg(func, info)[source]
Evaulate the 2D surface integral using the midpoint rule.
- Parameters:
- funcndarray
The data to be integrated
- infosurface_grid_info
An instance of the surface grid info class containing information about the grid.
- Returns
- ——-
- integfloat
The function f integrated over the sphere.
- waveformtools.integrate.Simpson2DInteg(func, info)[source]
Implementation of Simpson’s 2D integration scheme.
- Parameters:
- funcfunction
The function to be integrated
- NTheta, NPhiint
The number of grid points in the theta and phi directions. Note that NTheta must be even.
- ht, hpfloat
The grid spacings.
- Returns:
- integfloat
The function f integrated over the sphere.
- waveformtools.integrate.TwoDIntegral(func, info, method='DH')[source]
Integrate a function over a sphere.
- Parameters:
- funcfunction
The function to be integrated
- NTheta, NPhiint
The number of grid points in the theta and phi directions. Note that NTheta must be even.
- ht, hpfloat
The grid spacings.
- methodstring
The method to use for the integration. Options are DH (Driscoll Healy), SP (Simpson’s), MP (Midpoint).
- Returns:
- integfloat
The function f integrated over the sphere.
- waveformtools.integrate.fixed_frequency_integrator(udata_time, delta_t, utilde_conven=None, omega0=0, order=1, zero_mode=0)[source]
Fixed frequency integrator as presented in Reisswig et. al.
- Parameters:
- udata_time: 1d array
The input data in time.
- delta_t: float
The time stepping.
- utilde_conven: 1d array, optional
The conventional FFT of the samples udata_time.
- omega0: float, optional
The cutoff angular frequency in the integration. Must be lower than the starting angular frequency of the input waveform. All frequencies whose absolute value is below this value will be neglected. The default cutoff-value is 0.
- order: int, optional
The number of times to integrate the integrand in time. Defaults to 1.
- zero_mode: float, optional
The zero mode amplitude of the FFT required. Defaults to 0 i.e. the zero mode is removed.
- Returns:
- u_integ_n_time: 1d array
The input waveform in time-space, integrated in frequency space using FFI.
- u_integ_integ_n: 1d array
The integrated u samples in Fourier space.