Calculating Radii Module

This module contains codes for calculating radii R200, R500, etc (and corresponding masses) of halos.

Based on Douglas Rennehan’s code on HaloAnalysis.

XIGrM.calculate_R.get_radius(halo, overdensities=array([], dtype=float64), rho_crit=None, precision=0.01, rmax=None, cen=array([], dtype=float64), prop=None)[source]

Calculate different radii of a given halo with a decreasing sphere method.

Parameters
halo

Halo to be calculated, SimSnap in pynbody. Paramaters need to be in physical_units.

overdensity

Overdensity factor $Delta$s. Must be a list!

rho_crit

Critical density of the universe at the redshift of current SimSnap. Must be in units of Msol/kpc**3.

precision

Precision for calculating radius.

rmax

The radius at which start using decreasing sphere method. If 0, then use 2 * distance of farthest particle. If set, must be in units of kpc or convertible to kpc via pynbody.

cen

center coordinates of calculated halo. If not provided, then will load from property dictionary or calculate via pynbody.analysis.halo.center().

prop

halo.properties dictionary. If set to 0 then will automatically load it. Only used for getting boxsize and redshift.

Returns
mass

Dict of masses of the halo within calculated radii.

radius

Dict of radii of the halo at given overdensities.

XIGrM.calculate_R.get_radius_bisection(halo, overdensities=array([], dtype=float64), rho_crit=0, precision=0.01, prop=0)[source]

Calculate different radii of a given halo with a bisection method. This is a prototype without much optimization. And you will need to modify the source code to make it compatible with the module.

Parameters
halo
Halo to be calculated, SimSnap in pynbody.

Paramaters need to be in physical_units.

overdensity

Overdensity factor $Delta$s.

rho_crit

Critical density of the universe at the redshift of current SimSnap. Must be in units of halo[‘mass’].units / halo[‘pos’].units**3.

precision

Precision within which radii is calculated.

Returns
mass

Dict of masses of the halo within calculated radii.

radius

Dict of radii of the halo at given overdensities.