pynbody.analysis.halo.virial_radius

Contents

pynbody.analysis.halo.virial_radius#

pynbody.analysis.halo.virial_radius(sim, cen=None, overden=178, r_max=None, rho_def='matter')[source]#

Calculate the virial radius of the halo centered on the given coordinates.

The default is here defined by the sphere centered on cen which contains a mean density of overden * rho_M_0 * (1+z)^3.

Parameters:
  • sim (SimSnap) – The simulation snapshot for which to calculate the virial radius.

  • cen (array_like, optional) – The center of the halo. If None, the halo is assumed to be already centered.

  • overden (float, optional) – The overdensity of the halo. Default is 178.

  • r_max (float, optional) – The maximum radius to search for the virial radius. If None, the maximum radius of any particle in sim is used

  • rho_def (str, optional) – The density definition to use. Default is ‘matter’, which uses the matter density at the redshift of the simulation. Alternatively, ‘critical’ can be used for the critical density at this redshift.

Returns:

The virial radius of the halo in the position units of sim.

Return type:

float