Running a real POSYDON MESA HMS-HMS gird
It is now time to become a POSYDON MESA architect. In this notebook, we will run a real HMS-HMS grid. We will run a downsampled version (100 models) of the HMS-HMS, 0.1Zsun, q=0.7 grid slice, using the same HMS-HMS.ini
file as in the first notebook, where we run one binary.
Creating the Initialization File to Submit the MESA Grid
Let’s copy some code used in $PATH_TO_POSYDON/grid_params/POSYDON-MESA-INLISTS/r11701/running_scripts/parameter_space_v2/create_csv.ipynb
to create the grid_test.csv
file and edit it to run a downsampled version of the grid.
[1]:
import os
import csv
import numpy as np
def log_range(x_min,x_max,x_n):
return 10**np.linspace(np.log10(x_min),np.log10(x_max), x_n)
# digit rounding pick 10 to be sure we resolve 10^-4Zsun
NDIG = 10
Zsun = 0.0142
m1_min = 5.5
m1_max = 300
m1_n = 10
m1 = log_range(m1_min,m1_max,m1_n)
q_n = 1
q = [0.7]
p_min = 1.0e-1
p_max = 1.0e+4
p_n = 10
p = log_range(p_min,p_max,p_n)
Z_n = 1
met = [0.1*Zsun]
print('total resolution Z_n * m1_n * q_n * p_n=', Z_n * m1_n * q_n * p_n)
# save entire grid in a single file
with open('./grid_test.csv', 'w', newline='') as file:
writer = csv.writer(file)
writer.writerow(['initial_z','Zbase','m1','m2','initial_period_in_days'])
for Z in met:
for i in range(m1_n):
for j in range(q_n):
for k in range(p_n):
writer.writerow([round(Z,NDIG),round(Z,NDIG),round(m1[i],NDIG),round(m1[i]*q[j],NDIG),round(p[k],NDIG)])
total resolution Z_n * m1_n * q_n * p_n= 100
Run the MESA Grid with the POSYDON Submission Script
We are now ready to run the simulation, with the following commands in your terminal (Please remember to have the POSYDON and MESA variables being set before):
posydon-setup-grid --grid-type fixed --inifile HMS-HMS.ini --submission-type slurm
./run_grid.sh
Sit back relax, and wait for the grid to finish.
[2]:
!ls
binary
cleanup.slurm
column_lists
grid_test.csv
HMS-HMS.ini
job_array_grid_submit.slurm
mesa_cleanup.out
mesa_grid.38800304_0.out
mesa_grid.38800304_10.out
mesa_grid.38800304_11.out
mesa_grid.38800304_12.out
mesa_grid.38800304_13.out
mesa_grid.38800304_14.out
mesa_grid.38800304_15.out
mesa_grid.38800304_16.out
mesa_grid.38800304_17.out
mesa_grid.38800304_18.out
mesa_grid.38800304_19.out
mesa_grid.38800304_1.out
mesa_grid.38800304_20.out
mesa_grid.38800304_21.out
mesa_grid.38800304_22.out
mesa_grid.38800304_23.out
mesa_grid.38800304_24.out
mesa_grid.38800304_25.out
mesa_grid.38800304_26.out
mesa_grid.38800304_27.out
mesa_grid.38800304_28.out
mesa_grid.38800304_29.out
mesa_grid.38800304_2.out
mesa_grid.38800304_30.out
mesa_grid.38800304_31.out
mesa_grid.38800304_32.out
mesa_grid.38800304_33.out
mesa_grid.38800304_34.out
mesa_grid.38800304_35.out
mesa_grid.38800304_36.out
mesa_grid.38800304_37.out
mesa_grid.38800304_38.out
mesa_grid.38800304_39.out
mesa_grid.38800304_3.out
mesa_grid.38800304_40.out
mesa_grid.38800304_41.out
mesa_grid.38800304_42.out
mesa_grid.38800304_43.out
mesa_grid.38800304_44.out
mesa_grid.38800304_45.out
mesa_grid.38800304_46.out
mesa_grid.38800304_47.out
mesa_grid.38800304_48.out
mesa_grid.38800304_49.out
mesa_grid.38800304_4.out
mesa_grid.38800304_50.out
mesa_grid.38800304_51.out
mesa_grid.38800304_52.out
mesa_grid.38800304_53.out
mesa_grid.38800304_54.out
mesa_grid.38800304_55.out
mesa_grid.38800304_56.out
mesa_grid.38800304_57.out
mesa_grid.38800304_58.out
mesa_grid.38800304_59.out
mesa_grid.38800304_5.out
mesa_grid.38800304_60.out
mesa_grid.38800304_61.out
mesa_grid.38800304_62.out
mesa_grid.38800304_63.out
mesa_grid.38800304_64.out
mesa_grid.38800304_65.out
mesa_grid.38800304_66.out
mesa_grid.38800304_67.out
mesa_grid.38800304_68.out
mesa_grid.38800304_69.out
mesa_grid.38800304_6.out
mesa_grid.38800304_70.out
mesa_grid.38800304_71.out
mesa_grid.38800304_72.out
mesa_grid.38800304_73.out
mesa_grid.38800304_74.out
mesa_grid.38800304_75.out
mesa_grid.38800304_76.out
mesa_grid.38800304_77.out
mesa_grid.38800304_78.out
mesa_grid.38800304_79.out
mesa_grid.38800304_7.out
mesa_grid.38800304_80.out
mesa_grid.38800304_81.out
mesa_grid.38800304_82.out
mesa_grid.38800304_83.out
mesa_grid.38800304_84.out
mesa_grid.38800304_85.out
mesa_grid.38800304_86.out
mesa_grid.38800304_87.out
mesa_grid.38800304_88.out
mesa_grid.38800304_89.out
mesa_grid.38800304_8.out
mesa_grid.38800304_90.out
mesa_grid.38800304_91.out
mesa_grid.38800304_92.out
mesa_grid.38800304_93.out
mesa_grid.38800304_94.out
mesa_grid.38800304_95.out
mesa_grid.38800304_96.out
mesa_grid.38800304_97.out
mesa_grid.38800304_98.out
mesa_grid.38800304_99.out
mesa_grid.38800304_9.out
mk
run_grid.sh
running_a_grid.ipynb
star1
star2
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_1.0000e-01_grid_index_70
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_1.0000e+04_grid_index_79
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_1.2915e+00_grid_index_72
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_1.6681e+01_grid_index_74
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_2.1544e+02_grid_index_76
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_2.7826e+03_grid_index_78
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_3.5938e-01_grid_index_71
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_4.6416e+00_grid_index_73
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_5.9948e+01_grid_index_75
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_7.7426e+02_grid_index_77
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_1.0000e-01_grid_index_20
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_1.0000e+04_grid_index_29
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_1.2915e+00_grid_index_22
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_1.6681e+01_grid_index_24
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_2.1544e+02_grid_index_26
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_2.7826e+03_grid_index_28
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_3.5938e-01_grid_index_21
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_4.6416e+00_grid_index_23
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_5.9948e+01_grid_index_25
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_7.7426e+02_grid_index_27
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_1.0000e-01_grid_index_80
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_1.0000e+04_grid_index_89
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_1.2915e+00_grid_index_82
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_1.6681e+01_grid_index_84
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_2.1544e+02_grid_index_86
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_2.7826e+03_grid_index_88
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_3.5938e-01_grid_index_81
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_4.6416e+00_grid_index_83
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_5.9948e+01_grid_index_85
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_7.7426e+02_grid_index_87
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_1.0000e-01_grid_index_30
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_1.0000e+04_grid_index_39
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_1.2915e+00_grid_index_32
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_1.6681e+01_grid_index_34
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_2.1544e+02_grid_index_36
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_2.7826e+03_grid_index_38
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_3.5938e-01_grid_index_31
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_4.6416e+00_grid_index_33
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_5.9948e+01_grid_index_35
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_7.7426e+02_grid_index_37
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_1.0000e-01_grid_index_90
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_1.0000e+04_grid_index_99
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_1.2915e+00_grid_index_92
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_1.6681e+01_grid_index_94
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_2.1544e+02_grid_index_96
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_2.7826e+03_grid_index_98
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_3.5938e-01_grid_index_91
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_4.6416e+00_grid_index_93
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_5.9948e+01_grid_index_95
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_7.7426e+02_grid_index_97
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_1.0000e-01_grid_index_40
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_1.0000e+04_grid_index_49
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_1.2915e+00_grid_index_42
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_1.6681e+01_grid_index_44
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_2.1544e+02_grid_index_46
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_2.7826e+03_grid_index_48
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_3.5938e-01_grid_index_41
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_4.6416e+00_grid_index_43
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_5.9948e+01_grid_index_45
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_7.7426e+02_grid_index_47
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_1.0000e-01_grid_index_50
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_1.0000e+04_grid_index_59
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_1.2915e+00_grid_index_52
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_1.6681e+01_grid_index_54
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_2.1544e+02_grid_index_56
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_2.7826e+03_grid_index_58
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_3.5938e-01_grid_index_51
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_4.6416e+00_grid_index_53
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_5.9948e+01_grid_index_55
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_7.7426e+02_grid_index_57
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_1.0000e-01_grid_index_0
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_1.0000e+04_grid_index_9
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_1.2915e+00_grid_index_2
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_1.6681e+01_grid_index_4
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_2.1544e+02_grid_index_6
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_2.7826e+03_grid_index_8
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_3.5938e-01_grid_index_1
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_4.6416e+00_grid_index_3
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_5.9948e+01_grid_index_5
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_7.7426e+02_grid_index_7
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_1.0000e-01_grid_index_60
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_1.0000e+04_grid_index_69
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_1.2915e+00_grid_index_62
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_1.6681e+01_grid_index_64
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_2.1544e+02_grid_index_66
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_2.7826e+03_grid_index_68
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_3.5938e-01_grid_index_61
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_4.6416e+00_grid_index_63
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_5.9948e+01_grid_index_65
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_7.7426e+02_grid_index_67
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_1.0000e-01_grid_index_10
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_1.0000e+04_grid_index_19
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_1.2915e+00_grid_index_12
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_1.6681e+01_grid_index_14
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_2.1544e+02_grid_index_16
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_2.7826e+03_grid_index_18
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_3.5938e-01_grid_index_11
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_4.6416e+00_grid_index_13
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_5.9948e+01_grid_index_15
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_7.7426e+02_grid_index_17
Congratulations, you have run a MESA grid using POSYDON! You can now process the data using POSYDON’s built-in tools, or you can use your own tools to process the data.