Skip to content

Commit

Permalink
add individual scripts for figures
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Reep authored and Jeffrey Reep committed May 9, 2024
1 parent c8b4187 commit 6dcf703
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 0 deletions.
File renamed without changes.
31 changes: 31 additions & 0 deletions src/scripts/render_figure1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""
Script to render the data into Figure 1
"""
import numpy as np
import paths
from plot import plot_figures
from read import read_ebtel_file


# Let's calculate some cases with single heating events first
lengths = ['40']
heat = ['1.0','0.1','0.03','0.01']
duration = ['20']

for L in lengths:
for H in heat:
for t in duration:
vfile = 'var_L'+L+'_H'+H+'_t'+t+'.txt'
pfile = 'pho_L'+L+'_H'+H+'_t'+t+'.txt'
cfile = 'cor_L'+L+'_H'+H+'_t'+t+'.txt'

t_v, T_e_v, T_i_v, n_v, P_e_v, P_i_v, v_v, Q_v = read_ebtel_file(filename=paths.data / vfile)
t_p, T_e_p, T_i_p, n_p, P_e_p, P_i_p, v_p, Q_p = read_ebtel_file(filename=paths.data / pfile)
t_c, T_e_c, T_i_c, n_c, P_e_c, P_i_c, v_c, Q_c = read_ebtel_file(filename=paths.data / cfile)

time = [t_v, t_p, t_c]
temperature = [T_e_v, T_e_p, T_e_c]
density = [n_v, n_p, n_c]

plot_figures(time, temperature, density, L, H, t)
31 changes: 31 additions & 0 deletions src/scripts/render_figure2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""
Script to render the data into Figure 2
"""
import numpy as np
import paths
from plot import plot_figures
from read import read_ebtel_file


# Let's calculate some cases with single heating events first
lengths = ['80']
heat = ['1.0','0.1','0.03','0.01']
duration = ['20']

for L in lengths:
for H in heat:
for t in duration:
vfile = 'var_L'+L+'_H'+H+'_t'+t+'.txt'
pfile = 'pho_L'+L+'_H'+H+'_t'+t+'.txt'
cfile = 'cor_L'+L+'_H'+H+'_t'+t+'.txt'

t_v, T_e_v, T_i_v, n_v, P_e_v, P_i_v, v_v, Q_v = read_ebtel_file(filename=paths.data / vfile)
t_p, T_e_p, T_i_p, n_p, P_e_p, P_i_p, v_p, Q_p = read_ebtel_file(filename=paths.data / pfile)
t_c, T_e_c, T_i_c, n_c, P_e_c, P_i_c, v_c, Q_c = read_ebtel_file(filename=paths.data / cfile)

time = [t_v, t_p, t_c]
temperature = [T_e_v, T_e_p, T_e_c]
density = [n_v, n_p, n_c]

plot_figures(time, temperature, density, L, H, t)
32 changes: 32 additions & 0 deletions src/scripts/render_figure3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""
Script to render the data into Figure 3
"""
import numpy as np
import paths
from plot import plot_figures
from read import read_ebtel_file


# Let's calculate a couple of nanoflare trains for comparison
lengths = ['40', '80']
heat = ['0.01']
duration = ['20']
for L in lengths:
for H in heat:
for t in duration:
vfile = 'var_train_L'+L+'_H'+H+'_t'+t+'.txt'
pfile = 'pho_train_L'+L+'_H'+H+'_t'+t+'.txt'
cfile = 'cor_train_L'+L+'_H'+H+'_t'+t+'.txt'

t_v, T_e_v, T_i_v, n_v, P_e_v, P_i_v, v_v, Q_v = read_ebtel_file(filename=paths.data / vfile)
t_p, T_e_p, T_i_p, n_p, P_e_p, P_i_p, v_p, Q_p = read_ebtel_file(filename=paths.data / pfile)
t_c, T_e_c, T_i_c, n_c, P_e_c, P_i_c, v_c, Q_c = read_ebtel_file(filename=paths.data / cfile)

time = [t_v, t_p, t_c]
temperature = [T_e_v, T_e_p, T_e_c]
density = [n_v, n_p, n_c]

plot_figures(time, temperature, density, L, H, t,
filename = 'train_L'+L+'_H'+H+'_t'+t+'.png',
xlim = [0, 40])

0 comments on commit 6dcf703

Please sign in to comment.