mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 22:48:02 +00:00
eb8d070fff
* Add moving FoF membership files * add FoF membership path * Add notes where its PHEW * Add FoF catalogue path * Correct typo * Add more functionalities * Make work with halo IDs from FoF * Edit print statement * Fix copy bug * copy * Add FoF catalogue reading * Clean up script * Fix typo * Little edits * Fix naming convention * Rename key * Remove loading substructure particles * Rename CSiBORG Cat * Rename clumps cat * Rename cat * Remove misplaced import * Switch to halos * rm import * structfit of only halos * Add FoF halo reading * Add a short comment * Fix __getitem__ to work with int * Fix problems * Improve __getitem__ * Add more conversion * Fix indexing * Fix __getitem__ assertion * Fix numbers * Rename * Fix verbosity flags * Add full Quijote HMF option * Add plot of Quijote only * Add quijote full paths * Fix the fit_init script * Renam arg * Update .gitignore * add default argument name * Change default verbosity flag * Modernise script structure * Fix dictionary * Fix reading to include m200c * Modernise script * Add args
25 KiB
25 KiB
In [1]:
import numpy as np
%matplotlib notebook
import matplotlib.pyplot as plt
try:
import csiborgtools
except ModuleNotFoundError:
import sys
sys.path.append("../")
import csiborgtools
import utils
%load_ext autoreload
%autoreload 2
import joblib
from os.path import join
from glob import glob
In [2]:
Nsim = 9844
simpath = csiborgtools.io.get_sim_path(Nsim)
Nsnap = 1016
outfname = join(utils.dumpdir, "ramses_out_{}_{}.npy".format(str(Nsim).zfill(5), str(Nsnap).zfill(5)))
mmain = csiborgtools.io.read_mmain(Nsim, "/mnt/zfsusers/hdesmond/Mmain")
data = np.load(outfname)
data = csiborgtools.io.merge_mmain_to_clumps(data, mmain)
data = data[(data["npart"] > 100) & np.isfinite(data["m200"])]
boxunits = csiborgtools.units.BoxUnits(Nsnap, simpath)
In [22]:
R = np.sqrt((data["peak_x"] - 0.5)**2 + (data["peak_y"] - 0.5)**2 + (data["peak_z"] - 0.5)**2)
In [29]:
boxunits.box2kpc(0.21) * 1e-3
Out[29]:
In [30]:
plt.figure()
plt.hist(R, bins="auto")
plt.axvline(0.22, c="red")
plt.show()
In [34]:
mass = boxunits.box2solarmass(data["m200"])
Out[34]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [3]:
# Nsplit = 0
# loaddir = join(utils.dumpdir, "temp")
# parts, part_clumps, clumps = csiborgtools.fits.load_split_particles(
# Nsplit, loaddir, Nsim, Nsnap, remove_split=False)
In [43]:
# n = 584
# xs = csiborgtools.fits.pick_single_clump(n, parts, part_clumps, clumps)
# halo = csiborgtools.fits.Clump.from_arrays(*xs, rhoc=boxunits.box_rhoc)
# print(halo.Npart)
In [ ]: