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

improve 1024 halo_mass_functions

This commit is contained in:
Lukas Winkler 2022-07-21 14:05:19 +02:00
parent d6e757535c
commit 6d295bdc9c
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -1,6 +1,5 @@
from math import log10, log
from math import log
from pathlib import Path
from sys import argv
import numpy as np
# from colossus.cosmology import cosmology
@ -8,9 +7,8 @@ import numpy as np
from matplotlib import pyplot as plt
from matplotlib.axes import Axes
from matplotlib.figure import Figure
from scipy.interpolate import interp1d
from paths import base_dir
from paths import base_dir, has_1024_simulations
from read_vr_files import read_velo_halos
from utils import print_progress
@ -27,8 +25,10 @@ def monofonic_tests():
fig: Figure = plt.figure()
ax: Axes = fig.gca()
linestyles = ["solid", "dashed", "dotted"]
colors = ["C1", "C2"]
linestyles = ["solid", "dashed", "dotted", "dashdot"]
resolutions = [128, 256, 512]
if has_1024_simulations:
resolutions.append(1024)
for i, waveform in enumerate(["DB2", "shannon"]):
for j, resolution in enumerate([128, 256, 512]):
@ -36,7 +36,6 @@ def monofonic_tests():
dir = base_dir / f"{waveform}_{resolution}_100"
halos = read_velo_halos(dir)
# halos.to_csv("weird_halos.csv")
halo_masses: np.ndarray = halos["Mvir"].to_numpy()
@ -48,7 +47,7 @@ def monofonic_tests():
# ax.bar(centers, number_densities, width=widths, log=True, fill=False)
name = f"{waveform} {resolution}"
ax.step(left_edges, number_densities, where="post", color=colors[i], linestyle=linestyles[j], label=name)
ax.step(left_edges, number_densities, where="post", color=f"C{i}", linestyle=linestyles[j], label=name)
ax.fill_between(
left_edges,
@ -152,7 +151,6 @@ def hmf_from_rockstar_tree(file: Path):
plt.show()
if __name__ == '__main__':
monofonic_tests()
# hmf_from_rockstar_tree(Path(argv[1]))