halomod.tools.power_to_corr_ogata¶
- halomod.tools.power_to_corr_ogata(power: ndarray, k: ndarray, r: ndarray, h=0.005, power_pos=(True, True), rtol=0.001, atol=1e-15, _reverse=False)[source]¶
Convert a 3D power spectrum to a correlation function.
Uses Ogata’s method (Ogata 2005) for Hankel Transforms in 3D.
- Parameters:
power (np.ndarray) – The power spectrum to convert – either 1D or 2D. If 1D, it is the power as a function of k. If 2D, the first dimension should be
len(r)
, and the power to integrate is considered to be different for eachr
.k (np.ndarray) – Array of same length as the last axis of
power
, giving the fourier-space co-ordinates.r (np.ndarray) – The real-space co-ordinates to which to transform.
h (int, optional) – Controls the spacing of the intervals (note the intervals are not equispaced). Smaller numbers give smaller intervals.
power_pos (tuple of bool, optional) – Whether ‘power’ is definitely positive, at either end. If so, a slightly better extrapolation can be achieved.
Notes
See the hankel documentation for details on the implementation here. This particular function is restricted to a spherical transform.