mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 17:18:02 +00:00
779f2e76ac
* Update redshift reading * Add helio to CMB redshift * Update imports * Update nb * Run for Quijote * Add script * Update * Update .gitignore * Update imports * Add Peery estimator * Add bulk flow scripts * Update typs * Add comment * Add blank space * Update submission script * Update description * Add barriers * Update nb * Update nb * Rename script * Move to old * Update imports * Add nb * Update script * Fix catalogue key * Update script * Update submit * Update comment * Update .gitignore * Update nb * Update for stationary obsrevers * Update submission * Add nb * Add better verbose control * Update nb * Update submit * Update nb * Add SN errors * Add draft of the script * Update verbosity flags * Add submission script * Debug script * Quickfix * Remove comment * Update nb * Update submission * Update nb * Processed UPGLADE
41 KiB
41 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 [ ]: