Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
636 changes: 636 additions & 0 deletions input_files/dla_files/expected_2lpt_flagged_cells_vs_z_cell.txt

Large diffs are not rendered by default.

Binary file removed input_files/tuning_files/tuning_data_2lpt.fits
Binary file not shown.
54 changes: 32 additions & 22 deletions py/DLA.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
print('WARN: pyigm not found, DLA distributions will not be perfect!')
use_pyigm = False

# This is an empirical 2LPT threshold for objects with b=2 coming from CoLoRe-2LPT snapshot version.
def lpt_threshold(z):
a=5.33080934

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you obtain this? It is probably a function of cosmology, right? Do you expect this to be also a function of box resolution?

b=-2.44382773
c= -0.26016998
return a * (z+1)**b + c

def get_threshold(b2f):
""" Compute the field threshold for a given bias
Arguments:
Expand Down Expand Up @@ -219,35 +226,38 @@ def get_DLA_table(object,dla_bias=2.0,dla_bias_z=2.25,extrapolate_z_down=None,NH
else:
raise ValueError('DLA bias evol not recognised.')
deltas = object.GAUSSIAN_DELTA_rows
nu_arr = get_threshold(b2f)
flagged_cells = flag_DLA(z_qso,z_cell,deltas,nu_arr,sigma_g)

#Mean of the poisson is the mean number of DLAs with redshift scaled up by
#the proportion of expected flagged cells.
p_nu_z = 1.0-norm.cdf(nu_arr)
mean_N_per_cell = z_width * dndz(z_cell,NHI_min=NHI_min,NHI_max=NHI_max)
w = p_nu_z>0
mu = np.zeros(p_nu_z.shape)
mu[w] = mean_N_per_cell[w]/p_nu_z[w]

elif object.DENSITY_DELTA_rows is not None:
"""
## Also need the pdf pf the skewers.
## For now, just raise an error.
if evol == "b_const":
b2f = dla_bias
elif evol == "bD_const":
b2f = dla_bias*y(dla_bias_z)*np.ones(z.shape)/D_cell
else:
raise ValueError('DLA bias evol not recognised.')
#This only supports constant bias = 2.
#We use the threshold derived from CoLoRe-2LPT snapshots for b_HCD = 2, check above
deltas = object.DENSITY_DELTA_rows
"""
raise ValueError('Adding DLAs without Gaussian skewers is not implemented as yet.')
nu_arr = lpt_threshold(z_cell) #Get the 2LPT threshold
flagged_cells = flag_DLA(z_qso,z_cell,deltas,nu_arr,1) #We flag cells assuming (by construction) sigma_G=1 for 2LPT case

#Get number of expected flagged cells for each z_cell (here we first assume that all z cells are flagged!)
mean_N_per_cell = z_width * dndz(z_cell,NHI_min=NHI_min,NHI_max=NHI_max)

#Now we correct for the fact that not all z cells are flagged. We rescale the previous mean by the expected number of flagged cells per z_cell.
#We get this probability computing it directly from a full-sky LyaCoLoRe-2LPT realization and just read it (see Ruiz-Herrera+2026).
p_emp_t = np.genfromtxt(os.environ['LYACOLORE_PATH']+'/input_files/dla_files/expected_2lpt_flagged_cells_vs_z_cell.txt')
p_emp = p_emp_t[:,1]
w = p_emp>0
mu = np.zeros(p_emp.shape)
mu[w] = mean_N_per_cell[w]/p_emp[w]

else:
raise ValueError('Cannot find Gaussian or density delta skewers when flagging cells for DLAs')

nu_arr = get_threshold(b2f)
flagged_cells = flag_DLA(z_qso,z_cell,deltas,nu_arr,sigma_g)

#Mean of the poisson is the mean number of DLAs with redshift scaled up by
#the proportion of expected flagged cells.
mean_N_per_cell = z_width * dndz(z_cell,NHI_min=NHI_min,NHI_max=NHI_max)
p_nu_z = 1.0-norm.cdf(nu_arr)
w = p_nu_z>0
mu = np.zeros(p_nu_z.shape)
mu[w] = mean_N_per_cell[w]/p_nu_z[w]

#Draw number of DLAs per cell from a Poisson distribution, place them only
#in flagged cells.
pois = np.random.poisson(mu,size=(len(z_qso),len(mu)))
Expand Down
5 changes: 5 additions & 0 deletions run_CoLoRe/CoLoRe-2LPT/README_RUN.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CoLoRe-2LPT boxes were run with the same configuration as CoLoRe-QL mocks using the 2LPT flags of CoLoRe + no smoothing + the input files in this same folder.

LyaCoLoRe-2LPT was run with the same configuration as in London but with 2lpt flag on + the DESI DR2 tuning file (see LyaCoLoRe input folder).

Both set of runs were performed full sky.
77 changes: 77 additions & 0 deletions run_CoLoRe/CoLoRe-2LPT/input_files/Bz_clustering.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
0.000000000000000000e+00 5.230000000000000204e-01
4.999999999999999584e-02 5.620253503242086390e-01
9.999999999999999167e-02 6.019437360778474577e-01
1.499999999999999944e-01 6.427335991075497912e-01
1.999999999999999833e-01 6.843748270797710420e-01
2.499999999999999722e-01 7.268485996383640124e-01
2.999999999999999889e-01 7.701372564980800695e-01
3.499999999999999778e-01 8.142241836137981137e-01
3.999999999999999667e-01 8.590937143638941453e-01
4.499999999999999556e-01 9.047310432966375604e-01
4.999999999999999445e-01 9.511221504601894416e-01
5.499999999999999334e-01 9.982537347048534571e-01
5.999999999999999778e-01 1.046113154636084452e+00
6.499999999999999112e-01 1.094688376126965457e+00
6.999999999999999556e-01 1.143967925483159620e+00
7.499999999999998890e-01 1.193940847501944846e+00
7.999999999999999334e-01 1.244596667787633004e+00
8.499999999999999778e-01 1.295925358784301373e+00
8.999999999999999112e-01 1.347917309067868441e+00
9.499999999999999556e-01 1.400563295506624062e+00
9.999999999999998890e-01 1.453854457955084722e+00
1.049999999999999822e+00 1.507782276192663806e+00
1.099999999999999867e+00 1.562338548857779452e+00
1.149999999999999911e+00 1.617515374161041075e+00
1.199999999999999956e+00 1.673305132189134570e+00
1.250000000000000000e+00 1.729700468634828736e+00
1.299999999999999822e+00 1.786694279808847652e+00
1.349999999999999867e+00 1.844279698806787771e+00
1.399999999999999911e+00 1.902450082719245206e+00
1.449999999999999956e+00 1.961199000786274738e+00
1.499999999999999778e+00 2.020520223408500904e+00
1.549999999999999822e+00 2.080407711936949511e+00
1.599999999999999867e+00 2.140855609172144902e+00
1.649999999999999911e+00 2.201858230510456593e+00
1.699999999999999956e+00 2.263410055682141042e+00
1.749999999999999778e+00 2.325505721031281059e+00
1.799999999999999822e+00 2.388140012292810255e+00
1.849999999999999867e+00 2.451307857826277026e+00
1.899999999999999911e+00 2.515004322269925652e+00
1.949999999999999734e+00 2.579224600582149307e+00
1.999999999999999778e+00 2.643964012440484179e+00
2.049999999999999822e+00 2.709217996971056142e+00
2.099999999999999645e+00 2.774982107783869001e+00
2.149999999999999911e+00 2.841252008291516695e+00
2.199999999999999734e+00 2.908023467290875352e+00
2.250000000000000000e+00 2.975292354789122129e+00
2.299999999999999822e+00 3.043054638056980732e+00
2.349999999999999645e+00 3.111306377893582109e+00
2.399999999999999911e+00 3.180043725088569140e+00
2.449999999999999734e+00 3.249262917068280743e+00
2.500000000000000000e+00 3.318960274713909087e+00
2.549999999999999822e+00 3.389132199340449958e+00
2.599999999999999645e+00 3.459775169826182939e+00
2.649999999999999911e+00 3.530885739883174779e+00
2.699999999999999734e+00 3.602460535460036084e+00
2.749999999999999556e+00 3.674496252268825369e+00
2.799999999999999822e+00 3.746989653428570044e+00
2.849999999999999645e+00 3.819937567218449015e+00
2.899999999999999911e+00 3.893336884934168296e+00
2.949999999999999734e+00 3.967184558841521103e+00
2.999999999999999556e+00 4.041477600221553779e+00
3.049999999999999822e+00 4.116213077502131945e+00
3.099999999999999645e+00 4.191388114471068072e+00
3.149999999999999911e+00 4.266999888566308741e+00
3.199999999999999734e+00 4.343045629238929450e+00
3.249999999999999556e+00 4.419522616385072489e+00
3.299999999999999822e+00 4.496428178843051349e+00
3.349999999999999645e+00 4.573759692952281242e+00
3.399999999999999911e+00 4.651514581170737017e+00
3.449999999999999734e+00 4.729690310747955095e+00
3.499999999999999556e+00 4.808284392450754119e+00
3.549999999999999822e+00 4.887294379338975148e+00
3.599999999999999645e+00 4.966717865588800684e+00
3.649999999999999911e+00 5.046552485361268658e+00
3.699999999999999734e+00 5.126795911713784015e+00
3.749999999999999556e+00 5.207445855552572667e+00
3.799999999999999822e+00 5.288500064624081176e+00
Loading