From 1cde889797950e0c09ff3371099d4d30663a4177 Mon Sep 17 00:00:00 2001 From: Lukas Winkler Date: Thu, 28 Jul 2022 00:43:05 +0200 Subject: [PATCH] improve halo-plots --- halo_plot.py | 12 ++++++------ halo_vis.py | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/halo_plot.py b/halo_plot.py index 3d11de3..56eed80 100644 --- a/halo_plot.py +++ b/halo_plot.py @@ -63,17 +63,17 @@ def main(): rho = (rho + offset) * mass extent = coord_to_2d_extent(coords) img = ax.imshow(rho.T, norm=LogNorm(vmin=vmin_scaled, vmax=vmax_scaled), extent=extent, - origin="lower") + origin="lower",cmap="Greys") found_main_halo = False for halo_id, halo in halos.iterrows(): - if halo["Mvir"] > 20: + if halo["Vmax"] > 75: if in_area(coords, halo.X, halo.Y, halo.Z): if halo_id == main_halo_id: - color = "red" + color = "C2" elif halo["Structuretype"] > 10: - color = "lightgreen" + color = "C0" else: - color = "lightblue" + color = "C1" if halo_id == main_halo_id: found_main_halo = True print("plotting main halo") @@ -110,7 +110,7 @@ def main(): fig.colorbar(img, cax=cbar_ax) fig.savefig(Path(f"~/tmp/halo_plot_{initial_halo_id}.pdf").expanduser()) - fig.savefig(Path(f"~/tmp/halo_plot_{initial_halo_id}.png").expanduser()) + fig.savefig(Path(f"~/tmp/halo_plot_{initial_halo_id}.png").expanduser(), dpi=300) plt.show() diff --git a/halo_vis.py b/halo_vis.py index 7559c9a..636bb1f 100644 --- a/halo_vis.py +++ b/halo_vis.py @@ -10,6 +10,7 @@ from cic import cic_from_radius from paths import base_dir, vis_datafile, has_1024_simulations from read_vr_files import read_velo_halo_particles from readfiles import read_file +from utils import waveforms all_in_area = True