filter_power

randomfield.powertools.filter_power(power, sigma, out=None)[source] [edit on github]

Apply a Gaussian filtering to a power spectrum.

The smoothing length sigma should be in the inverse units of wavenumbers in the input power[‘k’]. A delta field generated from a filtered P(k) is effectively convolved with a 3D Gaussian smoothing kernel with the specified sigma:

exp( - |r|**2 / (2 * sigma**2)) / (2*pi)**(3/2) / sigma**3

This is achieved by scaling each delta(k) by the factor:

exp( - |k|**2 * sigma**2 / 2)

or, equivalently, by using the filtered power spectrum:

P(k) -> P(k) * exp( - |k|**2 * sigma**2)

Note the factor of 2 difference in the last two expressions, since:

P(k) ~ < delta(k)**2 >

See section 5 of arXiv:astro-ph/0506540 for details.