Halo Mass Function and supporting functions.
yt.analysis_modules.halo_mass_function.halo_mass_function.
HaloMassFcn
(simulation_ds=None, halos_ds=None, make_analytic=True, omega_matter0=0.2726, omega_lambda0=0.7274, omega_baryon0=0.0456, hubble0=0.704, sigma8=0.86, primordial_index=1.0, this_redshift=0, log_mass_min=None, log_mass_max=None, num_sigma_bins=360, fitting_function=4)[source]¶Bases: object
Initalize a HaloMassFcn object to analyze the distribution of halos as a function of mass. A mass function can be created for a set of simulated halos, an analytic fit to can be created for a redshift and set of cosmological parameters, or both can be created.
Provided with a halo dataset object, this will make a the mass function for simulated halos. Prodiving a simulation dataset will set as many of the cosmological parameters as possible for the creation of the analytic mass function.
The HaloMassFcn object has arrays hanging off of it containing the mass function information.
The HaloMassFcn object also has a convenience function write_out() that will write out the data to disk.
Creating a HaloMassFcn object with no arguments will produce an analytic mass function at redshift = 0 using default cosmolocigal values.
Parameters: 


Examples
This creates the halo mass function for a halo dataset from a simulation and the analytic mass function at the same redshift as the dataset, using as many cosmological parameters as can be pulled from the dataset.
>>> halos_ds = load("rockstar_halos/halo_0.0.bin")
>>> hmf = HaloMassFcn(halos_ds=halos_ds)
>>> plt.loglog(hmf.masses_sim, hmf.n_cumulative_sim)
>>> plt.loglog(hmf.masses_analytic, hmf.n_cumulative_analytic)
>>> plt.savefig("mass_function.png")
This creates only the analytic halo mass function for a simulation dataset, with default values for cosmological paramters not stored in the dataset.
>>> ds = load("enzo_tiny_cosmology/DD0046/DD0046")
>>> hmf = HaloMassFcn(simulation_ds=ds)
>>> plt.loglog(hmf.masses_analytic, hmf.n_cumulative_analytic)
>>> plt.savefig("mass_function.png")
This creates the analytic mass function for an arbitrary set of cosmological parameters, with neither a simulation nor halo dataset.
>>> hmf = HaloMassFcn(omega_baryon0=0.05, omega_matter0=0.27,
omega_lambda0=0.73, hubble0=0.7, this_redshift=10,
log_mass_min=5, log_mass_max=9)
>>> plt.loglog(hmf.masses_analytic, hmf.n_cumulative_analytic)
>>> plt.savefig("mass_function.png")
make_simulated
= None¶If we want to make an analytic mass function, grab what we can from either the halo file or the data set, and make sure that the user supplied everything else that is needed.
multiplicityfunction
(sigma)[source]¶Multiplicity function  this is where the various fitting functions/analytic theories are different. The various places where I found these fitting functions are listed below.
sigmaM
()[source]¶Written by BWO, 2006 (updated 25 January 2007). Converted to Python by Stephen Skory December 2009.
This routine takes in cosmological parameters and creates a file (array) with sigma(M) in it, which is necessary for various pressschechter type stuff. In principle one can calculate it ahead of time, but it’s far, far faster in the long run to calculate your sigma(M) ahead of time.
Inputs: cosmology, user must set parameters
Outputs: four columns of data containing the following information:
The arrays output are used later.
sigma_squared_of_R
(R)[source]¶calculates sigma^2(R). This is the routine where the magic happens (or whatever it is that we do here). Integrates the sigma_squared_integrand parameter from R to infinity. Calls GSL (gnu scientific library) to do the actual integration.
Note that R is in h^1 Mpc (comoving)
yt.analysis_modules.halo_mass_function.halo_mass_function.
TransferFunction
(omega_matter, omega_baryon, omega_hdm, degen_hdm, omega_lambda, hubble, redshift)[source]¶Bases: object
This routine takes cosmological parameters and a redshift and sets up all the internal scalar quantities needed to compute the transfer function.
Parameters: 


TFmdm_onek_hmpc
(kk)[source]¶Given a wavenumber in h Mpc^1, return the transfer function for the cosmology held in the global variables.
Parameters:  kk (float) – Wavenumber in h Mpc^1 

Returns: 

TFmdm_onek_mpc
(kk)[source]¶Given a wavenumber in Mpc^1, return the transfer function for the cosmology held in the global variables.
Parameters:  kk (float) – Wavenumber in Mpc^1 

Returns: 
