Supernova Models: snewpy.models

Base Class for Supernova Models

class snewpy.models.base.SupernovaModel(time, metadata)[source]

Base class defining an interface to a supernova model.

Initialize supernova model base class (call this method in the subclass constructor as super().__init__(time,metadata)).

Parameters:
  • time (ndarray of astropy.Quantity) – Time points where the model flux is defined. Must be array of Quantity, with units convertable to “second”.

  • metadata (dict) – Dict of model parameters <name>:<value>, to be used for printing table in __repr__() and _repr_markdown_()

get_flux(t, E, distance, flavor_xform=<snewpy.flavor_transformation.NoTransformation object>)[source]

Get neutrino flux through 1cm^2 surface at the given distance

Parameters:
  • t (astropy.Quantity) – Time to evaluate the neutrino spectra.

  • E (astropy.Quantity or ndarray of astropy.Quantity) – Energies to evaluate the the neutrino spectra.

  • distance (astropy.Quantity or float (in kpc)) – Distance from supernova.

  • flavor_xform (FlavorTransformation) – An instance from the flavor_transformation module.

Returns:

dict – Dictionary of neutrino fluxes in [neutrinos/(cm^2*erg*s)], keyed by neutrino flavor.

abstract get_initial_spectra(t, E, flavors=<enum 'Flavor'>)[source]

Get neutrino spectra at the source.

Parameters:
  • t (astropy.Quantity) – Time to evaluate initial spectra.

  • E (astropy.Quantity or ndarray of astropy.Quantity) – Energies to evaluate the initial spectra.

  • flavors (iterable of snewpy.neutrino.Flavor) – Return spectra for these flavors only (default: all)

Returns:

initialspectra (dict) – Dictionary of neutrino spectra, keyed by neutrino flavor.

get_time()[source]
Returns:

ndarray of astropy.Quantity – Snapshot times from the simulation

get_transformed_spectra(t, E, flavor_xform)[source]

Get neutrino spectra after applying oscillation.

Parameters:
  • t (astropy.Quantity) – Time to evaluate initial and oscillated spectra.

  • E (astropy.Quantity or ndarray of astropy.Quantity) – Energies to evaluate the initial and oscillated spectra.

  • flavor_xform (FlavorTransformation) – An instance from the flavor_transformation module.

Returns:

dict – Dictionary of transformed spectra, keyed by neutrino flavor.

Derived Models

The submodule snewpy.models.ccsn contains models of core-collapse supernovae derived from the SupernovaModel base class.

Since SNEWPY v1.3, the prefered method is to initialise a model based on its physics parameters. Initialisation from a file name is deprecated.

Use the param class property to view all physics parameters and their possible values:

>>> from snewpy.models.ccsn import Nakazato_2013
>>> Nakazato_2013.param
{'progenitor_mass': <Quantity [13., 20., 30., 50.] solMass>,
 'revival_time': <Quantity [  0., 100., 200., 300.] ms>,
 'metallicity': [0.02, 0.004],
 'eos': ['LS220', 'shen', 'togashi']}

For some models, not all combinations of parameters are valid. Use the get_param_combinations() class method to get a list of all valid combinations and filter it:

>>> list(params for params in Nakazato_2013.get_param_combinations() if params['eos'] != 'shen')
[{'progenitor_mass': <Quantity 30. solMass>, 'revival_time': <Quantity 0. ms>,
  'metallicity': 0.004, 'eos': 'LS220'},
 {'progenitor_mass': <Quantity 30. solMass>, 'revival_time': <Quantity 0. ms>,
  'metallicity': 0.004, 'eos': 'togashi'}]
class snewpy.models.ccsn.Analytic3Species(filename)[source]

An analytical model calculating spectra given total luminosity, average energy, and rms or pinch, for each species.

Parameters:

filename (str) – Absolute or relative path to file with model data.

class snewpy.models.ccsn.Bollig_2016(filename=None, eos='LS220', *, progenitor_mass=None)[source]

Model based on simulations from Bollig et al. (2016). Models were taken, with permission, from the Garching Supernova Archive.

Model Initialization.

Parameters:
  • filename (str) – Absolute or relative path to file with model data, we add nue/nuebar/nux. This argument will be deprecated.

  • eos (str) – Equation of state. Valid value is ‘LS220’. This argument will be deprecated.

  • progenitor_mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid values are [11.2 27. ] solMass.

Raises:
  • FileNotFoundError – If a file for the chosen model parameters cannot be found

  • ValueError – If a combination of parameters is invalid when loading from parameters

class snewpy.models.ccsn.Fornax_2019(filename=None, cache_flux=False, *, progenitor_mass=None)[source]

Model based on 3D simulations from D. Vartanyan, A. Burrows, D. Radice, M. A. Skinner and J. Dolence, MNRAS 482(1):351, 2019. Data available at https://www.astro.princeton.edu/~burrows/nu-emissions.3d/

