mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-10-19 00:15:06 +02:00
c4557cf35b
* Rename file * Add indents * Update imports * Add counting * Docs * Add nb * Rename nb * Update nb * Add PV processing * Update nb * Add Pantheon+groups * Update submission scripts * Add Pantheon+zSN * Update nb * Edit param * Matchin SFI * Update nb * Fix path bug * Add list of clusters * Update imports * Update imports * Add cartesian & mass of clusters * Add observation to halo matching * Add nb * Add inverse CDF * Add import * Update nb * Add comments
25 lines
740 B
Python
25 lines
740 B
Python
import csiborgtools
|
|
from tqdm import tqdm
|
|
|
|
|
|
def open_cat(nsim, simname, bounds):
|
|
if "csiborg1" in simname:
|
|
cat = csiborgtools.read.CSiBORG1Catalogue(nsim, bounds=bounds)
|
|
elif "csiborg2" in simname:
|
|
cat = csiborgtools.read.CSiBORG2Catalogue(
|
|
nsim, 99, simname.split("_")[-1], bounds=bounds)
|
|
else:
|
|
raise ValueError(f"Unknown simulation name: {simname}.")
|
|
|
|
return cat
|
|
|
|
|
|
def open_cats(simname, bounds):
|
|
paths = csiborgtools.read.Paths(**csiborgtools.paths_glamdring)
|
|
nsims = paths.get_ics(simname)
|
|
catalogues = [None] * len(nsims)
|
|
|
|
for i, nsim in enumerate(tqdm(nsims, desc="Opening catalogues")):
|
|
catalogues[i] = open_cat(nsim, simname, bounds)
|
|
|
|
return catalogues |