diff --git a/Snakefile b/Snakefile index e69de29..a8735fc 100644 --- a/Snakefile +++ b/Snakefile @@ -0,0 +1,27 @@ +rule figure1: + output: + directory("src/data/Figure1") + conda: + "environment.yml" + cache: + True + script: + "src/scripts/run_ebtel_figure1.py" +rule figure2: + output: + directory("src/data/Figure2") + conda: + "environment.yml" + cache: + True + script: + "src/scripts/run_ebtel_figure2.py" +rule figure3: + output: + directory("src/data/Figure3") + conda: + "environment.yml" + cache: + True + script: + "src/scripts/run_ebtel_figure3.py" diff --git a/showyourwork.yml b/showyourwork.yml index 62572a6..862a867 100644 --- a/showyourwork.yml +++ b/showyourwork.yml @@ -31,6 +31,12 @@ datasets: # Custom file dependencies dependencies: + src/scripts/render_figure1.py: + - src/data/Figure1/ + src/scripts/render_figure2.py: + - src/data/Figure2/ + src/scripts/render_figure3.py: + - src/data/Figure3/ # src/scripts/my_script.py: # - src/data/dataset_for_my_script.dat # src/tex/ms.tex: diff --git a/src/scripts/paths.py b/src/scripts/paths.py index 6d39e51..5b09bb0 100644 --- a/src/scripts/paths.py +++ b/src/scripts/paths.py @@ -13,6 +13,9 @@ # Absolute path to the `src/data` folder (contains datasets) data = src / "data" +figure1 = data / "Figure1" +figure2 = data / "Figure2" +figure3 = data / "Figure3" # Absolute path to the `src/static` folder (contains static images) static = src / "static" diff --git a/src/scripts/render_figure1.py b/src/scripts/render_figure1.py index eaa672f..978434e 100644 --- a/src/scripts/render_figure1.py +++ b/src/scripts/render_figure1.py @@ -22,9 +22,9 @@ 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) + 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.figure1 / 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.figure1 / 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.figure1 / cfile) time = [t_v, t_p, t_c] temperature = [T_e_v, T_e_p, T_e_c] diff --git a/src/scripts/render_figure2.py b/src/scripts/render_figure2.py index a089b7b..07cb47d 100644 --- a/src/scripts/render_figure2.py +++ b/src/scripts/render_figure2.py @@ -22,9 +22,9 @@ 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) + 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.figure2 / 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.figure2 / 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.figure2 / cfile) time = [t_v, t_p, t_c] temperature = [T_e_v, T_e_p, T_e_c] diff --git a/src/scripts/render_figure3.py b/src/scripts/render_figure3.py index b568eb4..7317381 100644 --- a/src/scripts/render_figure3.py +++ b/src/scripts/render_figure3.py @@ -21,9 +21,9 @@ 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) + 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.figure3 / 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.figure3 / 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.figure3 / cfile) time = [t_v, t_p, t_c] temperature = [T_e_v, T_e_p, T_e_c] diff --git a/src/scripts/run_ebtel_figure1.py b/src/scripts/run_ebtel_figure1.py index 4f17929..0a2a4e4 100644 --- a/src/scripts/run_ebtel_figure1.py +++ b/src/scripts/run_ebtel_figure1.py @@ -26,21 +26,21 @@ os.chdir(paths.data) write_new_configuration(initial_lines, length = L, radiation = 'variable', heating_rate = [H], heating_duration = [t], - output_filename = paths.data / vfile) + output_filename = paths.figure1 / vfile) os.chdir(paths.ebtel_root) subprocess.run(["bin/ebtel++.run"]) os.chdir(paths.data) write_new_configuration(initial_lines, length = L, radiation = 'photospheric', heating_rate = [H], heating_duration = [t], - output_filename = paths.data / pfile) + output_filename = paths.figure1 / pfile) os.chdir(paths.ebtel_root) subprocess.run(["bin/ebtel++.run"]) os.chdir(paths.data) write_new_configuration(initial_lines, length = L, radiation = 'coronal', heating_rate = [H], heating_duration = [t], - output_filename = paths.data / cfile) + output_filename = paths.figure1 / cfile) os.chdir(paths.ebtel_root) subprocess.run(["bin/ebtel++.run"]) diff --git a/src/scripts/run_ebtel_figure2.py b/src/scripts/run_ebtel_figure2.py index c7eafcc..249473c 100644 --- a/src/scripts/run_ebtel_figure2.py +++ b/src/scripts/run_ebtel_figure2.py @@ -26,20 +26,20 @@ os.chdir(paths.data) write_new_configuration(initial_lines, length = L, radiation = 'variable', heating_rate = [H], heating_duration = [t], - output_filename = paths.data / vfile) + output_filename = paths.figure2 / vfile) os.chdir(paths.ebtel_root) subprocess.run(["bin/ebtel++.run"]) os.chdir(paths.data) write_new_configuration(initial_lines, length = L, radiation = 'photospheric', heating_rate = [H], heating_duration = [t], - output_filename = paths.data / pfile) + output_filename = paths.figure2 / pfile) os.chdir(paths.ebtel_root) subprocess.run(["bin/ebtel++.run"]) os.chdir(paths.data) write_new_configuration(initial_lines, length = L, radiation = 'coronal', heating_rate = [H], heating_duration = [t], - output_filename = paths.data / cfile) + output_filename = paths.figure2 / cfile) os.chdir(paths.ebtel_root) subprocess.run(["bin/ebtel++.run"]) diff --git a/src/scripts/run_ebtel_figure3.py b/src/scripts/run_ebtel_figure3.py index 52f4b2a..3ace2a5 100644 --- a/src/scripts/run_ebtel_figure3.py +++ b/src/scripts/run_ebtel_figure3.py @@ -27,7 +27,7 @@ heating_rate = [H, H, H, H, H], heating_duration = [t, t, t, t, t], heating_start = ['0','300','600','900','1200'], - output_filename = paths.data / vfile) + output_filename = paths.figure3 / vfile) os.chdir(paths.ebtel_root) subprocess.run(["bin/ebtel++.run"]) @@ -36,7 +36,7 @@ heating_rate = [H, H, H, H, H], heating_duration = [t, t, t, t, t], heating_start = ['0','300','600','900','1200'], - output_filename = paths.data / pfile) + output_filename = paths.figure3 / pfile) os.chdir(paths.ebtel_root) subprocess.run(["bin/ebtel++.run"]) @@ -45,6 +45,6 @@ heating_rate = [H, H, H, H, H], heating_duration = [t, t, t, t, t], heating_start = ['0','300','600','900','1200'], - output_filename = paths.data / cfile) + output_filename = paths.figure3 / cfile) os.chdir(paths.ebtel_root) subprocess.run(["bin/ebtel++.run"]) diff --git a/zenodo.yml b/zenodo.yml index 238e4ef..dd00b84 100644 --- a/zenodo.yml +++ b/zenodo.yml @@ -1,3 +1,4 @@ cache: main: - sandbox: + sandbox: 10.5072/zenodo.80336 +