Model Initialization.

Parameters:
  • filename (str) – Absolute or relative path to file with model data. This argument is deprecated.

  • cache_flux (bool) – If true, pre-compute the flux on a fixed angular grid and store the values in a FITS file.

  • progenitor_mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid values are [ 9. 10. 12. 13. 14. 15. 16. 19. 25. 60.] solMass.

class snewpy.models.ccsn.Fornax_2021(filename=None, *, progenitor_mass=None)[source]

Model based on 3D simulations from D. Vartanyan, A. Burrows, D. Radice, M. A. Skinner and J. Dolence, MNRAS 482(1):351, 2019. Data available at https://www.astro.princeton.edu/~burrows/nu-emissions.3d/

Model Initialization.

Parameters:
  • filename (str) – Absolute or relative path to file with model data. This argument is deprecated.

  • progenitor_mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid values are [12..26, 26.99] solMass.

class snewpy.models.ccsn.Kuroda_2020(filename=None, eos='LS220', mass=<Quantity 20. solMass>, *, rotational_velocity=None, magnetic_field_exponent=None)[source]

Model based on simulations from Kuroda et al. (2020).

Parameters:
  • filename (str) – Absolute or relative path to file with model data. This argument is deprecated.

  • eos (str) – Equation of state. Valid value is ‘LS220’. This argument is deprecated.

  • mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid value is 20 * u.Msun. This argument is deprecated.

  • rotational_velocity (astropy.units.Quantity) – Rotational velocity of progenitor. Valid values are [0. 1.] rad / s

  • magnetic_field_exponent (int) – Exponent of magnetic field (See Eq. 46). Valid Values are [0, 12, 13]

Raises:
  • FileNotFoundError – If a file for the chosen model parameters cannot be found

  • ValueError – If a combination of parameters is invalid when loading from parameters

class snewpy.models.ccsn.Nakazato_2013(filename=None, *, progenitor_mass=None, revival_time=None, metallicity=None, eos=None)[source]

Model based on simulations from Nakazato et al., ApJ S 205:2 (2013), ApJ 804:75 (2015), PASJ 73:639 (2021). See also http://asphwww.ph.noda.tus.ac.jp/snn/.

Model initialization.

Parameters:
  • filename (str) – Absolute or relative path to FITS file with model data. This argument is deprecated.

  • progenitor_mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid values are [13. 20. 30. 50.] solMass.

  • revival_time (astropy.units.Quantity) – Time of shock revival in model in units ms. Valid values are [ 0. 100. 200. 300.] ms. Selecting 0 ms will load a black hole formation model

  • metallicity (float) – Progenitor metallicity. Valid values are [0.02, 0.004].

  • eos (str) – Equation of state. Valid values are [‘LS220’, ‘shen’, ‘togashi’].

Raises:

ValueError – If a combination of parameters is invalid when loading from parameters

Examples

>>> from snewpy.models.ccsn import Nakazato_2013; import astropy.units as u
>>> Nakazato_2013(progenitor_mass=30*u.Msun, metallicity=0.004, revival_time=0*u.s, eos='togashi')
Nakazato_2013 Model: nakazato-togashi-BH-z0.004-s30.0.fits
Progenitor mass  : 30.0 solMass
EOS              : togashi
Metallicity      : 0.004
Revival time     : 0.0 ms
class snewpy.models.ccsn.OConnor_2013(base=None, mass=None, eos='LS220', *, progenitor_mass=None)[source]

Model based on the black hole formation simulation in O’Connor & Ott (2013).

Model Initialization.

Parameters:
  • base (str) – Absolute or relative path folder with model data. This argument is deprecated.

  • mass (int) – Mass of model progenitor in units Msun. This argument is deprecated.

  • eos (str) – Equation of state. Valid values are [‘HShen’, ‘LS220’].

  • progenitor_mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid values are [12..33, 35..5..60, 70, 80, 100, 120] solMass.

Raises:
  • FileNotFoundError – If a file for the chosen model parameters cannot be found

  • ValueError – If a combination of parameters is invalid when loading from parameters

class snewpy.models.ccsn.OConnor_2015(filename=None, eos='LS220', *, progenitor_mass=None)[source]

Model based on the black hole formation simulation in O’Connor (2015).

Model Initialization.

Parameters:
  • filename (str) – Absolute or relative path to tar.gz file with model data. This argument is deprecated.

  • eos (str) – Equation of state. Valid value is ‘LS220’. This argument is deprecated.

  • progenitor_mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid values are 40.0 solMass.

Raises:
  • FileNotFoundError – If a file for the chosen model parameters cannot be found

  • ValueError – If a combination of parameters is invalid when loading from parameters

class snewpy.models.ccsn.Sukhbold_2015(filename=None, *, progenitor_mass=None, eos=None)[source]

