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 ini file as in the previous notebook.
Creating the Initialization File to Submit the MESA Grid
Let’s copy the code use in $PATH_TO_POSYDON/grid_params/POSYDON-MESA-INLISTS/r11701/running_scripts/parameter_space_v2/create_csv.ipynb
to create the csv file and edit it to run a downsampled version of the grid.
[3]:
import os
import csv
import numpy as np
import pandas as pd
def log_range(x_min,x_max,x_n):
return 10**np.linspace(np.log10(x_min),np.log10(x_max), x_n)
def lin_range(x_min,x_max,x_n):
return np.linspace(x_min,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 = 10**(-1.)
p_max = 6105
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)
for Z in met:
# 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 i in range(m1_n):
for j in range(q_n):
for k in range(p_n):
if m1[i]*q[j] >= 0.5:
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:
posydon-setup-grid --grid-type fixed --inifile HMS-HMS_yggdrasil.ini --submission-type slurm
sbatch slurm_job_array_grid_submit.sh
Sit back relax, and wait for the grid to finish.
[1]:
!ls
binary
grid.csv
HMS-HMS_yggdrasil.ini
mesa_grid.28454093_0.out
mesa_grid.28454093_10.out
mesa_grid.28454093_11.out
mesa_grid.28454093_12.out
mesa_grid.28454093_13.out
mesa_grid.28454093_14.out
mesa_grid.28454093_15.out
mesa_grid.28454093_16.out
mesa_grid.28454093_17.out
mesa_grid.28454093_18.out
mesa_grid.28454093_19.out
mesa_grid.28454093_1.out
mesa_grid.28454093_20.out
mesa_grid.28454093_21.out
mesa_grid.28454093_22.out
mesa_grid.28454093_23.out
mesa_grid.28454093_24.out
mesa_grid.28454093_25.out
mesa_grid.28454093_26.out
mesa_grid.28454093_27.out
mesa_grid.28454093_28.out
mesa_grid.28454093_29.out
mesa_grid.28454093_2.out
mesa_grid.28454093_30.out
mesa_grid.28454093_31.out
mesa_grid.28454093_32.out
mesa_grid.28454093_33.out
mesa_grid.28454093_34.out
mesa_grid.28454093_35.out
mesa_grid.28454093_36.out
mesa_grid.28454093_37.out
mesa_grid.28454093_38.out
mesa_grid.28454093_39.out
mesa_grid.28454093_3.out
mesa_grid.28454093_40.out
mesa_grid.28454093_41.out
mesa_grid.28454093_42.out
mesa_grid.28454093_43.out
mesa_grid.28454093_44.out
mesa_grid.28454093_45.out
mesa_grid.28454093_46.out
mesa_grid.28454093_47.out
mesa_grid.28454093_48.out
mesa_grid.28454093_49.out
mesa_grid.28454093_4.out
mesa_grid.28454093_50.out
mesa_grid.28454093_51.out
mesa_grid.28454093_52.out
mesa_grid.28454093_53.out
mesa_grid.28454093_54.out
mesa_grid.28454093_55.out
mesa_grid.28454093_56.out
mesa_grid.28454093_57.out
mesa_grid.28454093_58.out
mesa_grid.28454093_59.out
mesa_grid.28454093_5.out
mesa_grid.28454093_60.out
mesa_grid.28454093_61.out
mesa_grid.28454093_62.out
mesa_grid.28454093_63.out
mesa_grid.28454093_64.out
mesa_grid.28454093_65.out
mesa_grid.28454093_66.out
mesa_grid.28454093_67.out
mesa_grid.28454093_68.out
mesa_grid.28454093_69.out
mesa_grid.28454093_6.out
mesa_grid.28454093_70.out
mesa_grid.28454093_71.out
mesa_grid.28454093_72.out
mesa_grid.28454093_73.out
mesa_grid.28454093_74.out
mesa_grid.28454093_75.out
mesa_grid.28454093_76.out
mesa_grid.28454093_77.out
mesa_grid.28454093_78.out
mesa_grid.28454093_79.out
mesa_grid.28454093_7.out
mesa_grid.28454093_80.out
mesa_grid.28454093_81.out
mesa_grid.28454093_82.out
mesa_grid.28454093_83.out
mesa_grid.28454093_84.out
mesa_grid.28454093_85.out
mesa_grid.28454093_86.out
mesa_grid.28454093_87.out
mesa_grid.28454093_88.out
mesa_grid.28454093_89.out
mesa_grid.28454093_8.out
mesa_grid.28454093_90.out
mesa_grid.28454093_91.out
mesa_grid.28454093_92.out
mesa_grid.28454093_93.out
mesa_grid.28454093_94.out
mesa_grid.28454093_95.out
mesa_grid.28454093_96.out
mesa_grid.28454093_97.out
mesa_grid.28454093_98.out
mesa_grid.28454093_99.out
mesa_grid.28454093_9.out
mk
running_a_grid.ipynb
slurm_job_array_grid_submit.sh
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.1574e+00_grid_index_72
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_1.3396e+01_grid_index_74
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_1.5504e+02_grid_index_76
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_1.7945e+03_grid_index_78
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_3.4021e-01_grid_index_71
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_3.9376e+00_grid_index_73
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_4.5574e+01_grid_index_75
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_5.2747e+02_grid_index_77
Zbase_0.0014_m1_123.3602_m2_86.3521_initial_z_1.4200e-03_initial_period_in_days_6.1050e+03_grid_index_79
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.1574e+00_grid_index_22
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_1.3396e+01_grid_index_24
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_1.5504e+02_grid_index_26
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_1.7945e+03_grid_index_28
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_3.4021e-01_grid_index_21
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_3.9376e+00_grid_index_23
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_4.5574e+01_grid_index_25
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_5.2747e+02_grid_index_27
Zbase_0.0014_m1_13.3755_m2_9.3628_initial_z_1.4200e-03_initial_period_in_days_6.1050e+03_grid_index_29
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.1574e+00_grid_index_82
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_1.3396e+01_grid_index_84
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_1.5504e+02_grid_index_86
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_1.7945e+03_grid_index_88
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_3.4021e-01_grid_index_81
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_3.9376e+00_grid_index_83
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_4.5574e+01_grid_index_85
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_5.2747e+02_grid_index_87
Zbase_0.0014_m1_192.3748_m2_134.6623_initial_z_1.4200e-03_initial_period_in_days_6.1050e+03_grid_index_89
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.1574e+00_grid_index_32
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_1.3396e+01_grid_index_34
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_1.5504e+02_grid_index_36
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_1.7945e+03_grid_index_38
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_3.4021e-01_grid_index_31
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_3.9376e+00_grid_index_33
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_4.5574e+01_grid_index_35
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_5.2747e+02_grid_index_37
Zbase_0.0014_m1_20.8585_m2_14.6009_initial_z_1.4200e-03_initial_period_in_days_6.1050e+03_grid_index_39
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.1574e+00_grid_index_92
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_1.3396e+01_grid_index_94
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_1.5504e+02_grid_index_96
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_1.7945e+03_grid_index_98
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_3.4021e-01_grid_index_91
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_3.9376e+00_grid_index_93
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_4.5574e+01_grid_index_95
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_5.2747e+02_grid_index_97
Zbase_0.0014_m1_300.0000_m2_210.0000_initial_z_1.4200e-03_initial_period_in_days_6.1050e+03_grid_index_99
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.1574e+00_grid_index_42
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_1.3396e+01_grid_index_44
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_1.5504e+02_grid_index_46
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_1.7945e+03_grid_index_48
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_3.4021e-01_grid_index_41
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_3.9376e+00_grid_index_43
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_4.5574e+01_grid_index_45
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_5.2747e+02_grid_index_47
Zbase_0.0014_m1_32.5279_m2_22.7695_initial_z_1.4200e-03_initial_period_in_days_6.1050e+03_grid_index_49
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.1574e+00_grid_index_52
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_1.3396e+01_grid_index_54
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_1.5504e+02_grid_index_56
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_1.7945e+03_grid_index_58
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_3.4021e-01_grid_index_51
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_3.9376e+00_grid_index_53
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_4.5574e+01_grid_index_55
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_5.2747e+02_grid_index_57
Zbase_0.0014_m1_50.7258_m2_35.5080_initial_z_1.4200e-03_initial_period_in_days_6.1050e+03_grid_index_59
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.1574e+00_grid_index_2
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_1.3396e+01_grid_index_4
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_1.5504e+02_grid_index_6
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_1.7945e+03_grid_index_8
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_3.4021e-01_grid_index_1
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_3.9376e+00_grid_index_3
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_4.5574e+01_grid_index_5
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_5.2747e+02_grid_index_7
Zbase_0.0014_m1_5.5000_m2_3.8500_initial_z_1.4200e-03_initial_period_in_days_6.1050e+03_grid_index_9
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.1574e+00_grid_index_62
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_1.3396e+01_grid_index_64
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_1.5504e+02_grid_index_66
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_1.7945e+03_grid_index_68
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_3.4021e-01_grid_index_61
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_3.9376e+00_grid_index_63
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_4.5574e+01_grid_index_65
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_5.2747e+02_grid_index_67
Zbase_0.0014_m1_79.1046_m2_55.3732_initial_z_1.4200e-03_initial_period_in_days_6.1050e+03_grid_index_69
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.1574e+00_grid_index_12
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_1.3396e+01_grid_index_14
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_1.5504e+02_grid_index_16
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_1.7945e+03_grid_index_18
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_3.4021e-01_grid_index_11
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_3.9376e+00_grid_index_13
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_4.5574e+01_grid_index_15
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_5.2747e+02_grid_index_17
Zbase_0.0014_m1_8.5770_m2_6.0039_initial_z_1.4200e-03_initial_period_in_days_6.1050e+03_grid_index_19
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.