/snlc

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Semi-analytic SN lightcurves

Powered by Astropy Test Status

snlc calculates semi-analytic supernova lightcurves using Arnett's approximation that the spatial and temporal structure can be separated. It relies on NumPy, Astropy, and matplotlib.

It was created for a University of Toronto transients class, and likely contains bugs.

Installation instructions

The package and its dependencies can be installed with:

pip install git+https://github.com/mhvk/snlc.git#egg=snlc

Basic example

The following is to get a quick lightcurve with parameters like those for SN 2011fe.

>>> import numpy as np
>>> import astropy.units as u
>>> import matplotlib.pyplot as plt
>>> from snlc.arnett import Arnett
>>> from snlc.figures import SN2011fe
>>> model = Arnett(**SN2011fe)
>>> t = np.linspace(0, 40, 41) << u.day
>>> lc = model(t)
>>> plt.plot(t, lc['l'].to(u.Lsun), label='AFM17')

Do inspect the SN2011fe dict with parameters, and the output lc! The figures.py file and the tests are useful places to get started.

Contributing

Please open a new issue for bugs, feedback or feature requests.

We welcome code contributions, including pieces of code to reproduce similar efforts in the literature. To add a contribution, please submit a pull request. If you would like assistance, please feel free to contact @mhvk.

For more information on how to make code contributions, please see the Astropy developer documentation.

License

snlc is licensed under the GNU General Public License v3.0 - see the LICENSE file.