astropy:docs

HOD_mock

class halotools.make_mocks.HOD_mock(simulation_data=None, simname='bolshoi', scale_factor=1.0003, halo_finder='rockstar', halo_occupation_model=<class 'halotools.halo_occupation.vdB03_Quenching_Model'>, threshold=-20, seed=None, create_galaxies_table=True)[source] [edit on github]

Bases: object

Class used to build mock realizations of any HOD-style model defined in halo_occupation module.

Instances of this class represent a mock galaxy distribution whose properties depend on the style of HOD model passed to the constructor, and on the parameter values of the model.

To create a mock, first instantiate the class. This will load the halo catalog into memory (and DM particles, if using), bind the catalog data to the mock object, initialize a few empty arrays, and create any necessary lookup tables that can be pre-computed. Then run the populate method to assign galaxies to the halos.

Parameters:

simulation_data : optional

simulation_data is an instance of the simulation class defined in the read_nbody module. If unspecified, the halo catalog specified in defaults will be chosen.

halo_occupation_model : optional

halo_occupation_model is any subclass of the abstract class HOD_Model defined in the halo_occupation module. If unspecified, a traditional HOD quenching model (vdB03_Quenching_Model) will be chosen by default.

threshold : optional

Luminosity or stellar mass threshold of the mock galaxy sample.

seed : float, optional

Random number seed. Currently ignored. Will be useful when implementing an MCMC.

create_galaxies_table : boolean, optional

If set to True, the class instance will have a galaxies attribute, which is an astropy Table providing a convenient bundle of the mock. If set to be False, only the bare minimum of datum will be bound to the mock object. The former behavior is more useful for model exploration, the latter for likelihood analyses.

Notes

Currently supported models are Zheng07_HOD_Model, Satcen_Correlation_Polynomial_HOD_Model, Polynomial_Assembias_HOD_Model, and vdB03_Quenching_Model.

Methods Summary

assign_satellite_positions(Nsat, center, ...) Use pre-tabulated cumulative_NFW_PDF to draw random satellite positions.
galaxies_table_bundle() Create an astropy Table object and bind it to the mock object.
num_cen_monte_carlo(primary_halo_property, ...) Returns Monte Carlo-generated array of 0 or 1 specifying whether there is a central in the halo.
num_sat_monte_carlo(primary_halo_property, ...) Returns Monte Carlo-generated array of integers specifying the number of satellites in the halo.
populate([isSetup]) Assign positions to mock galaxies.
quenched_monte_carlo(primary_halo_property, ...) Returns Monte Carlo-generated array of 0 or 1 specifying whether the galaxy is quenched.

Methods Documentation

assign_satellite_positions(Nsat, center, r_vir, r_of_M, counter)[source] [edit on github]

Use pre-tabulated cumulative_NFW_PDF to draw random satellite positions.

Parameters:

Nsat : Number of satellites in the host system whose positions are being assigned.

center : array_like

position of the halo hosting the satellite system whose positions are being assigned.

r_vir : array_like

Virial radius of the halo hosting the satellite system whose positions are being assigned.

r_of_M :

Function object defined by scipy interpolation of cumulative_NFW_PDF.

counter : int

bookkeeping device controlling indices of satellites in the host system whose positions are being assigned.

Notes

API is going to change, so that function actually returns values, rather than privately over-writing object attributes.

galaxies_table_bundle()[source] [edit on github]

Create an astropy Table object and bind it to the mock object.

num_cen_monte_carlo(primary_halo_property, halo_type)[source] [edit on github]

Returns Monte Carlo-generated array of 0 or 1 specifying whether there is a central in the halo.

Parameters:

logM : float or array

hod_model :

HOD_Model object defined in halo_occupation module.

Returns:

num_ncen_array : int or array

num_sat_monte_carlo(primary_halo_property, halo_type, output=None)[source] [edit on github]

Returns Monte Carlo-generated array of integers specifying the number of satellites in the halo.

Parameters:

logM : float or array

hod_model : HOD_Model object defined in halo_occupation module.

Returns:

num_nsat_array : int or array

Values of array specify the number of satellites hosted by each halo.

populate(isSetup=False)[source] [edit on github]

Assign positions to mock galaxies. Returns coordinates, halo mass, isSat (boolean array with True for satellites) If isSetup is True, don’t call _allocate_memory first (useful for future MCMC applications).

quenched_monte_carlo(primary_halo_property, halo_type, galaxy_type)[source] [edit on github]

Returns Monte Carlo-generated array of 0 or 1 specifying whether the galaxy is quenched. Parameters ———- logM : array_like

halo_occupation_model :
Any HOD_Quenching_Model object defined in halo_occupation module.
galaxy_type : string
Only supported values are ‘central’ or ‘satellite’. Used to indicate which quenching model method should used to generate the Monte Carlo.
Returns:

quenched_array : int or array

Used to define whether mock galaxy is quenched (1) or star-forming (0)

Page Contents