From cd03e0397bd0730c920bd349d08fc206239c704a Mon Sep 17 00:00:00 2001 From: "andrea.giannetti" <andrea.giannetti@inaf.it> Date: Mon, 24 Feb 2025 17:45:54 -0600 Subject: [PATCH] Added example figure of the profiles. --- etl/prs/prs_make_profiles_figure.py | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 etl/prs/prs_make_profiles_figure.py diff --git a/etl/prs/prs_make_profiles_figure.py b/etl/prs/prs_make_profiles_figure.py new file mode 100644 index 0000000..a6b8b57 --- /dev/null +++ b/etl/prs/prs_make_profiles_figure.py @@ -0,0 +1,31 @@ +import matplotlib.pyplot as plt +import numpy as np +import os + +# plt.rcParams.update({'font.size': 12}) + +p = -1.5 +q = -0.5 +n_0 = 1e5 +T_0 = 25 + +radius = np.linspace(0, 0.9, 100) +density = n_0 * (radius / 0.5) ** p +density[0] = 1e8 +temperature = T_0 * (radius / 0.5) ** q +temperature[0] = 2000 + +plt.clf() +fig, ax = plt.subplots(layout='constrained') +ln1 = ax.plot(radius, density, label=r'n(H$_2$)') +ax.semilogy() +ax.set_ylabel(r'Number density [cm$^{-3}$]') +ax.set_xlabel(r'Radius [pc]') +ax2 = ax.twinx() +ln2 = ax2.plot(radius, temperature, color='red', label='T') +lns = ln1 + ln2 +labs = [l.get_label() for l in lns] +ax.legend(lns, labs, loc=0) +ax2.semilogy() +ax2.set_ylabel('Temperature [K]') +plt.savefig(os.path.join('prs', 'output', 'density_temperature_profiles.png')) -- GitLab