Remove old merger tree (#93)

* Edit docs

* Delete merger tree files

* Edit README

* Edit docs
This commit is contained in:
Richard Stiskalek 2023-12-07 14:45:06 +00:00 committed by GitHub
parent e972f8e3f2
commit 944fea5510
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 1134 deletions

View file

@ -12,7 +12,9 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""CSiBORG paths manager."""
"""
CSiBORG paths manager.
"""
from glob import glob, iglob
from os import makedirs
from os.path import isdir, join
@ -312,26 +314,6 @@ class Paths:
nsnap = str(nsnap).zfill(3)
return join(simpath, f"snapdir_{nsnap}", f"snap_{nsnap}")
def merger_tree_file(self, nsnap, nsim):
"""
Path to the CSiBORG on-the-fly generated merger tree file.
Parameters
----------
nsnap : int
Snapshot index.
nsim : int
IC realisation index.
Returns
-------
str
"""
nsim = str(nsim)
nsnap = str(nsnap).zfill(5)
return join(self.srcdir, f"ramses_out_{nsim}",
f"output_{nsnap}", f"mergertree_{nsnap}.dat")
def processed_output(self, nsim, simname, halo_finder):
"""
Path to the files containing all particles of a CSiBORG realisation at
@ -378,23 +360,6 @@ class Paths:
try_create_directory(fdir)
return join(fdir, f"phew_{str(nsim).zfill(5)}.hdf5")
def processed_merger_tree(self, nsim):
"""
Path to the files containing the processed original merger tree files.
Parameters
----------
nsim : int
IC realisation index.
Returns
-------
str
"""
fdir = join(self.postdir, "processed_output")
try_create_directory(fdir)
return join(fdir, f"merger_{str(nsim).zfill(5)}.hdf5")
def halomaker_particle_membership(self, nsnap, nsim, halo_finder):
"""
Path to the HaloMaker particle membership file (CSiBORG only).

View file

@ -145,8 +145,6 @@ class CSiBORGReader(BaseReader):
----------
paths : py:class`csiborgtools.read.Paths`
"""
# _snapshot_cache = {}
def __init__(self, paths):
self.paths = paths
@ -433,37 +431,6 @@ class CSiBORGReader(BaseReader):
return parent_arr, parent_mass
def read_merger_tree(self, nsnap, nsim):
"""
Read in the raw merger tree file.
Parameters
----------
nsnap : int
Snapshot index.
nsim : int
IC realisation index.
Returns
-------
data : 2-dimensional array
"""
fname = self.paths.merger_tree_file(nsnap, nsim)
# Do some checks if the file exists or is empty
if not isfile(fname) or getsize(fname) == 0:
raise FileExistsError(f"Merger file `{fname}` does not exist.")
data = numpy.genfromtxt(fname)
if data.ndim == 1:
raise FileExistsError(f"Invalid merger file `{fname}`.")
# Convert to Msun / h and cMpc / h but keep velocity in box units.
data[:, 3] *= 2.6543271649678946e+19
data[:, 5:8] *= 677.7
return data
###############################################################################
# Quijote particle reader #

View file

@ -12,7 +12,9 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""Collection of stand-off utility functions used in the scripts."""
"""
Collection of stand-off utility functions used in the scripts.
"""
import numpy
from numba import jit
from datetime import datetime