swiftcl.interpolate module

class swiftcl.interpolate.interp(**kwargs)[source]

Bases: object

A class to compute integrals of Bessel functions multiplied by a function using FFTLog-based techniques.

This class supports evaluation of three integral variants: - Standard spherical Bessel integrals (int_jl) - Integrals with additional k^-2 scaling (int_k) - Second-derivative Bessel integrals (int_ddjl)

Parameters:
  • l (array_like) – Values of l to compute.

  • N (int) – Maximum number of points for the FFTLog of the window function.

  • x (array_like) – Points where the input function is evaluated.

  • f (array_like) – 2D array of shape (len(x), len(a)) representing the function multiplying the Bessel function.

  • a (array_like) – Values multiplying the Bessel function argument, i.e., in j_l(ax).

  • b (float) – Bias for the FFTLog.

  • g_r (array_like) – Precomputed Gamma coefficients.

  • xmin (float) – Minimum value of x for FFTLog.

  • xmax (float) – Maximum value of x for FFTLog.

  • N_interp (int) – Number of points to interpolate across a.

l

Spherical harmonic degrees.

Type:

ndarray

N

Maximum FFTLog points.

Type:

int

x

Evaluation grid for the function.

Type:

ndarray

f

Function values to be integrated.

Type:

ndarray

a

Multiplier for Bessel argument.

Type:

ndarray

b

Bias parameter for FFTLog.

Type:

float

g_r

Integration matrix.

Type:

ndarray

xmin

Lower bound of x.

Type:

float

xmax

Upper bound of x.

Type:

float

N_interp

Interpolation resolution for a.

Type:

int

wind

Width of smoothing function (default 0.2).

Type:

float

fft

FFTLog instance used for coefficient computation.

Type:

FFTLog

power_fft

FFTLog exponents.

Type:

ndarray

step

Step size between thick samples in a.

Type:

int

a_thick

Thinned a sampling used for interpolation.

Type:

ndarray

int_jl()[source]

Compute the integral ∫ f(x) * j_l(ax) dx.

int_k()[source]

Compute the integral ∫ f(x) * j_l(ax) * k^2 dx.

int_ddjl()[source]

Compute the integral with a second-derivative weighting of the Bessel function.

int_ddjl()[source]

Compute the integral with a second-derivative:

∫ f(x) * d²/dx²[j_l(ax)] dx

using FFTLog coefficients and interpolation.

Returns:

Resulting 2D array of shape (len(l), len(a)), the integral values.

Return type:

ndarray

int_jl()[source]

Compute the integral of the form:

∫ f(x) * j_l(ax) dx

using FFTLog coefficients and interpolation.

Returns:

Resulting 2D array of shape (len(l), len(a)), the integral values.

Return type:

ndarray

int_k()[source]

Compute the integral of the form:

∫ f(x) * j_l(ax) * a^-2 dx

using FFTLog coefficients and interpolation.

Returns:

Resulting 2D array of shape (len(l), len(a)), the integral values.

Return type:

ndarray