hmf.density_field.filters.TopHat.radius_to_mass

TopHat.radius_to_mass(r, rho_mean)[source]

Return mass of a region of space given its radius

Parameters
  • r (array_like) – Radii

  • rho_mean (float) – Mean density of the Universe.

Returns

m – The corresponding masses to r

Return type

float or array of floats

Notes

The units of r don’t matter as long as they are consistent with rho_mean.