Edit the particle paths

This commit is contained in:
rstiskalek 2023-04-30 12:12:37 +01:00
parent 553eec8228
commit 7d947f5421

View File

@ -326,30 +326,32 @@ class CSiBORGPaths:
fname = f"radpos_{str(nsim).zfill(5)}_{str(nsnap).zfill(5)}.npz"
return join(fdir, fname)
def particle_h5py_path(self, nsim, with_vel):
def particle_h5py_path(self, nsim, kind=None):
"""
Path to the files containing all particles in a `.hdf5` file. Used for
the SPH calculation.
Path to the file containing all particles in a `.h5` file.
Parameters
----------
nsim : int
IC realisation index.
with_vel : bool
Whether velocities are included.
kind : str
Type of output. Must be one of `[None, 'pos', 'clumpmap']`.
pos_only : bool
Whether this file contains only positions.
Returns
-------
path : str
"""
fdir = join(self.postdir, "environment")
assert kind in [None, "pos", "clumpmap"]
fdir = join(self.postdir, "particles")
if not isdir(fdir):
makedirs(fdir)
warn(f"Created directory `{fdir}`.", UserWarning, stacklevel=1)
if with_vel:
if kind is None:
fname = f"parts_{str(nsim).zfill(5)}.h5"
else:
fname = f"parts_pos_{str(nsim).zfill(5)}.h5"
fname = f"parts_{kind}_{str(nsim).zfill(5)}.h5"
return join(fdir, fname)
def density_field_path(self, mas, nsim):