Quickstart¶
This quickstart guide gives an overview of the core features of Diffhalos, and demonstrates how to use the primary functions of the library.
The cell below shows how to generate a lightcone of halos and subhalos, and their mass assembly histories.
[1]:
from diffhalos import weighted_lc
from jax import random as jran
ran_key = jran.key(0)
n_host_halos = 200
z_min, z_max = 0.4, 2.5
lgmp_min, lgmp_max = 10.5, 15.5
sky_area_degsq = 500.0
args = (ran_key, n_host_halos, z_min, z_max, lgmp_min, lgmp_max, sky_area_degsq)
halopop = weighted_lc(*args)
print(halopop._fields)
('z_obs', 't_obs', 'logmp_obs', 'mah_params', 'logmp0', 'logt0', 'cen_weight', 'central', 'sat_weight', 'nsub_per_host', 'logmu_obs', 'halo_indx')
mass-function weighting¶
Every halo and subhalo in the returned lightcone has a weight that encodes the multiplicity of the halo. For any input choice of the number of returned halos, the weights are determined according to the halo and subhalo mass functions…