1
0
Fork 0
mirror of https://github.com/Findus23/halo_comparison.git synced 2024-09-19 16:03:50 +02:00
halo_comparison/hmf_test.py

35 lines
1.2 KiB
Python
Raw Permalink Normal View History

2022-12-13 11:42:07 +01:00
import matplotlib.pyplot as plt
2022-12-15 16:44:14 +01:00
import read_vr_files
2022-12-13 11:42:07 +01:00
from paths import base_dir
2022-12-15 16:44:14 +01:00
for i, waveform in enumerate(
["DB2", "DB8", "shannon"]):
2022-12-13 11:42:07 +01:00
for j, resolution in enumerate([128, 256, 512]):
2022-12-15 16:44:14 +01:00
if (waveform == "shannon_rehalo" or "resim" in waveform) and resolution != 128:
continue
2022-12-13 11:42:07 +01:00
print(waveform, resolution)
dir = base_dir / f"{waveform}_{resolution}_100"
2022-12-15 16:44:14 +01:00
# data = load(str(dir) + "/vroutput.properties.0")
# print(data)
# masses_200crit = data.masses.mass_200crit
# masses_200crit.convert_to_units("msun")
# lowest_halo_mass = 1e9 * unyt.msun
# highest_halo_mass = 8e15 * unyt.msun
# bin_centers, mass_function, error = tools.create_mass_function(
# masses_200crit, lowest_halo_mass, highest_halo_mass, (100 * Mpc) ** 3
# )
2022-12-13 11:42:07 +01:00
#
2022-12-15 16:44:14 +01:00
# name = f"{waveform} {resolution}"
2022-12-13 11:42:07 +01:00
2022-12-15 16:44:14 +01:00
# plt.loglog(bin_centers, mass_function, label=name)
# halos = read_halo_file(dir/"fof_output_0004.hdf5")
#
# print(halos["Masses"].sort_values(ascending=False)[:4].to_numpy())
halos = read_vr_files.read_velo_halos(dir)
print(halos["R_200mean"].sort_values(ascending=False)[:4].to_numpy())
2022-12-13 11:42:07 +01:00
2022-12-15 16:44:14 +01:00
plt.legend()
2022-12-13 11:42:07 +01:00
plt.show()