# yt.analysis_modules.halo_analysis.halo_recipes module¶

Halo recipe object

class yt.analysis_modules.halo_analysis.halo_recipes.HaloRecipe(function, args=None, kwargs=None)[source]

Bases: object

A HaloRecipe is a function that minimally takes in a Halo object and performs some analysis on it. This function may attach attributes to the Halo object, write out data, etc, but does not return anything.

yt.analysis_modules.halo_analysis.halo_recipes.add_recipe(name, function)[source]
yt.analysis_modules.halo_analysis.halo_recipes.calculate_virial_quantities(hc, fields, weight_field=None, accumulation=True, radius_field='virial_radius', factor=2.0, overdensity_field=('gas', 'overdensity'), critical_overdensity=200)[source]

Calculate virial quantities with the following procedure: 1. Create a sphere data container. 2. Create 1D radial profiles of overdensity and any requested fields. 3. Call virial_quantities callback to interpolate profiles for value of critical overdensity. 4. Delete profile and sphere objects from halo.

Parameters: halo (Halo object) – The Halo object to be provided by the HaloCatalog. fields (string or list of strings) – The fields for which virial values are to be calculated. weight_field (string) – Weight field for profiling. Default : “cell_mass” accumulation (bool or list of bools) – If True, the profile values for a bin n are the cumulative sum of all the values from bin 0 to n. If -True, the sum is reversed so that the value for bin n is the cumulative sum from bin N (total bins) to n. If the profile is 2D or 3D, a list of values can be given to control the summation in each dimension independently. Default: False. radius_field (string) – Field to be retrieved from the quantities dictionary as the basis of the halo radius. Default: “virial_radius”. factor (float) – Factor to be multiplied by the base radius for defining the radius of the sphere. Default: 2.0. overdensity_field (string or tuple of strings) – The field used as the overdensity from which interpolation is done to calculate virial quantities. Default: (“gas”, “overdensity”) critical_overdensity (float) – The value of the overdensity at which to evaulate the virial quantities. Overdensity is with respect to the critical density. Default: 200