Numerical integration (integration)

Integrate numerically in specified coordinate systems.

Warning

Quadrature integration of spherical functions may suffer from poor convergence.

Spherical integrals

angular_integral(angular_func)

Compute the full spherical angular integral.

radial_integral(radial_func, rmax)

Compute the radial integral up to the given maximum radius.

pixelated_angular_integral(angular_func, nside)

Compute the full spherical angular integral with pixelation.


harmonia.algorithms.integration.angular_integral(angular_func)[source]

Compute the full spherical angular integral.

Notes

Arguments \((\theta, \phi)\) of angular_func must be in radians in the domain \([0, \pi] \times [0, 2\pi]\).

Parameters:

angular_func (callable) – Angular function to be integrated.

Returns:

Angular integral value.

Return type:

complex

harmonia.algorithms.integration.radial_integral(radial_func, rmax)[source]

Compute the radial integral up to the given maximum radius.

Parameters:
  • radial_func (callable) – Radial function to be integrated.

  • rmax (float) – Upper radial limit rmax > 0.

Returns:

integral – Radial integral value.

Return type:

float

harmonia.algorithms.integration.pixelated_angular_integral(angular_func, nside)[source]

Compute the full spherical angular integral with pixelation.

Notes

Arguments \((\theta, \phi)\) of angular_func must be in radians in the domain \([0, \pi] \times [0, 2\pi]\).

Parameters:
  • angular_func (callable) – Angular function to be integrated.

  • nside (int) – ‘NSIDE’ parameter for healpy pixelation.

Returns:

Angular integral value.

Return type:

complex