waveformtools.integrate
Methods to integrate functions
Functions
|
Implementation of the Driscoll Healy 2D integration that exhibits near spectral convergence. |
|
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. |
|
Construct an angular frequency axis for use with FFI |
|
Fixed frequency integrator as presented in Reisswig et. |
|
Integrate a twoD array in time |
- 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.DriscollHealy2DInteg_v2(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:
- func: ndarray
The data to be integrated
- info: surface_grid_info
An instance of the surface grid info class containing information about the grid.
- Returns
- ——-
- integ: float
The function f integrated over the sphere.
- waveformtools.integrate.MidPoint2DInteg(func, info)[source]
Evaulate the 2D surface integral using the midpoint rule.
- Parameters:
- func: ndarray
The data to be integrated
- info: surface_grid_info
An instance of the surface grid info class containing information about the grid.
- Returns
- ——-
- integ: float
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, grid_info, int_method=None)[source]
Integrate a function over a sphere.
- Parameters:
- func: function
The function to be integrated
- NTheta, NPhi: int
The number of grid points in the theta and phi directions. Note that NTheta must be even.
- ht, hp: float
The grid spacings.
- int_method: string
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.construct_ffi_omega_axis(freq_axis, omega0, zero_index)[source]
Construct an angular frequency axis for use with FFI
- waveformtools.integrate.fixed_frequency_integrator(udata_time, delta_t, utilde_conven=None, freq_axis=None, omega0='auto', order=1, zero_mode=0, omega_threshold_factor=10)[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.
- freq_axis: 1darray, optional
The frequency axis of the FFT. Must be supplied along with utilde_conven.
- 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.