mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 09:18:03 +00:00
Fix reading varysmall (#103)
* Fix paths * Add new chains options * Remove old imports
This commit is contained in:
parent
b4a29aea85
commit
78443e30b5
4 changed files with 22 additions and 15 deletions
|
@ -94,7 +94,7 @@ class Paths:
|
|||
files = [int(search(r'chain_(\d+)', f).group(1)) for f in files]
|
||||
elif simname == "csiborg2_varysmall":
|
||||
files = glob(join(self.csiborg2_varysmall_srcdir, "chain_*"))
|
||||
files = [int(search(r'chain_16417(\d+)', f).group(1))
|
||||
files = [int(search(r'chain_16417_(\d+)', f).group(1))
|
||||
for f in files]
|
||||
elif simname == "quijote":
|
||||
files = glob(join(self.quijote_dir, "fiducial_processed",
|
||||
|
@ -138,7 +138,8 @@ class Paths:
|
|||
for f in snaps]
|
||||
snaps = sorted(snaps)
|
||||
elif simname == "csiborg2_varysmall":
|
||||
snaps = glob(join(self.csiborg2_random_srcdir, f"chain_{nsim}",
|
||||
snaps = glob(join(self.csiborg2_random_srcdir,
|
||||
f"chain_16417_{str(nsim).zfill(3)}",
|
||||
"snapshot_*"))
|
||||
snaps = [int(search(r'snapshot_16417_(\d+)', f).group(1))
|
||||
for f in snaps]
|
||||
|
@ -183,8 +184,9 @@ class Paths:
|
|||
return join(self.csiborg2_random_srcdir, f"chain_{nsim}", "output",
|
||||
f"snapshot_{str(nsnap).zfill(3)}.hdf5")
|
||||
elif simname == "csiborg2_varysmall":
|
||||
return join(self.csiborg2_varysmall_srcdir, f"chain_{nsim}",
|
||||
"output", f"snapshot_{str(nsnap).zfill(3)}.hdf5")
|
||||
return join(self.csiborg2_varysmall_srcdir,
|
||||
f"chain_16417_{str(nsim).zfill(3)}", "output",
|
||||
f"snapshot_{str(nsnap).zfill(3)}.hdf5")
|
||||
elif simname == "quijote":
|
||||
return join(self.quijote_dir, "fiducial_processed",
|
||||
f"chain_{nsim}",
|
||||
|
@ -219,8 +221,8 @@ class Paths:
|
|||
return join(self.csiborg2_ranodm_srcdir, f"chain_{nsim}", "output",
|
||||
f"fof_subhalo_tab_{str(nsnap).zfill(3)}.hdf5")
|
||||
elif simname == "csiborg2_varysmall":
|
||||
return join(self.csiborg2_varysmall_srcdir, f"chain_{nsim}",
|
||||
"output",
|
||||
return join(self.csiborg2_varysmall_srcdir,
|
||||
f"chain_16417_{str(nsim).zfill(3)}", "output",
|
||||
f"fof_subhalo_tab_{str(nsnap).zfill(3)}.hdf5")
|
||||
elif simname == "quijote":
|
||||
return join(self.quijote_dir, "fiducial_processed",
|
||||
|
|
|
@ -21,6 +21,4 @@ from .overlap_summary import (NPairsOverlap, PairOverlap, get_cross_sims,
|
|||
find_peak) # noqa
|
||||
from .pk_summary import PKReader # noqa
|
||||
from .tpcf_summary import TPCFReader # noqa
|
||||
from .field_interp import (read_interpolated_field, # noqa
|
||||
bayesian_bootstrap_correlation, # noqa
|
||||
correlate_at_fixed_smoothing) # noqa
|
||||
from .field_interp import read_interpolated_field # noqa
|
||||
|
|
|
@ -319,6 +319,9 @@ class CSiBORG2Reader(BaseReader):
|
|||
raise ValueError(f"Unknown kind `{kind}`.")
|
||||
self.base_dir = f"/mnt/extraspace/rstiskalek/csiborg2_{kind}"
|
||||
|
||||
if kind == "varysmall":
|
||||
self.nsim = f"16417_{str(self.nsim).zfill(3)}"
|
||||
|
||||
if which_snapshot == "initial":
|
||||
self.nsnap = 0
|
||||
elif which_snapshot == "final":
|
||||
|
@ -327,19 +330,19 @@ class CSiBORG2Reader(BaseReader):
|
|||
raise ValueError(f"Unknown snapshot option `{which_snapshot}`.")
|
||||
|
||||
self.source_dir = join(
|
||||
self.base_dir, f"chain_{nsim}", "output",
|
||||
self.base_dir, f"chain_{self.nsim}", "output",
|
||||
f"snapshot_{str(self.nsnap).zfill(3)}_full.hdf5")
|
||||
if which_snapshot == "initial":
|
||||
self.source_dir = self.source_dir.replace("_full.hdf5", ".hdf5")
|
||||
|
||||
self.output_dir = join(self.base_dir, f"chain_{nsim}", "output")
|
||||
self.output_dir = join(self.base_dir, f"chain_{self.nsim}", "output")
|
||||
self.output_snap = join(
|
||||
self.output_dir,
|
||||
f"snapshot_{str(self.nsnap).zfill(3)}_sorted.hdf5")
|
||||
self.output_cat = None
|
||||
|
||||
self.offset_path = join(
|
||||
self.base_dir, f"chain_{nsim}", "output",
|
||||
self.base_dir, f"chain_{self.nsim}", "output",
|
||||
f"fof_subhalo_tab_{str(self.nsnap).zfill(3)}_full.hdf5")
|
||||
|
||||
def read_info(self):
|
||||
|
|
|
@ -15,9 +15,13 @@
|
|||
from os import system
|
||||
|
||||
if __name__ == "__main__":
|
||||
chains = [15717, 15817, 15917, 16017, 16117, 16217, 16317, 16417, 16517,
|
||||
16617, 16717, 16817, 16917, 17017, 17117, 17217, 17317, 17417]
|
||||
simname = "csiborg2_main"
|
||||
# chains = [15717, 15817, 15917, 16017, 16117, 16217, 16317, 16417, 16517,
|
||||
# 16617, 16717, 16817, 16917, 17017, 17117, 17217, 17317, 17417]
|
||||
# simname = "csiborg2_main"
|
||||
# mode = 1
|
||||
|
||||
chains = [1] + [25 + n * 25 for n in range(19)]
|
||||
simname = "csiborg2_varysmall"
|
||||
mode = 1
|
||||
|
||||
# chains = [7444 + n * 24 for n in range(1, 101)]
|
||||
|
|
Loading…
Reference in a new issue