Add SWIFT SPH (#147)

* Add new params

* Add manticore params

* Add SWIFT reader

* Update script

* Simplify

* Add comment

* Update H0 values for the void

* Update queue
This commit is contained in:
Richard Stiskalek 2024-09-19 14:34:22 +02:00 committed by GitHub
parent 1fc9ca9306
commit c2bc5a6398
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 104 additions and 28 deletions

View file

@ -28,7 +28,13 @@ from tqdm import trange
def interpolate_indranil_void(kind, nsims, RA, dec, rmax, dr, dump_folder,
catalogue):
if kind not in ["exp", "gauss", "mb"]:
if kind == "mb":
h = 0.7615
elif kind == "gauss":
h = 0.7724
elif kind == "exp":
h = 0.7725
else:
raise ValueError(f"Unknown void kind: `{kind}`.")
kind = kind.upper()
@ -48,11 +54,10 @@ def interpolate_indranil_void(kind, nsims, RA, dec, rmax, dr, dump_folder,
fname = join(fdir, f"v_pec_{kind}profile_rLG_{nsim}.dat")
data = np.loadtxt(fname)
# The grid is in Mpc
r_grid = np.arange(0, 251)
# The grid is in Mpc from 0 to 251 but we convert to Mpc / h
r_grid = np.arange(0, 251) * h
phi_grid = np.arange(0, 181)
# The input is in Mpc/h, so we need to convert to Mpc
r_eval = np.arange(0, rmax, dr).astype(float) / 0.674
r_eval = np.arange(0, rmax, dr).astype(float)
model_axis = SkyCoord(l=117, b=4, frame='galactic', unit='deg').icrs
coords = SkyCoord(ra=RA, dec=dec, unit='deg').icrs
@ -76,7 +81,7 @@ def interpolate_indranil_void(kind, nsims, RA, dec, rmax, dr, dump_folder,
# Write the output, homogenous density.
density = np.ones_like(result)
with File(fname_out, 'a') as f_out:
f_out.create_dataset(f"rdist_{k}", data=r_eval * 0.674)
f_out.create_dataset(f"rdist_{k}", data=r_eval)
f_out.create_dataset(f"density_{k}", data=density)
f_out.create_dataset(f"velocity_{k}", data=result)

View file

@ -1,7 +1,7 @@
nthreads=1
memory=7
memory=4
on_login=${1}
queue="berg"
queue="cmb"
env="/mnt/users/rstiskalek/csiborgtools/venv_csiborg/bin/python"
file="field_los_indranil_void.py"