Periodic neighbours (#84)

* Edit the HMF plot

* Add periodic dist 2 points

* Add boxsize to RVSSphere

* Add periodic distance

* Adding periodic distance

* Add imports

* Change arguments

* Update bounds

* Lower min number of particles

* Change kwargs

* Add paths overlap quijote

* Add some comments
This commit is contained in:
Richard Stiskalek 2023-08-08 12:19:40 +02:00 committed by GitHub
parent c7e447df01
commit c7b600d0ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 196 additions and 61 deletions

View file

@ -57,12 +57,13 @@ def pair_match(nsim0, nsimx, simname, sigma, verbose):
None
"""
paths = csiborgtools.read.Paths(**csiborgtools.paths_glamdring)
smooth_kwargs = {"sigma": sigma, "mode": "wrap"}
smooth_kwargs = {"sigma": sigma, "mode": "constant", "cval": 0}
if simname == "csiborg":
overlapper_kwargs = {"box_size": 2048, "bckg_halfsize": 475}
overlapper_kwargs = {"box_size": 2048, "bckg_halfsize": 512}
mass_kind = "fof_totpartmass"
bounds = {mass_kind: (1e13, None)}
bounds = {"dist": (0, 155), mass_kind: (10**13.25, None)}
cat0 = csiborgtools.read.CSiBORGHaloCatalogue(
nsim0, paths, bounds=bounds, load_fitted=False,
with_lagpatch=True)
@ -72,11 +73,14 @@ def pair_match(nsim0, nsimx, simname, sigma, verbose):
elif simname == "quijote":
overlapper_kwargs = {"box_size": 512, "bckg_halfsize": 256}
mass_kind = "group_mass"
bounds = {mass_kind: (1e14, None)}
bounds = {mass_kind: (10**13.25, None)}
cat0 = csiborgtools.read.QuijoteHaloCatalogue(
nsim0, paths, 4, load_fitted=False, with_lagpatch=True)
nsim0, paths, 4, bounds=bounds, load_fitted=False,
with_lagpatch=True)
catx = csiborgtools.read.QuijoteHaloCatalogue(
nsimx, paths, 4, load_fitted=False, with_lagpatch=True)
nsimx, paths, 4, bounds=bounds, load_fitted=False,
with_lagpatch=True)
else:
raise ValueError(f"Unknown simulation name: `{simname}`.")
@ -116,7 +120,7 @@ def pair_match(nsim0, nsimx, simname, sigma, verbose):
for j, match in enumerate(matches):
match_hids[i][j] = catx["index"][match]
fout = paths.overlap(nsim0, nsimx, smoothed=False)
fout = paths.overlap(simname, nsim0, nsimx, smoothed=False)
if verbose:
print(f"{datetime.now()}: saving to ... `{fout}`.", flush=True)
numpy.savez(fout, ref_hids=cat0["index"], match_hids=match_hids,
@ -135,7 +139,7 @@ def pair_match(nsim0, nsimx, simname, sigma, verbose):
match_indxs, smooth_kwargs,
verbose=verbose)
fout = paths.overlap(nsim0, nsimx, smoothed=True)
fout = paths.overlap(simname, nsim0, nsimx, smoothed=True)
if verbose:
print(f"{datetime.now()}: saving to ... `{fout}`.", flush=True)
numpy.savez(fout, smoothed_overlap=smoothed_overlap, sigma=sigma)