Model based on simulations from Sukhbold et al., ApJ 821:38,2016. Models were shared privately by email.

Model Initialization

Parameters:
  • filename (str) – Absolute or relative path to FITS file with model data. This argument is deprecated.

  • progenitor_mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid values are [27. 9.6] solMass.

  • eos (str) – Equation of state. Valid values are [‘LS220’, ‘SFHo’].

Raises:
  • FileNotFoundError – If a file for the chosen model parameters cannot be found

  • ValueError – If a combination of parameters is invalid when loading from parameters

class snewpy.models.ccsn.Tamborra_2014(filename=None, eos='LS220', *, progenitor_mass=None, direction=None)[source]

Model based on 3D simulations from Tamborra et al., PRD 90:045032, 2014. Data files are from the Garching Supernova Archive.

Model Initialization.

Parameters:
  • filename (str) – Absolute or relative path to file with model data, we add nue/nuebar/nux. This argument will be deprecated.

  • eos (str) – Equation of state. Valid value is ‘LS220’. This argument will be deprecated.

  • progenitor_mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid values are [11.2 20. 27. ] solMass.

Raises:
  • FileNotFoundError – If a file for the chosen model parameters cannot be found

  • ValueError – If a combination of parameters is invalid when loading from parameters

class snewpy.models.ccsn.Walk_2018(filename=None, eos='LS220', *, progenitor_mass=None, rotation=None, direction=None)[source]

Model based on SASI-dominated simulations from Walk et al., PRD 98:123001, 2018. Data files are from the Garching Supernova Archive.

Model Initialization.

Parameters:
  • filename (str) – Absolute or relative path to file with model data, we add nue/nuebar/nux. This argument will be deprecated.

  • eos (str) – Equation of state. Valid value is ‘LS220’. This argument will be deprecated.

  • progenitor_mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid values are 15.0 solMass.

Raises:
  • FileNotFoundError – If a file for the chosen model parameters cannot be found

  • ValueError – If a combination of parameters is invalid when loading from parameters

class snewpy.models.ccsn.Walk_2019(filename=None, eos='LS220', *, progenitor_mass=None, direction=None)[source]

Model based on SASI-dominated simulations from Walk et al., PRD 101:123013, 2019. Data files are from the Garching Supernova Archive.

Model Initialization.

Parameters:
  • filename (str) – Absolute or relative path to file with model data, we add nue/nuebar/nux. This argument will be deprecated.

  • eos (str) – Equation of state. Valid value is ‘LS220’. This argument will be deprecated.

  • progenitor_mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid values are [40. 75.] solMass.

Raises:
  • FileNotFoundError – If a file for the chosen model parameters cannot be found

  • ValueError – If a combination of parameters is invalid when loading from parameters

class snewpy.models.ccsn.Warren_2020(filename=None, eos='SFHo', *, progenitor_mass=None, turbmixing_param=None)[source]

Model based on simulations from Warren et al., ApJ 898:139, 2020. Neutrino fluxes available at https://doi.org/10.5281/zenodo.3667908.

Parameters:
  • filename (str) – Absolute or relative path to file with model data. This argument is deprecated.

  • eos (str) – Equation of state. Valid value is ‘SFHo’. This argument is deprecated.

  • progenitor_mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid values are [9..0.25..13, 13..0.1..30, 31..35, 35..5..60, 70..10..90, 100, 120] solMass.

  • turbmixing_param (float) – Turbulent mixing parameter alpha_lambda. Valid Values are [1.23, 1.25, 1.27]

Raises:
  • FileNotFoundError – If a file for the chosen model parameters cannot be found

  • ValueError – If a combination of parameters is invalid when loading from parameters

class snewpy.models.ccsn.Zha_2021(filename=None, eos='ST0S_B145', *, progenitor_mass=None)[source]

Model based on the hadron-quark phse transition models from Zha et al. 2021.

Model Initialization.

Parameters:
  • filename (str) – Absolute or relative path to file with model data. This argument is deprecated.

  • eos (str) – Equation of state. Valid value is ‘ST0S_B145’. This argument is deprecated.

  • progenitor_mass (astropy.units.Quantity) – Mass of model progenitor in units Msun. Valid values are [16..26, 19.89, 22.39, 30, 33] solMass.

Raises:
  • FileNotFoundError – If a file for the chosen model parameters cannot be found

  • ValueError – If a combination of parameters is invalid when loading from parameters

Other Models

class snewpy.models.ccsn.SNOwGLoBES(tarfilename)[source]

A model that does not inherit from SupernovaModel (yet) and imports a group of SNOwGLoBES files.

Parameters:

tarfilename (str) – Absolute or relative path to tar archive with SNOwGLoBES files.

get_fluence(t)[source]

Return the fluence at a given time t.

Parameters:

t (float) – Time in seconds.

Returns:

fluence (dict) – A dictionary giving fluence at time t, keyed by flavor.