mirror of
https://github.com/Findus23/halo_comparison.git
synced 2024-09-19 16:03:50 +02:00
improve halo-plots
This commit is contained in:
parent
2aa038b052
commit
1cde889797
2 changed files with 7 additions and 6 deletions
12
halo_plot.py
12
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()
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue