Create CCSNe database¶
This notebook creates a database file containing 18 different CCSNe models from 6 different datasets.
Running this notebook requires the user has the raw data from the different models on their computer. The raw data is not available as part of SIMPLE. It may be avaliable upon request from the original authors, listen in the accompanying paper.
The database file this notebook generates contains the abundance for each mass coordinate in the CCSNe that is ejected. See the CCSNe tutorial on how to use this database file.
List of models
- Ri18
- Pi16
- La22
- Si18
- Ra02
- LC18
In [1]:
Copied!
import simple
from simple import models, ccsne
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('Creating DB')
modelcollection = simple.new_collection()
datadir = 'data/'
savefilename = 'SIMPLE_CCSNe_v2.hdf5'
#########################
### Import ref item ###
#########################
name = 'W17'
logger.info(f'Generating Ref: {name}')
values, keys = models.load_csv_h(f'{datadir}ref/isotope_mass_W17.csv')
model = modelcollection.new_model('IsoRef', name,
type='ref_isomass', citation='',
data_values=values, data_keys=keys, data_unit='Da')
name = 'iniab2.0E-02GN93'
logger.info(f'Generating Ref: {name}')
values, keys = models.load_ppn(f'{datadir}ref/{name}.ppn')
model = modelcollection.new_model('IsoRef', name,
type='ref_isoabu', citation='',
data_values=values, data_keys=keys,
data_unit='mass')
name = 'iniab2.0E-02GN93_Lo03'
logger.info(f'Generating Ref: {name}')
values, keys = models.load_ppn(f'{datadir}ref/{name}.ppn')
model = modelcollection.new_model('IsoRef', name,
type='ref_isoabu', citation='',
data_values=values, data_keys=keys,
data_unit='mass')
name = 'iniab1.3E-02Lo03_Lo03_merged'
logger.info(f'Generating Ref: {name}')
values, keys = models.load_ppn(f'{datadir}ref/{name}.ppn')
model = modelcollection.new_model('IsoRef', name,
type='ref_isoabu', citation='',
data_values=values, data_keys=keys,
data_unit='mass')
name = 'rau_solar_ref'
logger.info(f'Generating Ref: {name}')
values, keys = models.load_ppn(f'{datadir}ref/{name}.ppn')
model = modelcollection.new_model('IsoRef', name,
type='ref_isoabu', citation='',
data_values=values, data_keys=keys,
data_unit='mass')
name = 'iniab1.3E-02As09_As09_merged'
logger.info(f'Generating Ref: {name}')
values, keys = models.load_ppn(f'{datadir}ref/{name}.ppn')
model = modelcollection.new_model('IsoRef', name,
type='ref_isoabu', citation='',
data_values=values, data_keys=keys,
data_unit='mass')
###########################
### Import CCSNe models ###
###########################
logger.info(f'Generating CCSNe dataset: Ri18')
models = ccsne.load_Ri18(datadir+'R18/', 'iniab2.0E-02GN93', 'W17')
for name, attrs in models.items(): model = modelcollection.new_model('CCSNe', name, **attrs)
logger.info(f'Generating CCSNe dataset: Pi16')
models = ccsne.load_Pi16(datadir+'P16/', 'iniab2.0E-02GN93_Lo03', 'W17')
for name, attrs in models.items(): model = modelcollection.new_model('CCSNe', name, **attrs)
logger.info(f'Generating CCSNe dataset: La22')
models = ccsne.load_La22(datadir+'LAW22/', 'iniab2.0E-02GN93_Lo03', 'W17')
for name, attrs in models.items(): model = modelcollection.new_model('CCSNe', name, **attrs)
logger.info(f'Generating CCSNe dataset: Si18')
models = ccsne.load_Si18(datadir+'SIE18/', 'iniab1.3E-02Lo03_Lo03_merged', 'W17')
for name, attrs in models.items(): model = modelcollection.new_model('CCSNe', name, **attrs)
logger.info(f'Generating CCSNe dataset: Ra02')
models = ccsne.load_Ra02(datadir+'R02/', 'rau_solar_ref', 'W17')
for name, attrs in models.items(): model = modelcollection.new_model('CCSNe', name, **attrs)
logger.info(f'Generating CCSNe dataset: LC18')
models = ccsne.load_LC18(datadir+'LC18/', 'iniab1.3E-02As09_As09_merged', 'W17')
for name, attrs in models.items(): model = modelcollection.new_model('CCSNe', name, **attrs)
#################
### Save file ###
#################
modelcollection.save(f'{datadir}{savefilename}')
import simple
from simple import models, ccsne
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('Creating DB')
modelcollection = simple.new_collection()
datadir = 'data/'
savefilename = 'SIMPLE_CCSNe_v2.hdf5'
#########################
### Import ref item ###
#########################
name = 'W17'
logger.info(f'Generating Ref: {name}')
values, keys = models.load_csv_h(f'{datadir}ref/isotope_mass_W17.csv')
model = modelcollection.new_model('IsoRef', name,
type='ref_isomass', citation='',
data_values=values, data_keys=keys, data_unit='Da')
name = 'iniab2.0E-02GN93'
logger.info(f'Generating Ref: {name}')
values, keys = models.load_ppn(f'{datadir}ref/{name}.ppn')
model = modelcollection.new_model('IsoRef', name,
type='ref_isoabu', citation='',
data_values=values, data_keys=keys,
data_unit='mass')
name = 'iniab2.0E-02GN93_Lo03'
logger.info(f'Generating Ref: {name}')
values, keys = models.load_ppn(f'{datadir}ref/{name}.ppn')
model = modelcollection.new_model('IsoRef', name,
type='ref_isoabu', citation='',
data_values=values, data_keys=keys,
data_unit='mass')
name = 'iniab1.3E-02Lo03_Lo03_merged'
logger.info(f'Generating Ref: {name}')
values, keys = models.load_ppn(f'{datadir}ref/{name}.ppn')
model = modelcollection.new_model('IsoRef', name,
type='ref_isoabu', citation='',
data_values=values, data_keys=keys,
data_unit='mass')
name = 'rau_solar_ref'
logger.info(f'Generating Ref: {name}')
values, keys = models.load_ppn(f'{datadir}ref/{name}.ppn')
model = modelcollection.new_model('IsoRef', name,
type='ref_isoabu', citation='',
data_values=values, data_keys=keys,
data_unit='mass')
name = 'iniab1.3E-02As09_As09_merged'
logger.info(f'Generating Ref: {name}')
values, keys = models.load_ppn(f'{datadir}ref/{name}.ppn')
model = modelcollection.new_model('IsoRef', name,
type='ref_isoabu', citation='',
data_values=values, data_keys=keys,
data_unit='mass')
###########################
### Import CCSNe models ###
###########################
logger.info(f'Generating CCSNe dataset: Ri18')
models = ccsne.load_Ri18(datadir+'R18/', 'iniab2.0E-02GN93', 'W17')
for name, attrs in models.items(): model = modelcollection.new_model('CCSNe', name, **attrs)
logger.info(f'Generating CCSNe dataset: Pi16')
models = ccsne.load_Pi16(datadir+'P16/', 'iniab2.0E-02GN93_Lo03', 'W17')
for name, attrs in models.items(): model = modelcollection.new_model('CCSNe', name, **attrs)
logger.info(f'Generating CCSNe dataset: La22')
models = ccsne.load_La22(datadir+'LAW22/', 'iniab2.0E-02GN93_Lo03', 'W17')
for name, attrs in models.items(): model = modelcollection.new_model('CCSNe', name, **attrs)
logger.info(f'Generating CCSNe dataset: Si18')
models = ccsne.load_Si18(datadir+'SIE18/', 'iniab1.3E-02Lo03_Lo03_merged', 'W17')
for name, attrs in models.items(): model = modelcollection.new_model('CCSNe', name, **attrs)
logger.info(f'Generating CCSNe dataset: Ra02')
models = ccsne.load_Ra02(datadir+'R02/', 'rau_solar_ref', 'W17')
for name, attrs in models.items(): model = modelcollection.new_model('CCSNe', name, **attrs)
logger.info(f'Generating CCSNe dataset: LC18')
models = ccsne.load_LC18(datadir+'LC18/', 'iniab1.3E-02As09_As09_merged', 'W17')
for name, attrs in models.items(): model = modelcollection.new_model('CCSNe', name, **attrs)
#################
### Save file ###
#################
modelcollection.save(f'{datadir}{savefilename}')
INFO:Creating DB:Generating Ref: W17 INFO:Creating DB:Generating Ref: iniab2.0E-02GN93 INFO:Creating DB:Generating Ref: iniab2.0E-02GN93_Lo03 INFO:Creating DB:Generating Ref: iniab1.3E-02Lo03_Lo03_merged INFO:Creating DB:Generating Ref: rau_solar_ref INFO:Creating DB:Generating Ref: iniab1.3E-02As09_As09_merged INFO:Creating DB:Generating CCSNe dataset: Ri18
Searching files, please wait....... Writing preprocessor files M15.0Z2.0e-02.Ma.0020601.out.h5 File search complete. reading ['iso_massf']...100%0%
INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 1.6105417670092237 INFO:root:massmax: 12.15340998801299 INFO:root:Lower boundary of the H shell: 4.79860944687067 INFO:root:Lower boundary of the He/N shell: 4.446022895845686 INFO:root:Lower boundary of the He/C shell: 3.103586549163745 INFO:root:Lower boundary of the O/C shell: 2.9877129568426066 INFO:root:Lower boundary of the O/Ne shell: 2.9877129568426066 INFO:root:Lower boundary of the O/Si layer: 1.7118590207943605 INFO:root:Lower boundary of the Si layer: 1.6569642910550864 INFO:root:Lower boundary of the Ni layer: 1.6105417670092237
Closing plot_tools Searching files, please wait....... Writing preprocessor files M20.0Z2.0e-02.Ma.0021101.out.h5 File search complete. reading ['iso_massf']...100%0%
INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 2.736601987234811 INFO:root:massmax: 15.398788792544517 INFO:root:Lower boundary of the H shell: 6.816301209015895 INFO:root:Lower boundary of the He/N shell: 6.487800472880541 INFO:root:Lower boundary of the He/C shell: 4.86036431327737 INFO:root:Lower boundary of the O/C shell: 4.519328566447582 INFO:root:Lower boundary of the O/Ne shell: 3.5393725860696166 INFO:root:Lower boundary of the O/Si layer: 2.736601987234811 INFO:root:No lower boundary of Si layer INFO:root:No lower boundary of Ni layer
Closing plot_tools Searching files, please wait....... Writing preprocessor files M25.0Z2.0e-02.Ma.0023601.out.h5 File search complete. reading ['iso_massf']...100%0%
INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 5.719465825793726 INFO:root:massmax: 12.814694011898498 INFO:root:Lower boundary of the H shell: 9.18523709535419 INFO:root:Lower boundary of the He/N shell: 9.021210966602963 INFO:root:Lower boundary of the He/C shell: 6.94706946227068 INFO:root:Lower boundary of the O/C shell: 6.536323239274477 INFO:root:Lower boundary of the O/Ne shell: 5.719465825793726 INFO:root:Lower boundary of the O/Si layer: 5.719465825793726 INFO:root:No lower boundary of Si layer INFO:root:No lower boundary of Ni layer
Closing plot_tools
INFO:Creating DB:Generating CCSNe dataset: Pi16
Searching files, please wait....... Writing preprocessor files M15.0Z2.0e-02.standard.0129501.restart.h5 M15.0Z2.0e-02.standard.0129401.restart.h5 M15.0Z2.0e-02.standard.0129301.restart.h5 File search complete. reading ['mass']...100%...100%
INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 1.6262829617555918 INFO:root:massmax: 11.768195200000001 INFO:root:Lower boundary of the H shell: 4.859831903646646 INFO:root:Lower boundary of the He/N shell: 4.49559132355047 INFO:root:Lower boundary of the He/C shell: 2.973975888682408
reading ['iso_massf']...100%
INFO:root:Lower boundary of the O/C shell: 2.8207610020903773 INFO:root:Lower boundary of the O/Ne shell: 2.8207610020903773 INFO:root:Lower boundary of the O/Si layer: 2.6781197626834494 INFO:root:Lower boundary of the Si layer: 2.542198804939479 INFO:root:Lower boundary of the Ni layer: 1.6262829617555918
Closing plot_tools Searching files, please wait....... Writing preprocessor files M20.0Z2.0e-02.standard.0132701.restart.h5 M20.0Z2.0e-02.standard.0132601.restart.h5 M20.0Z2.0e-02.standard.0132501.restart.h5 File search complete. reading ['iso_massf']...100%0%
INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 2.812338960853173 INFO:root:massmax: 13.554847899999999 INFO:root:Lower boundary of the H shell: 6.90840331177896 INFO:root:Lower boundary of the He/N shell: 6.669436492076 INFO:root:Lower boundary of the He/C shell: 4.920725568842935 INFO:root:Lower boundary of the O/C shell: 4.137220244614744 INFO:root:Lower boundary of the O/Ne shell: 4.137220244614744 INFO:root:Lower boundary of the O/Si layer: 3.2226840998494164 INFO:root:Lower boundary of the Si layer: 2.812338960853173 INFO:root:No lower boundary of Ni layer
Closing plot_tools Searching files, please wait....... Writing preprocessor files M25.0Z2.0e-02.standard.0097101.restart.h5 M25.0Z2.0e-02.standard.0097001.restart.h5 M25.0Z2.0e-02.standard.0096801.restart.h5 M25.0Z2.0e-02.standard.0096901.restart.h5 File search complete. reading ['iso_massf']...100%0%
INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 5.766551868441433 INFO:root:massmax: 13.3260346 INFO:root:Lower boundary of the H shell: 13.3260346 INFO:root:Lower boundary of the He/N shell: 9.232844549760442 INFO:root:Lower boundary of the He/C shell: 6.819586964803379 INFO:root:Lower boundary of the O/C shell: 6.033442253477677 INFO:root:Lower boundary of the O/Ne shell: 5.766551868441433 INFO:root:Lower boundary of the O/Si layer: 5.766551868441433 INFO:root:No lower boundary of Si layer INFO:root:No lower boundary of Ni layer
Closing plot_tools
INFO:Creating DB:Generating CCSNe dataset: La22 INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 1.7392 INFO:root:massmax: 3.9667 INFO:root:Lower boundary of the H shell: 3.9667 INFO:root:Lower boundary of the He/N shell: 3.2141 INFO:root:Lower boundary of the He/C shell: 2.8904 INFO:root:Lower boundary of the O/C shell: 2.5689 INFO:root:Lower boundary of the O/Ne shell: 2.085 INFO:root:Lower boundary of the O/Si layer: 1.9099 INFO:root:Lower boundary of the Si layer: 1.8307 INFO:root:Lower boundary of the Ni layer: 1.7407 INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 2.2688 INFO:root:massmax: 6.0379 INFO:root:Lower boundary of the H shell: 6.0379 INFO:root:Lower boundary of the He/N shell: 5.6829 INFO:root:Lower boundary of the He/C shell: 4.8039 INFO:root:Lower boundary of the O/C shell: 4.0516 INFO:root:Lower boundary of the O/Ne shell: 2.271 INFO:root:Lower boundary of the O/Si layer: 2.271 INFO:root:No lower boundary of Si layer INFO:root:Lower boundary of the Ni layer: 2.2688 INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 1.8297 INFO:root:massmax: 8.2397 INFO:root:Lower boundary of the H shell: 8.2397 INFO:root:Lower boundary of the He/N shell: 8.1974 INFO:root:Lower boundary of the He/C shell: 7.11 INFO:root:Lower boundary of the O/C shell: 5.8858 INFO:root:Lower boundary of the O/Ne shell: 3.2666 INFO:root:Lower boundary of the O/Si layer: 2.4413 INFO:root:Lower boundary of the Si layer: 2.1616 INFO:root:Lower boundary of the Ni layer: 1.8326 INFO:Creating DB:Generating CCSNe dataset: Si18 INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 1.5421550525735461 INFO:root:massmax: 4.088411060827673 INFO:root:Lower boundary of the H shell: 4.088411060827673 INFO:root:Lower boundary of the He/N shell: 2.9137778989075525 INFO:root:Lower boundary of the He/C shell: 2.394240723981901 INFO:root:Lower boundary of the O/C shell: 2.202221417777072 INFO:root:Lower boundary of the O/Ne shell: 1.9081918551005561 INFO:root:Lower boundary of the O/Si layer: 1.7461755654544904 INFO:root:Lower boundary of the Si layer: 1.6621671189726348 INFO:root:Lower boundary of the Ni layer: 1.5421550525735461 INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 1.584237857984021 INFO:root:massmax: 6.055750987213394 INFO:root:Lower boundary of the H shell: 6.055750987213394 INFO:root:Lower boundary of the He/N shell: 5.340536953241336 INFO:root:Lower boundary of the He/C shell: 3.960398190037159 INFO:root:Lower boundary of the O/C shell: 3.540355957767534 INFO:root:Lower boundary of the O/Ne shell: 2.276228858978483 INFO:root:Lower boundary of the O/Si layer: 1.9321942689177338 INFO:root:Lower boundary of the Si layer: 1.7241733539714117 INFO:root:Lower boundary of the Ni layer: 1.584237857984021 INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 2.105309890899377 INFO:root:massmax: 8.09061506935712 INFO:root:Lower boundary of the H shell: 8.09061506935712 INFO:root:Lower boundary of the He/N shell: 7.835787833082752 INFO:root:Lower boundary of the He/C shell: 5.735576671726756 INFO:root:Lower boundary of the O/C shell: 5.210523881370097 INFO:root:Lower boundary of the O/Ne shell: 3.150316742080381 INFO:root:Lower boundary of the O/Si layer: 2.6202634489638714 INFO:root:Lower boundary of the Si layer: 2.370238310700945 INFO:root:Lower boundary of the Ni layer: 2.105309890899377 INFO:Creating DB:Generating CCSNe dataset: Ra02 INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 1.682971342383107 INFO:root:massmax: 12.612971342383105 INFO:root:Lower boundary of the H shell: 4.231176470588235 INFO:root:Lower boundary of the He/N shell: 3.798069381598793 INFO:root:Lower boundary of the He/C shell: 3.004690799396682 INFO:root:Lower boundary of the O/C shell: 2.6227501256913017 INFO:root:Lower boundary of the O/Ne shell: 2.1803167420814478 INFO:root:Lower boundary of the O/Si layer: 1.9242986425339366 INFO:root:Lower boundary of the Si layer: 1.8237456008044242 INFO:root:Lower boundary of the Ni layer: 1.682971342383107 INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 1.5485168426344897 INFO:root:massmax: 14.741075917546505 INFO:root:Lower boundary of the H shell: 6.265158371040724 INFO:root:Lower boundary of the He/N shell: 5.744595274007038 INFO:root:Lower boundary of the He/C shell: 4.889140271493212 INFO:root:Lower boundary of the O/C shell: 4.285796882855706 INFO:root:Lower boundary of the O/Ne shell: 4.285796882855706 INFO:root:Lower boundary of the O/Si layer: 1.7624786324786326 INFO:root:Lower boundary of the Si layer: 1.6753443941679234 INFO:root:Lower boundary of the Ni layer: 1.5485168426344897 INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 2.0412267471091 INFO:root:massmax: 13.07983911513323 INFO:root:Lower boundary of the H shell: 8.480844645550528 INFO:root:Lower boundary of the He/N shell: 8.086425339366516 INFO:root:Lower boundary of the He/C shell: 7.109602815485168 INFO:root:Lower boundary of the O/C shell: 5.693413775766717 INFO:root:Lower boundary of the O/Ne shell: 3.2709602815485166 INFO:root:Lower boundary of the O/Si layer: 2.5138260432378075 INFO:root:Lower boundary of the Si layer: 2.1618903971845147 INFO:root:Lower boundary of the Ni layer: 2.0412267471091 INFO:Creating DB:Generating CCSNe dataset: LC18 INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 1.67179 INFO:root:massmax: 13.25854 INFO:root:Lower boundary of the H shell: 5.305757 INFO:root:Lower boundary of the He/N shell: 3.923495 INFO:root:Lower boundary of the He/C shell: 2.766972 INFO:root:Lower boundary of the O/C shell: 2.452396 INFO:root:Lower boundary of the O/Ne shell: 2.135279 INFO:root:Lower boundary of the O/Si layer: 1.849765 INFO:root:Lower boundary of the Si layer: 1.802086 INFO:root:Lower boundary of the Ni layer: 1.67179 INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 1.661228 INFO:root:massmax: 7.540816 INFO:root:Lower boundary of the H shell: 7.540447 INFO:root:Lower boundary of the He/N shell: 6.448152 INFO:root:Lower boundary of the He/C shell: 3.850515 INFO:root:Lower boundary of the O/C shell: 3.3335 INFO:root:Lower boundary of the O/Ne shell: 2.23887 INFO:root:Lower boundary of the O/Si layer: 1.828452 INFO:root:Lower boundary of the Si layer: 1.789849 INFO:root:Lower boundary of the Ni layer: 1.661228 INFO:root:Calculating Default Onion Structure INFO:root:m_cut: 1.95775 INFO:root:massmax: 8.542744 INFO:root:Lower boundary of the H shell: 8.542392 INFO:root:Lower boundary of the He/N shell: 8.071966 INFO:root:Lower boundary of the He/C shell: 6.109387 INFO:root:Lower boundary of the O/C shell: 5.462596 INFO:root:Lower boundary of the O/Ne shell: 2.572118 INFO:root:Lower boundary of the O/Si layer: 2.099789 INFO:root:Lower boundary of the Si layer: 2.056997 INFO:root:Lower boundary of the Ni layer: 1.95775 Filesize: 95.29 MB INFO:SIMPLE.models:Filesize: 95.29 MB Time to save file: 0:00:09.419293 INFO:SIMPLE.models:Time to save file: 0:00:09.419293
In [2]:
Copied!
modelcollection
modelcollection
Out[2]:
Models in collection:
- [0]
Ri18_m15
(CCSNe) - [1]
Ri18_m20
(CCSNe) - [2]
Ri18_m25
(CCSNe) - [3]
Pi16_m15
(CCSNe) - [4]
Pi16_m20
(CCSNe) - [5]
Pi16_m25
(CCSNe) - [6]
La22_m15
(CCSNe) - [7]
La22_m20
(CCSNe) - [8]
La22_m25
(CCSNe) - [9]
Si18_m15
(CCSNe) - [10]
Si18_m20
(CCSNe) - [11]
Si18_m25
(CCSNe) - [12]
Ra02_m15
(CCSNe) - [13]
Ra02_m20
(CCSNe) - [14]
Ra02_m25
(CCSNe) - [15]
LC18_m15
(CCSNe) - [16]
LC18_m20
(CCSNe) - [17]
LC18_m25
(CCSNe)
References in collection:
W17
(IsoRef)iniab2.0E-02GN93
(IsoRef)iniab2.0E-02GN93_Lo03
(IsoRef)iniab1.3E-02Lo03_Lo03_merged
(IsoRef)rau_solar_ref
(IsoRef)iniab1.3E-02As09_As09_merged
(IsoRef)