Skip to content

Commit b489871

Browse files
author
Tom Wagg
authored
Add methods paper plots/code (Figures 5-7) (#567)
1 parent 79d2df3 commit b489871

File tree

14 files changed

+2623
-0
lines changed

14 files changed

+2623
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# How to recreate/edit the HR diagram from the COMPAS methods paper
2+
3+
This folder contains everything you need to reproduce (or edit!) the HRD from the methods paper. You'll need to do the following:
4+
5+
1. Run `python create_fig_5_grid.py` to create a grid of stars for the plot (you can change this to a custom range of masses or metallicities if you like)
6+
2. Run `python pythonSubmit.py` to run COMPAS for this grid
7+
3. Open `make_fig_5.ipynb` in Jupyter Lab/notebook and run the whole thing to create the figure (and learn how to change it)
8+
9+
For reference, the changes from the *default* pythonSubmit.py are just:
10+
11+
- use detailed output
12+
- use smaller time steps (to get smoother lines for the plot)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
""" This file creates a grid of stars for the HRD plot """
2+
3+
# use solar and low metallicity
4+
metallicities = [0.0142, 0.001]
5+
6+
# circular binaries with a separation so wide that they are effectively single
7+
eccentricity = 0.0
8+
a = 1e20
9+
10+
with open("grid.txt", "w") as f:
11+
# mass range: basically logspace from 0.5 to 50 but with cleaner numbers
12+
masses = [0.5, 0.65, 0.80, 1.0, 1.3, 1.6, 2.0, 2.5, 3.2, 4.0, 5.2, 6.5, 8.2, 10.3, 13.0, 16.5, 21, 26, 33, 45, 65, 90, 115, 150]
13+
14+
grid_lines = ["--initial-mass-1 {} --initial-mass-2 {} --metallicity {} --eccentricity {} --semi-major-axis {} \n".format(masses[i], 0.1, metallicities[j], eccentricity, a) for j in range(len(metallicities)) for i in range(len(masses))]
15+
f.writelines(grid_lines)
135 KB
Binary file not shown.

examples/methods_paper_plots/fig_5_HR_diagram/make_fig_5.ipynb

Lines changed: 414 additions & 0 deletions
Large diffs are not rendered by default.

examples/methods_paper_plots/fig_5_HR_diagram/pythonSubmit.py

Lines changed: 743 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# How to recreate/edit the maximum radius plot from the COMPAS methods paper
2+
3+
This folder contains everything you need to reproduce (or edit!) the maximum radius plot from the methods paper. You'll need to do the following:
4+
5+
1. Run `python create_fig_6_grid.py` to create a grid of stars for the plot (you can change this to a custom range of masses or metallicities if you like)
6+
2. Run `python pythonSubmit.py` to run COMPAS for this grid (note this is probably going to take about 10 minutes!)
7+
3. Open `make_fig_6.ipynb` in Jupyter Lab/notebook and run the whole thing to create the figure (and learn how to change it)
8+
9+
For reference, the changes from the *default* pythonSubmit.py are just:
10+
11+
- use detailed output
12+
- use smaller time steps (to get smoother lines for the plot)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import numpy as np
2+
3+
""" This file creates a grid of stars for the HRD plot """
4+
5+
# use solar and low metallicity
6+
metallicities = [0.0142, 0.001]
7+
8+
# circular binaries with a separation so wide that they are effectively single
9+
eccentricity = 0.0
10+
a = 1e20
11+
12+
with open("grid.txt", "w") as f:
13+
masses = np.round(np.logspace(np.log10(0.5), np.log10(150.0), 500), 3)
14+
15+
grid_lines = ["--initial-mass-1 {} --initial-mass-2 {} --metallicity {} --eccentricity {} --semi-major-axis {} \n".format(masses[i], 0.1, metallicities[j], eccentricity, a) for j in range(len(metallicities)) for i in range(len(masses))]
16+
f.writelines(grid_lines)

examples/methods_paper_plots/fig_6_max_R/make_fig_6.ipynb

Lines changed: 443 additions & 0 deletions
Large diffs are not rendered by default.
80.7 KB
Binary file not shown.

examples/methods_paper_plots/fig_6_max_R/pythonSubmit.py

Lines changed: 743 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)