mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 23:38:03 +00:00
9e4b34f579
* Update README * Update density field reader * Update name of SDSSxALFAFA * Fix quick bug * Add little fixes * Update README * Put back fit_init * Add paths to initial snapshots * Add export * Remove some choices * Edit README * Add Jens' comments * Organize imports * Rename snapshot * Add additional print statement * Add paths to initial snapshots * Add masses to the initial files * Add normalization * Edit README * Update README * Fix bug in CSiBORG1 so that does not read fof_00001 * Edit README * Edit README * Overwrite comments * Add paths to init lag * Fix Quijote path * Add lagpatch * Edit submits * Update README * Fix numpy int problem * Update README * Add a flag to keep the snapshots open when fitting * Add a flag to keep snapshots open * Comment out some path issue * Keep snapshots open * Access directly snasphot * Add lagpatch for CSiBORG2 * Add treatment of x-z coordinates flipping * Add radial velocity field loader * Update README * Add lagpatch to Quijote * Fix typo * Add setter * Fix typo * Update README * Add output halo cat as ASCII * Add import * Add halo plot * Update README * Add evaluating field at radial distanfe * Add field shell evaluation * Add enclosed mass computation * Add BORG2 import * Add BORG boxsize * Add BORG paths * Edit run * Add BORG2 overdensity field * Add bulk flow clauclation * Update README * Add new plots * Add nbs * Edit paper * Update plotting * Fix overlap paths to contain simname * Add normalization of positions * Add default paths to CSiBORG1 * Add overlap path simname * Fix little things * Add CSiBORG2 catalogue * Update README * Add import * Add TNG density field constructor * Add TNG density * Add draft of calculating BORG ACL * Fix bug * Add ACL of enclosed density * Add nmean acl * Add galaxy bias calculation * Add BORG acl notebook * Add enclosed mass calculation * Add TNG300-1 dir * Add TNG300 and BORG1 dir * Update nb
829 KiB
829 KiB
In [1]:
import numpy as np
%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 [28]:
Nsim = 9844
Nsnap = 1016
sim = utils.load_processed(Nsim, Nsnap)
sim = sim[sim["dist"] < 200]
gals = utils.load_2mpp()
gals = gals[gals["CDIST_CMB"] < 200]
planck = utils.load_planck2015()
In [101]:
dx = 40
dmin = 100
dmax = dmin + dx
mask_obs = (dmin < gals["CDIST_CMB"]) & (gals["CDIST_CMB"] < dmax)
mask_sim = (dmin < sim["dist"]) & (sim["dist"] < dmax) & (sim["m200"] > 1e12)
mask_planck = (dmin < planck["COMDIST"]) & (planck["COMDIST"] < dmax)
print(mask_planck.sum())
plt.figure()
plt.scatter(sim["ra"][mask_sim], sim["dec"][mask_sim], s=1, label="CSiBORG")
plt.scatter(gals["RA"][mask_obs], gals["DEC"][mask_obs], s=1, label="2M++")
plt.scatter(planck["RA"][mask_planck], planck["DEC"][mask_planck], s=50, label="Planck", c="m")
plt.legend()
plt.title(r"$M_{{200c}} > 10^{{12}} M_\odot$ and ${}~\mathrm{{Mpc}} < D_{{c}} < {}~\mathrm{{Mpc}}$"
.format(dmin, dmax))
plt.xlabel(r"$\mathrm{RA}$")
plt.ylabel(r"$\delta$")
plt.savefig("../plots/sky_comparison.png", dpi=400)
plt.show()
In [75]:
planck = utils.load_planck2015(1500)
plt.figure()
plt.scatter(planck["COMDIST"], planck["MSZ"], s=3)
plt.axvline(200, c="red", zorder=0)
plt.title("Planck clusters")
plt.xlabel(r"$D_{c}~[\mathrm{Mpc}]$")
plt.ylabel(r"$M_{500c}$")
plt.yscale("log")
plt.tight_layout()
plt.savefig("../plots/planck_mass_dist.png", dpi=450)
plt.show()
In [77]:
planck = utils.load_planck2015(200)
In [103]:
mask_sim = sim["m500"] > 1e14
mask_planck = planck["MSZ"] > 1e14
plt.figure()
plt.scatter(planck["RA"], planck["DEC"], label="Planck", c=np.log10(planck["MSZ"]))
plt.colorbar()
plt.scatter(sim["ra"][mask_sim], sim["dec"][mask_sim], label="CSiBORG", c="red", s=3, zorder=1)
plt.legend(loc=2)
plt.title(r"Sky comparison of CSiBORG and Planck of $M_{500c} > 10^{14} M_\odot$")
plt.xlabel(r"$\mathrm{RA}$")
plt.ylabel(r"$\delta$")
plt.tight_layout()
plt.savefig("../plots/clusters_positions.png", dpi=450)
plt.show()
In [ ]: