csiborgtools/notebooks/flow/flow_mock_pv.ipynb
Richard Stiskalek ee222cd010
Fix overlap runs (#125)
* 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
2024-04-08 11:23:21 +02:00

198 KiB

In [2]:
import numpy as np
import healpy as hp
%matplotlib notebook
import matplotlib.pyplot as plt
# Local imports
try:
    import csiborgtools
except ModuleNotFoundError:
    import sys
    sys.path.append("../")
    import csiborgtools
import utils

%load_ext autoreload
%autoreload 2
In [110]:
obs = utils.load_2mpp()


cols = ["ra", "dec", "mass_cl", "dist"]

mmains = utils.load_mmains(1)
mmains = csiborgtools.utils.list_to_ndarray(mmains, cols)
sim = mmains[0, ...]
sim = csiborgtools.utils.array_to_structured(sim ,cols)

planck = utils.load_planck2015()
100%|█████████████████████████████████████████████| 1/1 [00:00<00:00,  3.30it/s]
In [119]:
dx = 20
dmin = 125
dmax = dmin + dx

mask_obs = (dmin < obs["CDIST_CMB"]) & (obs["CDIST_CMB"] < dmax)
mask_sim = (dmin < sim["dist"]) & (sim["dist"] < dmax) & (sim["mass_cl"] > 1e12)

width = 6.4
plt.figure(figsize=(width, width*0.75))
plt.scatter(obs["RA"][mask_obs], obs["DEC"][mask_obs], s=1.5, label="2M++")
plt.scatter(sim["ra"][mask_sim] , sim["dec"][mask_sim], s=1.5, label="CSiBORG")
plt.scatter(planck["RA"], planck["DEC"], label="Planck SZ clusters < 214 MPc", c="red")


plt.legend()
plt.xlabel("RA")
plt.ylabel("dec")
plt.tight_layout()
# plt.savefig("../plots/2mpp_overlap.png", dpi=450)
plt.show()
No description has been provided for this image
In [ ]:
fpath = "/mnt/zfsusers/rstiskalek/csiborgtools/data/HFI_PCCS_SZ-union_R2.08.fits"
obs = csiborgtools.io.read_planck2015(fpath, cosmo, 214)


c1 = SkyCoord(ra=obs["RA"]*u.degree, dec=obs["DEC"]*u.degree, distance=obs["COMDIST"]*u.Mpc)
c2 = SkyCoord(ra=sim["ra"]*u.degree, dec=sim["dec"]*u.degree, distance=sim["dist"]*u.Mpc)

sep, indxs = csiborgtools.match.brute_spatial_separation(c1, c2, N=100, angular=False, verbose=True, )
In [ ]:

In [ ]:

In [ ]:

In [ ]:

In [ ]: