HOD on Halo Light Cone Catalogs

HOD on Halo Light Cone Catalogs#

The first step to creating HOD catalogs with AbacusHOD is to “prepare” the simulation outputs. In this step, we drastically downsample both halos and particles and save them in a subsample_dir of choice, specified in the lc_hod.yaml file, which also contains information about the desired redshift, simulation name, output directory, galaxy tracers (ELGs, LRGs, QSOs), HOD parameters and decorations.

One can then run the prepare_sim.py script with: python -m abacusnbody.hod.prepare_sim.py --path2config /path/to/tutorial_lc/config/lc_hod.yaml. or if cloning the github repo, you can find the script here: python /path/to/repos/abacusutils/abacusnbody/hod/prepare_sim.py --path2config path/to/tutorial_lc/config/lc_hod.yaml

Once that is done, you are ready to run as many mocks as you would like on this redshift catalog and simulation with different HOD parameters and decorations that can be specified in the yaml file. To do so, run: python /path/to/tutorial_lc/run_lc_hod.py --path2config /path/to/tutorial_lc/config/lc_hod.yaml

The final output is in ASCII format and can be read using astropy.

import numpy as np
%matplotlib inline

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from astropy.io import ascii
# output_dir as specified in the yaml file contains the galaxy mock catalogs
gal_fn = "/mnt/marvin1/boryanah/tutorial_lc/mocks_lc/AbacusSummit_base_c000_ph000/z0.200/galaxies_rsd/LRGs.dat"
gal_array = ascii.read(gal_fn)
gal_array
Table length=32923
xyzvxvyvzmassid
float64float64float64float64float64float64float64int64
-989.5211854963334-795.2209044171506-435.452707825493-316.9319152832031-90.24874877929688-64.1723709106445349438979920940.251632534
-989.7788809602816-444.18386788750325-800.8118323517119-204.785110473632889.4765396118164-131.2910614013672200037945888891.221673146
-989.1402379285971-987.0081882913663-355.9616014600487-184.0806427001953113.68415069580078587.573669433593821291177948973.671839284
-989.3769572090973-978.6786558404447-346.5238873294322-201.0451812744140661.161251068115234820.26068115234381111485961278.76421840226
-988.1982939423249-967.3164670657677-348.0650921886748-371.00146484375-62.42314529418945631.268676757812543951149804721.381841503
-989.6077966109577-890.8815084558821-388.65209373006746375.950439453125-59.867958068847656434.71939086914069273631445432.1171850435
-989.5471692714775-882.9278121235682-401.35476094145224406.77471923828125-412.31207275390625386.56149291992198149490995030.6361851291
-989.1991899123153-881.4364638286589-379.3950228158866381.39776611328125-284.3842468261719278.4006958007812515025096751707.6211851416
-989.57384445275-779.6065852324112-449.310831725709-566.8693237304688-6.089807510375977-4.33087253570556610486353319692.6291862679
-989.3734601867183-732.8042249546282-441.14212451674996-274.8539733886719-225.94834899902344-338.3051147460937516684943908304.1821868738
........................
-391.2505281236849-888.7233084024207-962.281496015754216.75867.0254.875145872514280615.6610002943735
-397.0767924316913-943.5254720448654-972.4110769725397-269.5-96.65625465.7575467154964851.510003163612
-400.72613046596035-902.2040337139865-798.0585764678823-852.5175.7590.812529339433031022.5610003168411
-389.1817989733227-939.4038848376551-805.7138143719559-76.15625105.468751086.569234819071912.710003619835
-382.3126187661078-988.6393468619864-952.3013856275634117.1875-210.9375928.553429362157637.44510004975618
-384.1769702065399-976.481679455006-897.7521392030665-58.59375-503.875-1315.088098444190844.8910005657086
-378.02688237729205-965.2425453670953-819.6181735258906-20.5078125108.375530.2528040238814423.47310006114352
-376.5601047534898-891.9728594684258-956.5806141471014-64.4375187.5-41.01562528535872971729.9410006577456
-368.7274378137272-913.5118302593789-903.2792794352073606.25-811.5-210.937544149403467643.9710007255846
-368.7407207308209-908.5996896174775-968.206505424091858.59375-20.5078125164.062522480699926509.210007942414
gal_array.meta
OrderedDict([('Acent', -0.73118963),
             ('Asat', -0.241898268),
             ('Bcent', -0.00937221616),
             ('Bsat', 0.0374532572),
             ('Gal_type', 'LRG'),
             ('Ncent', 30533),
             ('alpha', 1.0),
             ('alpha_c', 0),
             ('alpha_s', 1),
             ('ic', 0.97),
             ('kappa', 1.2),
             ('logM1', 14.3),
             ('logM_cut', 13.1),
             ('s', 0),
             ('s_p', 0),
             ('s_r', 0),
             ('s_v', 0),
             ('sigma', 0.3)])

Let’s visualize the mock galaxy catalog!

# creating figure
fig = plt.figure()
ax = Axes3D(fig)
  
# creating the plot
ax.scatter(gal_array['x'], gal_array['y'], gal_array['z'], s=1, color='dodgerblue')
  
# setting title and labels
ax.set_title("Light cone galaxies")
ax.set_xlabel('X [Mpc/h]')
ax.set_ylabel('Y [Mpc/h]')
ax.set_zlabel('Z [Mpc/h]')
Text(0.5, 0, 'Z [Mpc/h]')
../../_images/7f9af7aae1bb180bd6d998fea00f37ca2073a7291ad659529dc0e6f316d1e3d0.png