mirror of
https://github.com/Richard-Sti/csiborgtools_public.git
synced 2025-06-08 09:51:12 +00:00
Particle dumping (#49)
* Add paths * Add dumping script * Remove snap from density fields * Add progress statement * Update import ordering * Update nb
This commit is contained in:
parent
4f8335e0a3
commit
c14be720b5
3 changed files with 175 additions and 3 deletions
|
@ -326,6 +326,49 @@ class CSiBORGPaths:
|
|||
fname = f"radpos_{str(nsim).zfill(5)}_{str(nsnap).zfill(5)}.npz"
|
||||
return join(fdir, fname)
|
||||
|
||||
def particle_h5py_path(self, nsim):
|
||||
"""
|
||||
Path to the files containing all particles in a `.hdf5` file. Used for
|
||||
the SPH calculation.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
nsim : int
|
||||
IC realisation index.
|
||||
|
||||
Returns
|
||||
-------
|
||||
path : str
|
||||
"""
|
||||
fdir = join(self.postdir, "environment")
|
||||
if not isdir(fdir):
|
||||
makedirs(fdir)
|
||||
warn(f"Created directory `{fdir}`.", UserWarning, stacklevel=1)
|
||||
fname = f"particles_{str(nsim).zfill(5)}.h5"
|
||||
return join(fdir, fname)
|
||||
|
||||
def density_field_path(self, mas, nsim):
|
||||
"""
|
||||
Path to the files containing the calculated density fields.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
mas : str
|
||||
Mass-assignment scheme. Currently only SPH is supported.
|
||||
nsim : int
|
||||
IC realisation index.
|
||||
|
||||
Returns
|
||||
-------
|
||||
path : str
|
||||
"""
|
||||
fdir = join(self.postdir, "environment")
|
||||
if not isdir(fdir):
|
||||
makedirs(fdir)
|
||||
warn(f"Created directory `{fdir}`.", UserWarning, stacklevel=1)
|
||||
fname = f"density_{mas}_{str(nsim).zfill(5)}.npy"
|
||||
return join(fdir, fname)
|
||||
|
||||
def knnauto_path(self, run, nsim=None):
|
||||
"""
|
||||
Path to the `knn` auto-correlation files. If `nsim` is not specified
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue