csiborgtools/notebooks/match_observation/match_clusters.py
Richard Stiskalek c4557cf35b
Matching of observations (#127)
* 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
2024-04-23 12:02:09 +01:00

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