Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag models with falied explosions and black hole formation #333

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions python/snewpy/models/ccsn.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ def __init__(self, progenitor_mass:u.Quantity, revival_time:u.Quantity, metallic
filename = f"nakazato-{eos}-z{metallicity}-t_rev{int(revival_time)}ms-s{progenitor_mass:3.1f}.fits"
else:
filename = f"nakazato-{eos}-BH-z{metallicity}-s{progenitor_mass:3.1f}.fits"
#modify metadata if needed...
#self.metadata['name']=value
self.metadata['Black hole']=(revival_time==0)
return super().__init__(filename, self.metadata)


Expand Down Expand Up @@ -196,6 +195,7 @@ class Walk_2019(loaders.Walk_2019):
"""
def __init__(self, * ,progenitor_mass:u.Quantity, direction:int):
filename = f's{progenitor_mass.value:3.1f}c_3DBH_dir{direction}'
self.metadata['Black hole']=True
return super().__init__(filename=filename, metadata=self.metadata)


Expand Down Expand Up @@ -255,6 +255,8 @@ class OConnor_2015(loaders.OConnor_2015):
def __init__(self, progenitor_mass:u.Quantity):
# Filename is currently the same regardless of parameters
filename = 'M1_neutrinos.dat'
#this model forms BH
self.metadata['Black hole']=True
return super().__init__(filename, self.metadata)

@deprecated('eos')
Expand All @@ -274,6 +276,8 @@ def _metadata_from_filename(self, filename:str)->dict:

def __init__(self, *, progenitor_mass:u.Quantity):
filename = f's{progenitor_mass.value:g}.dat'
#tag if this simulation forms a black hole
self.metadata['Black hole'] = filename[:-4] not in ['s18','s25']
return super().__init__(filename, self.metadata)

@deprecated('eos')
Expand Down
5 changes: 5 additions & 0 deletions python/snewpy/models/ccsn_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ def __init__(self, filename, metadata={}):

# Set model metadata.
self.filename = os.path.basename(filename)
#A simulation is considered to explode if its diagnostic explosion energy
#exceeds 1e49 ergs. This is in line with the definition of explosion time
#in arXiv:1902.01340v2, p. 16.
metadata['Explodes'] = f['sim_data']['expl_energy'][-1][1] > 1e49
metadata['Black hole'] = metadata['Explodes'] and (simtab['TIME'][-1] < 4.99)

super().__init__(simtab, metadata)

Expand Down