Skip to content

Commit

Permalink
Add preSN to the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheshuk committed Dec 13, 2023
1 parent 7b9b949 commit cea2bd4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 24 deletions.
13 changes: 12 additions & 1 deletion doc/source/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@ Base Class for Supernova Models
Derived Models
--------------

Core-Collapse Supernova Models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: snewpy.models.ccsn
:members:
:exclude-members: SNOwGLoBES
:exclude-members: get_param_combinations, SNOwGLoBES, Analytic3Species

Presupernova Models
~~~~~~~~~~~~~~~~~~~
.. automodule:: snewpy.models.presn
:members:
:exclude-members: get_param_combinations

Other Models
------------
.. autoclass:: snewpy.models.ccsn.Analytic3Species
:members:

.. autoclass:: snewpy.models.ccsn.SNOwGLoBES
:members:
45 changes: 22 additions & 23 deletions python/snewpy/models/ccsn.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,6 @@ class method to get a list of all valid combinations and filter it:
from snewpy.models.registry_model import deprecated, legacy_filename_initialization
from textwrap import dedent

class Analytic3Species(PinchedModel):
"""An analytical model calculating spectra given total luminosity,
average energy, and rms or pinch, for each species.
"""

param = "There are no input files available for this class. Use `doc/scripts/Analytic.py` in the SNEWPY GitHub repo to create a custom input file."

def get_param_combinations(cls):
print(cls.param)
return []

def __init__(self, filename):
"""
Parameters
----------
filename : str
Absolute or relative path to file with model data.
"""

simtab = Table.read(filename,format='ascii')
self.filename = filename
super().__init__(simtab, metadata={})

@legacy_filename_initialization
@RegistryModel(
progenitor_mass = [13, 20, 30, 50] * u.Msun,
Expand Down Expand Up @@ -559,3 +536,25 @@ def get_fluence(self, t):

return fluence

class Analytic3Species(PinchedModel):
"""An analytical model calculating spectra given total luminosity,
average energy, and rms or pinch, for each species.
"""

param = "There are no input files available for this class. Use `doc/scripts/Analytic.py` in the SNEWPY GitHub repo to create a custom input file."

def get_param_combinations(cls):
print(cls.param)
return []

def __init__(self, filename):
"""
Parameters
----------
filename : str
Absolute or relative path to file with model data.
"""

simtab = Table.read(filename,format='ascii')
self.filename = filename
super().__init__(simtab, metadata={})
5 changes: 5 additions & 0 deletions python/snewpy/models/presn.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# -*- coding: utf-8 -*-
"""
The submodule ``snewpy.models.presn`` contains models of presupernova neutrino fluxes,
derived from the :class:`SupernovaModel` base class.
"""
import snewpy.models.presn_loaders as loaders
from snewpy.models.registry_model import RegistryModel
import numpy as np
Expand Down

0 comments on commit cea2bd4

Please sign in to comment.