Installation

SNTD works on Python 3.5+ and requires the following Python packages:

Install using pip

Using pip:

pip install sntd

If you plan to use SNTD to simulate the effects of microlensing, which uses the [Wambsganss 1999] microlens code, then you will need a fortran compiler. You can install gfortran here.

Common Installation Issues

  1. You will need a C compiler (e.g. gcc or clang) to be installed for the installation to succeed due to SNCosmo.
  2. Sometimes there is an issue with the install related to numpy, particularly if you are installing in a fresh build of python (e.g. a new virtual environment). If this happens, try installing numpy using pip, and then installing SNTD using pip.
  3. On MacOS and a fresh python build, you may have an issue with importing sntd because of matplotlib and an error saying python was not installed as a framework. A fix for that issue is on stack overflow.
  4. Sometimes you can get an error when using the microlensing component of SNTD involving the microlens executable. This involves differences between the machine the microlens executable was created on and yours. Just go to the microlens github repo and follow the instructions for downloading and installing the wambsganss microlens code here, for the with FITS-file output option. When you have the microlens executable, just replace the SNTD executable in sntd/sntd/microlens with your new executable, and reinstall.

Install latest development version

SNTD is being developed on github. To get the latest development version using git:

git clone git://github.com/sntd.git
cd sntd

then:

python setup.py test
python setup.py install

Optional dependencies

Several additional packages are recommended for enabling optional functionality in SNCosmo.

  • matplotlib for plotting functions.
  • iminuit for light curve fitting using the Minuit minimizer in sncosmo.fit_lc.
  • emcee for MCMC light curve parameter estimation in sncosmo.mcmc_lc.
  • pyParz for microlensing uncertainty estimation.

These packages are all pip installable.

The corner package is also recommended for plotting results from the samplers sncosmo.mcmc_lc and sncosmo.nest_lc, but is not used by any part of sncosmo.