diff --git a/Snakefile b/Snakefile index 3c880e9..7e08eb5 100644 --- a/Snakefile +++ b/Snakefile @@ -1,4 +1,12 @@ +rule unzip_MESA_output: + input: + "src/data/data.zip" + script: + "src/scripts/unzip_MESA_output.py" + rule plot_save_mesa_comparison_panels_fin: + input: + "src/data/data.zip" output: "src/tex/figures/age_vsurf_comparison_resolution_test.pdf" "src/tex/figures/HR_primary.pdf" @@ -8,6 +16,8 @@ rule plot_save_mesa_comparison_panels_fin: "src/scripts/plot_save_mesa_comparison_panels_fin.py" rule plot_save_mesa_comparison_panels_acc_fin: + input: + "src/data/data.zip" output: "src/tex/figures/age_vsurf_acceleration_panel.pdf" "src/tex/figures/age_omega_comparison_panel.pdf" @@ -15,18 +25,24 @@ rule plot_save_mesa_comparison_panels_acc_fin: "src/scripts/plot_save_mesa_comparison_panels_acc_fin.py" rule plot_e_fin: + input: + "src/data/data.zip" output: "src/tex/figures/age_e_comparison_panel.pdf" script: "src/scripts/plot_e_fin.py" rule hr_plot_paper2023_fin: + input: + "src/data/data.zip" output: "src/tex/figures/HR_REAL_ROT_Paper2023.pdf" script: "src/scripts/hr_plot_paper2023_fin.py" rule plot_save_mesa_comparison_wind_fin: + input: + "src/data/data.zip" output: "src/tex/figures/age_vsurf_comparison_onestar.pdf" "src/tex/figures/age_vsurf_comparison_onestar_resolution_vrot.pdf" @@ -35,12 +51,16 @@ rule plot_save_mesa_comparison_wind_fin: "src/scripts/plot_save_mesa_comparison_wind_fin.py" rule all_hr_fin: + input: + "src/data/data.zip" output: "src/tex/figures/age_vsurf_hr_all.pdf" script: "src/scripts/all_hr_fin.py" rule plot_save_mesa_ce: + input: + "src/data/data.zip" output: "src/tex/figures/r_alpha_HD25631.pdf" "src/tex/figures/r_alpha_HD191495.pdf" @@ -49,6 +69,8 @@ rule plot_save_mesa_ce: "src/scripts/plot_save_mesa_ce.py" rule plot_save_mesa_individual_fin1p25: + input: + "src/data/data.zip" output: "src/tex/figures/p_q_1p25days.pdf" "src/tex/figures/p_q_3days.pdf" @@ -60,12 +82,16 @@ rule plot_save_mesa_individual_fin1p25: "src/scripts/plot_save_mesa_individual_fin1p25.py" rule plot_save_mesa_eta: + input: + "src/data/data.zip" output: "src/tex/figures/eta_omega.pdf" script: "src/scripts/plot_save_mesa_eta.py" rule plot_min_a_in: + input: + "src/data/data.zip" output: "src/tex/figures/a_min_RL_24_1_7.pdf" "src/tex/figures/a_min_RL_15_1p5_3p5.pdf" @@ -74,18 +100,24 @@ rule plot_min_a_in: "src/scripts/plot_min_a_in.py" rule plot_P_unstable: + input: + "src/data/data.zip" output: "src/tex/figures/P_unstable.pdf" script: "src/scripts/plot_P_unstable.py" rule plot_save_mesa_individual_pos_res: + input: + "src/data/data.zip" output: "src/tex/figures/hr_panel_res.pdf" script: "src/scripts/plot_save_mesa_individual_pos_res.py" rule plot_save_mesa_pos_eta_res: + input: + "src/data/data.zip" output: "src/tex/figures/eta_omega_res.pdf" script: diff --git a/showyourwork.yml b/showyourwork.yml index 1db57d5..2d85ed7 100644 --- a/showyourwork.yml +++ b/showyourwork.yml @@ -26,43 +26,45 @@ dag: # Externally-hosted datasets, e.g. on Zenodo datasets: 10.5281/zenodo.10479754: - content: - - data.zip: src/data/ + destination: src/data/ + contents: + data.zip: # Custom file dependencies dependencies: + src/scripts/unzip_MESA_output.py: + - src/data/data.zip + src/scripts/plot_save_mesa_comparison_panels_fin.py: - src/scripts/matplotlibrc - src/scripts/mesaPlot/file_reader.py - - data/HD25631/ - - data/HD46485/ - - data/HD191495/ + - src/data/data.zip src/scripts/plot_save_mesa_comparison_wind_fin.py: - src/scripts/matplotlibrc - src/scripts/mesaPlot/file_reader.py - - data/one_star/ + - src/data/data.zip src/scripts/plot_save_mesa_comparison_panels_acc_fin.py: - src/scripts/matplotlibrc - src/scripts/mesaPlot/file_reader.py - - data/acceleration/ + - src/data/data.zip src/scripts/all_hr_fin.py: - src/scripts/matplotlibrc - src/scripts/mesaPlot/file_reader.py - - data/HR_HD25631/ + - src/data/data.zip src/scripts/hr_plot_paper2023_fin.py: - src/scripts/matplotlibrc - src/scripts/mesaPlot/file_reader.py - - data/sample_tracks/ - - data/FINAL_TABLE_TO_PLOTS_mar2023.txt + - src/scripts/unzip_MESA_output.py + - src/data/FINAL_TABLE_TO_PLOTS_mar2023.txt src/scripts/plot_e_fin.py: - src/scripts/matplotlibrc - src/scripts/mesaPlot/file_reader.py - - data/eccentricity/ + - src/data/data.zip src/scripts/plot_min_a_in.py: - src/scripts/matplotlibrc @@ -70,36 +72,30 @@ dependencies: - src/scripts/Eggleton83.py - src/scripts/get_sep_from_P_masses.py - src/scripts/mlp_model_trip_ghost.pkl - + - src/data/data.zip src/scripts/plot_P_unstable.py: - src/scripts/matplotlibrc - - data/triples/ - + - src/data/data.zip src/scripts/plot_save_mesa_ce.py: - src/scripts/matplotlibrc - src/scripts/mesaPlot/file_reader.py - - data/CE/ - + - src/data/data.zip src/scripts/plot_save_mesa_eta.py: - src/scripts/matplotlibrc - src/scripts/mesaPlot/file_reader.py - - data/mass_transfer_efficiency/ - + - src/data/data.zip src/scripts/plot_save_mesa_pos_eta_res.py: - src/scripts/matplotlibrc - src/scripts/mesaPlot/file_reader.py - - data/mass_transfer_efficiency/ - + - src/data/data.zip src/scripts/plot_save_mesa_individual_fin1p25.py: - src/scripts/matplotlibrc - src/scripts/mesaPlot/file_reader.py - - data/post_interaction/ - + - src/data/data.zip src/scripts/plot_save_mesa_individual_pos_res.py: - src/scripts/matplotlibrc - src/scripts/mesaPlot/file_reader.py - - data/post_interaction/ - + - src/data/data.zip # Name of the `.tex` manuscript and corresponding `.pdf` article ms_name: ms @@ -126,7 +122,7 @@ overleaf: require_inputs: false # Allow cacheable rules to run on GitHub Actions? -run_cache_rules_on_ci: false +run_cache_rules_on_ci: True # Mapping of script file extensions to instructions for executing them scripts: diff --git a/src/scripts/all_hr_fin.py b/src/scripts/all_hr_fin.py index 5eda38e..5028b81 100644 --- a/src/scripts/all_hr_fin.py +++ b/src/scripts/all_hr_fin.py @@ -7,6 +7,15 @@ import mesaPlot as mp plt.style.use(paths.scripts / "matplotlibrc") +if os.path.exists(os.path.join(paths.data,'HR_HD25631/LOGS1_0/history.data')): + pass +else: + os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}') + + + + + def find_nearest(array, value): array = np.asarray(array) idx = (np.abs(array - value)).argmin() diff --git a/src/scripts/hr_plot_paper2023_fin.py b/src/scripts/hr_plot_paper2023_fin.py index b95810a..9f0356c 100755 --- a/src/scripts/hr_plot_paper2023_fin.py +++ b/src/scripts/hr_plot_paper2023_fin.py @@ -9,6 +9,11 @@ import os import mesaPlot as mp +if os.path.exists(os.path.join(paths.data,'FINAL_TABLE_TO_PLOTS_mar2023.txt')): + pass +else: + os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}') + plt.style.use(paths.scripts / "matplotlibrc") diff --git a/src/scripts/plot_P_unstable.py b/src/scripts/plot_P_unstable.py index 060f3e8..5836667 100644 --- a/src/scripts/plot_P_unstable.py +++ b/src/scripts/plot_P_unstable.py @@ -5,6 +5,13 @@ import matplotlib.gridspec as gridspec import paths plt.style.use(paths.scripts / "matplotlibrc") +if os.path.exists(os.path.join(paths.data,'triples/')): + pass +else: + os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}') + + + def read_data(file_path, N_skip=None, convert = True): with open(file_path, 'r') as f: diff --git a/src/scripts/plot_e_fin.py b/src/scripts/plot_e_fin.py index d75e33f..245f768 100644 --- a/src/scripts/plot_e_fin.py +++ b/src/scripts/plot_e_fin.py @@ -6,6 +6,14 @@ import mesaPlot as mp plt.style.use(paths.scripts / "matplotlibrc") +if os.path.exists(os.path.join(paths.data,'eccentricity/HD191495/LOGS3/history.data')): + pass +else: + os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}') + + + + m_200_191=mp.MESA() m2_200_191=mp.MESA() m3_200_191=mp.MESA() diff --git a/src/scripts/plot_save_mesa_ce.py b/src/scripts/plot_save_mesa_ce.py index 2887dff..eaff8b4 100644 --- a/src/scripts/plot_save_mesa_ce.py +++ b/src/scripts/plot_save_mesa_ce.py @@ -6,6 +6,10 @@ import os import mesaPlot as mp plt.style.use(paths.scripts / "matplotlibrc") +if os.path.exists(os.path.join(paths.data,'CE/LOGS3_HD46485/history.data')): + pass +else: + os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}') def find_nearest(array, value): diff --git a/src/scripts/plot_save_mesa_comparison_panels_acc_fin.py b/src/scripts/plot_save_mesa_comparison_panels_acc_fin.py index 4837076..8c15eec 100644 --- a/src/scripts/plot_save_mesa_comparison_panels_acc_fin.py +++ b/src/scripts/plot_save_mesa_comparison_panels_acc_fin.py @@ -6,6 +6,11 @@ import os import mesaPlot as mp +if os.path.exists(os.path.join(paths.data,'acceleration/HD191495_mesa/LOGS1/history.data')): + pass +else: + os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}') + plt.style.use(paths.scripts / "matplotlibrc") diff --git a/src/scripts/plot_save_mesa_comparison_panels_fin.py b/src/scripts/plot_save_mesa_comparison_panels_fin.py index 54ac66d..c5a8e64 100644 --- a/src/scripts/plot_save_mesa_comparison_panels_fin.py +++ b/src/scripts/plot_save_mesa_comparison_panels_fin.py @@ -8,6 +8,11 @@ plt.style.use(paths.scripts / "matplotlibrc") +if os.path.exists(os.path.join(paths.data,'HD191495/LOGS1_mesa/history.data')): + pass +else: + os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}') + rsun=696000 #km diff --git a/src/scripts/plot_save_mesa_comparison_wind_fin.py b/src/scripts/plot_save_mesa_comparison_wind_fin.py index 84b8558..7aecec5 100644 --- a/src/scripts/plot_save_mesa_comparison_wind_fin.py +++ b/src/scripts/plot_save_mesa_comparison_wind_fin.py @@ -6,6 +6,13 @@ import os import mesaPlot as mp +if os.path.exists(os.path.join(paths.data,'one_star/M24_ST/LOGS50/history.data')): + pass +else: + os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}') + + + plt.style.use(paths.scripts / "matplotlibrc") diff --git a/src/scripts/plot_save_mesa_eta.py b/src/scripts/plot_save_mesa_eta.py index 08f3fb4..d2848ba 100644 --- a/src/scripts/plot_save_mesa_eta.py +++ b/src/scripts/plot_save_mesa_eta.py @@ -6,6 +6,13 @@ import os import mesaPlot as mp +if os.path.exists(os.path.join(paths.data,'mass_transfer_efficiency/p3/LOGS3/history.data')): + pass +else: + os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}') + + + plt.style.use(paths.scripts / "matplotlibrc") diff --git a/src/scripts/plot_save_mesa_individual_fin1p25.py b/src/scripts/plot_save_mesa_individual_fin1p25.py index ccaf6b8..a5b4ede 100644 --- a/src/scripts/plot_save_mesa_individual_fin1p25.py +++ b/src/scripts/plot_save_mesa_individual_fin1p25.py @@ -6,6 +6,12 @@ import os import mesaPlot as mp +if os.path.exists(os.path.join(paths.data,'post_interaction/30_20_1p25_g1_new/LOGS3/history.data')): + pass +else: + os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}') + + plt.style.use(paths.scripts / "matplotlibrc") diff --git a/src/scripts/plot_save_mesa_individual_pos_res.py b/src/scripts/plot_save_mesa_individual_pos_res.py index 05b3cb9..c190121 100644 --- a/src/scripts/plot_save_mesa_individual_pos_res.py +++ b/src/scripts/plot_save_mesa_individual_pos_res.py @@ -6,6 +6,11 @@ import os import mesaPlot as mp +if os.path.exists(os.path.join(paths.data,'post_interaction/30_20_10_res/LOGS1/history.data')): + pass +else: + os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}') + plt.style.use(paths.scripts / "matplotlibrc") diff --git a/src/scripts/plot_save_mesa_pos_eta_res.py b/src/scripts/plot_save_mesa_pos_eta_res.py index c49e2cc..981fcda 100644 --- a/src/scripts/plot_save_mesa_pos_eta_res.py +++ b/src/scripts/plot_save_mesa_pos_eta_res.py @@ -8,6 +8,11 @@ plt.style.use(paths.scripts / "matplotlibrc") +if os.path.exists(os.path.join(paths.data,'mass_transfer_efficiency/p3_pos/LOGS3/history.data')): + pass +else: + os.system(f'python {os.path.join(paths.scripts / "unzip_MESA_output.py")}') + def find_nearest(array, value): diff --git a/src/scripts/unzip_MESA_output.py b/src/scripts/unzip_MESA_output.py new file mode 100644 index 0000000..326de13 --- /dev/null +++ b/src/scripts/unzip_MESA_output.py @@ -0,0 +1,12 @@ + +from showyourwork.paths import user as Paths +paths = Paths() +from zipfile import ZipFile + +if __name__ == "__main__": + # loading the temp.zip and creating a zip object + with ZipFile(paths.data / "data.zip", 'r') as zObject: + + # Extracting all the members of the zip + # into a specific location. + zObject.extractall(path=paths.src) \ No newline at end of file