mirror of
https://github.com/Richard-Sti/csiborgtools_public.git
synced 2025-05-14 06:31:11 +00:00
New filesystem, basic neighbours calculation (#10)
* simplify Planck catalogue * add MCXC and base survey * Add 2MPP classes * move match to MCXC to Planck * add halo catalogue * rm comment * rm unused imports * Move conversion to box * add min mass * Run on all simulations * rm old function * add combined catalogue * add halo positions * add knn neighbors * set to 5 sims for testing * add docstring * Switch to neighbours in a catalogue * rename io to read * fix indentation * rename to read * io -> read * add import * add RealisationMatcher * io -> read * add docstrings * add search_sim_indiices * update todo * keep make_cat at 10 for now * update nb
This commit is contained in:
parent
f5bf04c46e
commit
c748c87e45
17 changed files with 3515 additions and 549 deletions
|
@ -16,16 +16,14 @@
|
|||
Notebook utility functions.
|
||||
"""
|
||||
|
||||
# import numpy
|
||||
# from os.path import join
|
||||
|
||||
import numpy
|
||||
from os.path import join
|
||||
from astropy.cosmology import FlatLambdaCDM
|
||||
|
||||
try:
|
||||
import csiborgtools
|
||||
except ModuleNotFoundError:
|
||||
import sys
|
||||
sys.path.append("../")
|
||||
# try:
|
||||
# import csiborgtools
|
||||
# except ModuleNotFoundError:
|
||||
# import sys
|
||||
# sys.path.append("../")
|
||||
|
||||
|
||||
Nsplits = 200
|
||||
|
@ -42,52 +40,3 @@ _virgo = {"RA": (12 + 27 / 60) * 15,
|
|||
"COMDIST": 16.5}
|
||||
|
||||
specific_clusters = {"Coma": _coma, "Virgo": _virgo}
|
||||
|
||||
|
||||
def load_processed(Nsim, Nsnap):
|
||||
simpath = csiborgtools.io.get_sim_path(Nsim)
|
||||
outfname = join(
|
||||
dumpdir, "ramses_out_{}_{}.npy".format(str(Nsim).zfill(5),
|
||||
str(Nsnap).zfill(5)))
|
||||
data = numpy.load(outfname)
|
||||
# Add mmain
|
||||
mmain = csiborgtools.io.read_mmain(Nsim, "/mnt/zfsusers/hdesmond/Mmain")
|
||||
data = csiborgtools.io.merge_mmain_to_clumps(data, mmain)
|
||||
csiborgtools.utils.flip_cols(data, "peak_x", "peak_z")
|
||||
# Cut on numbre of particles and finite m200
|
||||
data = data[(data["npart"] > 100) & numpy.isfinite(data["m200"])]
|
||||
|
||||
# Do unit conversion
|
||||
boxunits = csiborgtools.units.BoxUnits(Nsnap, simpath)
|
||||
convert_cols = ["m200", "m500", "totpartmass", "mass_mmain",
|
||||
"r200", "r500", "Rs", "rho0", "peak_x", "peak_y", "peak_z"]
|
||||
data = csiborgtools.units.convert_from_boxunits(
|
||||
data, convert_cols, boxunits)
|
||||
# Now calculate spherical coordinates
|
||||
d, ra, dec = csiborgtools.units.cartesian_to_radec(data)
|
||||
data = csiborgtools.utils.add_columns(
|
||||
data, [d, ra, dec], ["dist", "ra", "dec"])
|
||||
return data, boxunits
|
||||
|
||||
|
||||
def load_planck2015(max_comdist=214):
|
||||
cosmo = FlatLambdaCDM(H0=70.5, Om0=0.307, Tcmb0=2.728)
|
||||
fpath = "../data/HFI_PCCS_SZ-union_R2.08.fits"
|
||||
return csiborgtools.io.read_planck2015(fpath, cosmo, max_comdist)
|
||||
|
||||
|
||||
def load_mcxc(max_comdist=214):
|
||||
cosmo = FlatLambdaCDM(H0=70.5, Om0=0.307, Tcmb0=2.728)
|
||||
fpath = ("../data/mcxc.fits")
|
||||
return csiborgtools.io.read_mcxc(fpath, cosmo, max_comdist)
|
||||
|
||||
|
||||
def load_2mpp():
|
||||
cosmo = FlatLambdaCDM(H0=70.5, Om0=0.307, Tcmb0=2.728)
|
||||
return csiborgtools.io.read_2mpp("../data/2M++_galaxy_catalog.dat", cosmo)
|
||||
|
||||
|
||||
def load_2mpp_groups():
|
||||
cosmo = FlatLambdaCDM(H0=70.5, Om0=0.307, Tcmb0=2.728)
|
||||
return csiborgtools.io.read_2mpp_groups(
|
||||
"../data/../data/2M++_group_catalog.dat", cosmo)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue