<jupyter_start><jupyter_text>Read in `Quijote` Halo Catalog<jupyter_code># read in halo catalog
t0 = time.time()
halos = Halos.Quijote_LHC_HR(1, z=0.5)
print('halo readin takes %f sec' % ((time.time() - t0)))<jupyter_output>halo readin takes 0.246023 sec<jupyter_text>This halo catalog has the following cosmology<jupyter_code>print('Om, Ob, h, ns, s8:')
print(Halos.Quijote_LHC_cosmo(1))<jupyter_output>Om, Ob, h, ns, s8:
(0.21390000000000003, 0.055570000000000008, 0.85990000000000011, 0.97850000000000004, 0.86189999999999989)<jupyter_text>Populate halos with HODWe'll use best-fit HOD parameters for LOWZ<jupyter_code># get LOWZ HOD parameters
theta_hod = Galaxies.thetahod_lowz_sgc()<jupyter_output><empty_output><jupyter_text>Now apply HOD. This populates the halo catalog in a box with galaxies<jupyter_code># apply HOD
t0 = time.time()
hod = Galaxies.hodGalaxies(halos, theta_hod, seed=0)
print('HOD takes %f sec' % ((time.time() - t0)))
# galaxy positions 
pos = np.array(hod['Position'])
fig = plt.figure(figsize=(8,8))
sub = fig.add_subplot(projection='3d')
sub.scatter(pos[::100, 0], pos[::100, 1], pos[::100, 2], c='C0')
sub.set_xlabel('x', fontsize=25)
sub.set_xlim(-100, 1100)
sub.set_ylabel('y', fontsize=25)
sub.set_ylim(-100, 1100)
sub.set_zlabel('z', fontsize=25)
sub.set_zlim(-100, 1100)<jupyter_output><empty_output><jupyter_text>Applying the forward modelNow lets apply the forward model with different levels of realism: 1. only BOSS LOWZ South survey geometry2. with veto mask3. with fiber collisions<jupyter_code># apply forward model without veto mask, without fiber collisions
t0 = time.time()
gals = FM.BOSS(hod, sample='lowz-south', seed=0, veto=False, fiber_collision=False, silent=False)
print('forward model takes %f sec' % ((time.time() - t0)))
fig = plt.figure(figsize=(8,8))
sub = fig.add_subplot(111)
sub.scatter(np.array(gals['RA']), np.array(gals['DEC']), c='k', s=1, rasterized=True)
sub.scatter(np.array(gals['RA'])-360, np.array(gals['DEC']), c='k', s=1, rasterized=True)
sub.set_xlabel('RA', fontsize=25)
sub.set_xlim(-50, 70)
sub.set_ylabel('Dec', fontsize=25)
# apply forward model with veto mask, without fiber collisions
t0 = time.time()
gals_veto = FM.BOSS(hod, sample='lowz-south', seed=0, veto=True, fiber_collision=False, silent=False)
print('forward model takes %f sec' % ((time.time() - t0)))
fig = plt.figure(figsize=(8,8))
sub = fig.add_subplot(111)
sub.scatter(np.array(gals['RA']), np.array(gals['DEC']), c='k', s=1, rasterized=True, label='FM')
sub.scatter(np.array(gals['RA'])-360, np.array(gals['DEC']), c='k', s=1, rasterized=True)
sub.scatter(np.array(gals_veto['RA']), np.array(gals_veto['DEC']), c='C0', s=1, rasterized=True, label='+ veto mask')
sub.scatter(np.array(gals_veto['RA'])-360, np.array(gals_veto['DEC']), c='C0', s=1, rasterized=True)
sub.legend(loc='upper right', handletextpad=0, markerscale=10, fontsize=20)
sub.set_xlabel('RA', fontsize=25)
sub.set_xlim(-50, 80)
sub.set_ylabel('Dec', fontsize=25)
# apply forward model with veto mask, with fiber collisions
t0 = time.time()
gals_veto_fc = FM.BOSS(hod, sample='lowz-south', seed=0, veto=True, fiber_collision=True, silent=False)
print('forward model takes %f sec' % ((time.time() - t0)))
fig = plt.figure(figsize=(8,8))
sub = fig.add_subplot(111)
sub.scatter(np.array(gals['RA']), np.array(gals['DEC']), c='k', s=1, rasterized=True, label='FM')
sub.scatter(np.array(gals['RA'])-360, np.array(gals['DEC']), c='k', s=1, rasterized=True)
sub.scatter(np.array(gals_veto['RA']), np.array(gals_veto['DEC']), c='C0', s=1, rasterized=True, label='+veto mask')
sub.scatter(np.array(gals_veto['RA'])-360, np.array(gals_veto['DEC']), c='C0', s=1, rasterized=True)
sub.scatter(np.array(gals_veto_fc['RA']), np.array(gals_veto_fc['DEC']), c='C1', s=1, rasterized=True, label='+fiber collisions')
sub.scatter(np.array(gals_veto_fc['RA'])-360, np.array(gals_veto_fc['DEC']), c='C1', s=1, rasterized=True)
sub.legend(loc='upper right', handletextpad=0, markerscale=10, frameon=True, fontsize=20)
sub.set_xlabel('RA', fontsize=25)
sub.set_xlim(-50, 80)
sub.set_ylabel('Dec', fontsize=25)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19128329297820823, 'fraction_numerical': 0.06029055690072639, 'mean_word_length': 7.7893617021276595, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 5, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '389525', 'license': 'MIT', 'n_tokens_mistral': 1871, 'n_tokens_neox': 1701, 'n_words': 324, 'path': 'nb/demo_forwardmodel.ipynb', 'repo_name': 'amoradinejad/boss_sbi', 'size': '4130'}