mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 22:08:02 +00:00
ee222cd010
* Update nb * Update script * Update script * Rename * Update script * Update script * Remove warning * Ignore minors when extracting MAH * Fix paths bug * Move notebooks * Move files * Rename and delete things * Rename file * Move file * Rename things * Remove old print statement * Add basic MAH plot * Add random MAH path * Output snapshot numbers * Add MAH random extraction * Fix redshift bug * Edit script * Add extracting random MAH * Little updates * Add CB2 redshift * Add some caching * Add diagnostic plots * Add caching * Minor updates * Update nb * Update notebook * Update script * Add Sorce randoms * Add CB2 varysmall * Update nb * Update nb * Update nb * Use catalogue HMF * Move definition of radec2galactic * Update nb * Update import * Update import * Add galatic coords to catalogues * Update nb
46 KiB
46 KiB
In [2]:
import sys
import numpy as np
import matplotlib.pyplot as plt
import scienceplots
import astroquery
from tqdm import trange, tqdm
sys.path.append("../")
import csiborgtools
%matplotlib widget
%load_ext autoreload
%autoreload 2
In [38]:
# # Norma
cluster = {"RA": (16 + 15 / 60 + 32.8 / 60**2) * 15,
"DEC": -60 + 54 / 60 + 30 / 60**2,
"DIST": 67.8}
Xclust = np.array([cluster["DIST"], cluster["RA"], cluster["DEC"]]).reshape(1, -1)
In [39]:
paths = csiborgtools.read.Paths(**csiborgtools.paths_glamdring)
nsims = paths.get_ics(False)
In [29]:
Xclust = np.array([cluster["DIST"], cluster["RA"], cluster["DEC"]]).reshape(1, -1)
In [33]:
matches = np.full(len(nsims), np.nan)
for ii in trange(101):
cat = csiborgtools.read.CSiBORGHaloCatalogue(nsims[ii], paths, minmass=('M', 1e13))
dist, ind = cat.angular_neighbours(Xclust, ang_radius=5, rad_tolerance=10)
dist = dist[0]
ind = ind[0]
if ind.size > 0:
matches[ii] = np.max(cat['M'][ind])
In [37]:
x = np.log10(matches[~np.isnan(matches)])
plt.figure()
plt.hist(x, bins=10)
plt.show()
In [ ]: