mirror of
https://github.com/Richard-Sti/csiborgtools_public.git
synced 2025-05-14 06:31:11 +00:00
Add SFI groups (#121)
* Update LOS sampling * Bring SD back to speed * Update nb * Update script * Update requirements * Update flow chi2 calc * Update script * Add support for SFI groups * Update plot * Update script * Update script
This commit is contained in:
parent
27c1f9249b
commit
29b37172fa
7 changed files with 253 additions and 135 deletions
|
@ -58,7 +58,8 @@ def get_los(catalogue_name, simname, comm):
|
|||
if comm.Get_rank() == 0:
|
||||
folder = "/mnt/extraspace/rstiskalek/catalogs"
|
||||
|
||||
if catalogue_name in ["LOSS", "Foundation", "SFI_gals", "2MTF",
|
||||
if catalogue_name in ["LOSS", "Foundation", "SFI_gals",
|
||||
"SFI_gals_masked", "SFI_groups", "2MTF",
|
||||
"Pantheon+"]:
|
||||
fpath = join(folder, "PV_compilation_Supranta2019.hdf5")
|
||||
with File(fpath, 'r') as f:
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
nthreads=3
|
||||
nthreads=5
|
||||
memory=40
|
||||
on_login=${1}
|
||||
on_login=0
|
||||
queue="berg"
|
||||
env="/mnt/users/rstiskalek/csiborgtools/venv_csiborg/bin/python"
|
||||
file="field_los.py"
|
||||
|
||||
simname=${1}
|
||||
catalogue=${2}
|
||||
nsims="-1"
|
||||
simname="csiborg2_main"
|
||||
MAS="SPH"
|
||||
grid=1024
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ def get_model(args, nsim_iterator, get_model_kwargs):
|
|||
if args.catalogue == "A2":
|
||||
fpath = join(folder, "A2.h5")
|
||||
elif args.catalogue in ["LOSS", "Foundation", "Pantheon+", "SFI_gals",
|
||||
"2MTF"]:
|
||||
"2MTF", "SFI_groups", "SFI_gals_masked"]:
|
||||
fpath = join(folder, "PV_compilation_Supranta2019.hdf5")
|
||||
else:
|
||||
raise ValueError(f"Unknown catalogue: `{args.catalogue}`.")
|
||||
|
@ -107,10 +107,13 @@ def run_model(model, nsteps, nburn, nchains, nsim, dump_folder,
|
|||
# Calculate the chi2
|
||||
keys = list(thinned_samples.keys())
|
||||
nsamples = len(thinned_samples[keys[0]])
|
||||
zobs_mean, zobs_std = model.predict_zobs(thinned_samples)
|
||||
nu = model.ndata - len(keys)
|
||||
chi2 = [np.sum((zobs_mean[:, i] - model._z_obs)**2 / zobs_std[:, i]**2) / nu # noqa
|
||||
for i in range(nsamples)]
|
||||
try:
|
||||
zobs_mean, zobs_std = model.predict_zobs(thinned_samples)
|
||||
nu = model.ndata - len(keys)
|
||||
chi2 = [np.sum((zobs_mean[:, i] - model._z_obs)**2 / zobs_std[:, i]**2) / nu # noqa
|
||||
for i in range(nsamples)]
|
||||
except NotImplementedError:
|
||||
chi2 = [0. for _ in range(nsamples)]
|
||||
|
||||
gof = csiborgtools.numpyro_gof(model, mcmc, model_kwargs)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
memory=4
|
||||
on_login=1
|
||||
on_login=0
|
||||
nthreads=${1}
|
||||
ksmooth=${2}
|
||||
|
||||
|
@ -7,8 +7,8 @@ queue="berg"
|
|||
env="/mnt/users/rstiskalek/csiborgtools/venv_csiborg/bin/python"
|
||||
file="flow_validation.py"
|
||||
|
||||
catalogue="LOSS"
|
||||
simname="Carrick2015"
|
||||
catalogue="SFI_groups"
|
||||
simname="csiborg2_main"
|
||||
|
||||
|
||||
pythoncm="$env $file --catalogue $catalogue --simname $simname --ksmooth $ksmooth"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue