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

33 lines
749 B
Python
Raw Normal View History

2022-05-06 09:51:43 +02:00
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.axes import Axes
from matplotlib.colors import LogNorm
from matplotlib.figure import Figure
2022-05-06 13:23:31 +02:00
from paths import base_dir
2022-05-06 09:51:43 +02:00
from readfiles import read_file
def filter_for_2d(df: pd.DataFrame, group: int):
xs = df_ref.X
ys = df_ref.Y
return np.array([xs, ys]).T
2022-05-06 13:23:31 +02:00
reference_dir = Path(base_dir / f"shannon_512_100")
2022-06-03 10:33:16 +02:00
df_ref, _ = read_file(reference_dir / "output_0004.hdf5")
2022-05-06 09:51:43 +02:00
df = df_ref.loc[df_ref["FOFGroupIDs"] == 1]
df2 = df_ref.loc[df_ref["FOFGroupIDs"] == 4]
fig: Figure = plt.figure()
ax: Axes = fig.gca()
# ax.hist2d(df.X, df.Y, bins=500, norm=LogNorm())
ax.hist2d(df2.X, df2.Y, bins=1000, norm=LogNorm())
plt.show()