mirror of
https://github.com/Richard-Sti/csiborgtools_public.git
synced 2025-05-13 06:01:13 +00:00
Sorting of CSiBORG2 initial snapshot (#99)
* Attempt at the sorting script * Fix bug in CSiBORG2 sorting * and check sstatement * Simplify paths * Improve paths too * Update .gitignroe * Just rewrite commands..
This commit is contained in:
parent
7dfc7514d2
commit
b8863a903e
5 changed files with 163 additions and 18 deletions
|
@ -178,13 +178,13 @@ class Paths:
|
|||
f"snapshot_{str(nsnap).zfill(5)}.hdf5")
|
||||
elif simname == "csiborg2_main":
|
||||
return join(self.csiborg2_main_srcdir, f"chain_{nsim}", "output",
|
||||
f"snapshot_{str(nsnap).zfill(3)}_full.hdf5")
|
||||
f"snapshot_{str(nsnap).zfill(3)}.hdf5")
|
||||
elif simname == "csiborg2_random":
|
||||
return join(self.csiborg2_random_srcdir, f"chain_{nsim}", "output",
|
||||
f"snapshot_{str(nsnap).zfill(3)}_full.hdf5")
|
||||
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)}_full.hdf5")
|
||||
"output", f"snapshot_{str(nsnap).zfill(3)}.hdf5")
|
||||
elif simname == "quijote":
|
||||
return join(self.quijote_dir, "fiducial_processed",
|
||||
f"chain_{nsim}",
|
||||
|
|
|
@ -346,8 +346,16 @@ class CSIBORG2Snapshot(BaseSnapshot):
|
|||
super().__init__(nsim, nsnap, paths)
|
||||
self.kind = kind
|
||||
|
||||
self._snapshot_path = self.paths.snapshot(
|
||||
self.nsnap, self.nsim, f"csiborg2_{self.kind}")
|
||||
fpath = self.paths.snapshot(self.nsnap, self.nsim,
|
||||
f"csiborg2_{self.kind}")
|
||||
if nsnap == 99:
|
||||
fpath = fpath.replace(".hdf5", "_full.hdf5")
|
||||
elif nsnap == 0:
|
||||
fpath = fpath.replace(".hdf5", "_sorted.hdf5")
|
||||
else:
|
||||
fpath = fpath.replace(".hdf5", "_cut.hdf5")
|
||||
|
||||
self._snapshot_path = fpath
|
||||
self._simname = f"csiborg2_{self.kind}"
|
||||
|
||||
@property
|
||||
|
@ -444,7 +452,7 @@ class CSIBORG2Snapshot(BaseSnapshot):
|
|||
|
||||
def _make_hid2offset(self):
|
||||
catalogue_path = self.paths.snapshot_catalogue(
|
||||
self.nsnap, self.nsim, f"csiborg2_{self.kind}")
|
||||
99, self.nsim, f"csiborg2_{self.kind}")
|
||||
with File(catalogue_path, "r") as f:
|
||||
|
||||
offset = f["Group/GroupOffsetType"][:, 1]
|
||||
|
@ -502,6 +510,7 @@ class QuijoteSnapshot(CSIBORG1Snapshot):
|
|||
# Base field class #
|
||||
###############################################################################
|
||||
|
||||
|
||||
class BaseField(ABC):
|
||||
"""
|
||||
Base class for reading fields such as density or velocity fields.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue