dsf.hankel.hankel_transform_fftlog module¶
FFTLog-basedHankel transforms for 1D radial statistics.
This module provides the HankelTransformFFTLog class, which converts
Fourier-space spectra into radial-space quantities using the FFTLog
algorithm. It implements 1D projected and spherical Hankel transforms
as a HankelTransform backend. It also includes two public functions that
perform the FFTLog-based Hankel transforms directly, without requiring a
HankelTransform class instance.
- class dsf.hankel.hankel_transform_fftlog.HankelTransformFFTLog[source]¶
Bases:
HankelTransformBaseHankel transform using the FFTLog algorithm.
This class provides methods for performing 1D Hankel transforms using the scipy FFTLog algorithm.
- projected_correlation(radial_input=None, spectrum=None, order=2, taper=False, taper_kwargs=None, use_offset=False, **kwargs)[source]¶
Compute a projected radial statistic from one spectrum.
- Parameters:
radial_input (NDArray[float64] | list[float] | tuple[float, ...] | None) – Radial input grid for tabulated spectra.
spectrum (NDArray[float64] | list[float] | tuple[float, ...] | Callable[[...], NDArray[float64]] | None) – Spectrum values or callable spectrum.
order (float | int) – Bessel order to use (default is 2 for tangential shear).
taper (bool) – Whether to suppress low-k and high-k edge power.
taper_kwargs (Mapping[str, Any] | None) – Optional settings for the spectrum taper.
use_offset (bool) – Apply automatic offset to FFTLog to reduce ringing.
**kwargs – Extra arguments passed to callable spectra.
- Returns:
Radial grid, in inverse units of
radial_input, and the projected radial statistic.- Return type:
tuple[NDArray[float64], NDArray[float64]]
- spherical_correlation(k_pk=None, pk=None, order=0, taper=False, taper_kwargs=None, use_offset=False, **kwargs)[source]¶
Compute a spherical radial statistic from one spectrum.
- Parameters:
k_pk (NDArray[float64] | list[float] | tuple[float, ...] | None) – Wavenumber grid for tabulated spectra (units of inverse distance).
pk (NDArray[float64] | list[float] | tuple[float, ...] | Callable[[...], NDArray[float64]] | None) – Spectrum values or callable spectrum.
order (float | int) – Bessel order to use (default is 0 for Delta Sigma).
taper (bool) – Whether to suppress low-k and high-k edge power.
taper_kwargs (Mapping[str, Any] | None) – Optional settings for the spectrum taper.
use_offset (bool) – Apply automatic offset to FFTLog to reduce ringing.
**kwargs – Extra arguments passed to callable spectra.
- Returns:
Radial grid and spherical radial statistic. The units of the radial grid are the inverse of the units of
k.- Return type:
tuple[NDArray[float64], NDArray[float64]]
- dsf.hankel.hankel_transform_fftlog.hankel_projected(radial_input, spectrum, order=2, use_offset=False)[source]¶
Convert an angular power spectrum to a projected correlation using FFTLog.
\(\gamma_t(\theta) = \int \frac{\ell d\ell}{2\pi} C(\ell )J_\mu(\ell \theta)\).
- Parameters:
radial_input (NDArray[float64]) – Radial input array (must be uniform in logspace).
spectrum (NDArray[float64]) – Spectrum to transform.
order (float | int) – Bessel order to use (default is 2 for tangential shear).
use_offset (bool) – Apply automatic offset to FFTLog to reduce ringing.
Returns – Radial grid, in inverse units of
radial_input, and the projected radial statistic.
- Return type:
tuple[NDArray[float64], NDArray[float64]]
- dsf.hankel.hankel_transform_fftlog.hankel_spherical(k, pk, order=0, use_offset=False)[source]¶
Convert power spectrum to 3D correlation function using FFTLog:
\(\xi(r) = \int \frac{k^2 dk}{2\pi^2} P(k) j_\ell(kr)\).
Currently, only order 0 is implemented.
- Parameters:
k (NDArray[float64]) – Wavenumber array (must be uniform in logspace).
pk (NDArray[float64]) – Power spectrum to transform.
order (float | int) – Bessel order to use (default is 0 for Delta Sigma).
use_offset (bool) – Apply automatic offset to FFTLog to reduce ringing.
- Returns:
Radial grid and 3D correlation function.
- Return type:
tuple[NDArray[float64], NDArray[float64]]