Skip to content

Commit

Permalink
update the massive star initial model plot script (#2757)
Browse files Browse the repository at this point in the history
things weren't lining up
  • Loading branch information
zingale authored Feb 28, 2024
1 parent ac57e6b commit 582f93d
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions Exec/science/massive_star/analysis/initial_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ def find_r_for_rho(r, rho, rho_want):
return r[idx]


#file = "../15m_500_sec.aprox19.hse.6400"
file = "../15m_500_sec.aprox19.hse.20.0km"
Lx = 1.6384e10
file = "../15m_500_sec.aprox19.hse.5.00km"
Lx = 8.192e9

data = np.loadtxt(file)

Expand Down Expand Up @@ -65,6 +64,10 @@ def find_r_for_rho(r, rho, rho_want):

ax.set_xlabel("r [cm]")
ax.set_ylabel(r"$\rho~[\rm{g/cm^3}]$, $T~[K]$")

ax.set_xlim(None, 5.e10)
ax.grid(color="b", alpha=0.5, ls=":")

ax2 = ax.twinx()

ax2.set_ylabel(r"$Y_e$")
Expand All @@ -74,8 +77,9 @@ def find_r_for_rho(r, rho, rho_want):
lns = l1 + l2 + l3
labs = [l.get_label() for l in lns]

ax.legend(lns, labs, frameon=False)
ax.legend(lns, labs, frameon=False, loc=6)

# species plot

ax = fig.add_subplot(212)

Expand All @@ -92,27 +96,34 @@ def find_r_for_rho(r, rho, rho_want):

if Xmax > threshold:
if Xmax > 0.5:
lw = 2
lw = 3
ls = "-"
else:
lw = 1
ax.plot(data[:,0], data[:,n], label=var, lw=lw)
ls = "--"
ax.plot(data[:,0], data[:,n], label=var, lw=lw, ls=ls)


ax.axvline(r_refine, color="0.25", ls=":")

ax.axvline(Lx, color="0.25", ls="-")
ax.axvline(Lx, color="0.5", ls="-")

ax.set_xscale("log")
ax.set_yscale("log")

ax.set_xlabel("r [cm]")
ax.set_ylabel("mass fraction")

ax.legend(frameon=False, fontsize="small", ncol=2)
ax.set_xlim(None, 5.e10)
ax.set_ylim(1.e-6, None)

ax.grid(color="b", alpha=0.5, ls=":")

ax.legend(frameon=True, edgecolor="w", ncol=1, framealpha=0.5)

fig.set_size_inches((8, 12))

fig.tight_layout()

fig.savefig("initial_model.png")
fig.savefig("initial_model.pdf")

0 comments on commit 582f93d

Please sign in to comment.