GithubHelp home page GithubHelp logo

salt2's Introduction

SALT2 PYTHON MODULE

Python module interface to the SALT2 supernova lightcurve templates

Stephen Bailey Summer 2012

OVERVIEW

This code provides a python interface to the salt2 supernovae timeseries model. Note that this does not run salt2 or directly perform SN lightcurve or spectra fits. It is primarily intended as an interface/interpolator of the salt2 model.

The Salt2Model class does provide a few experimental methods such as chi2spectrum(), chi2spectra(), and fitspectra() intended for fitting the salt2 model to a set of observed spectra. In practice, I found the accuracy of the fit was driven by the salt2 error model and further work would be needed to make that more accurate in order to make these fits quantitatively useful.

INSTALLATION

Add the salt2/python/ directory to your PYTHONPATH, or otherwise move salt2/python/salt2.py into another directory which is in your PYTHONPATH. If someone wants to contribute a disutils setup.py, that would be welcome.

USAGE

Create a Salt2Model model object, using whatever the latest salt2* model files are available in $PYTHONPATH:

m = salt2.model()

Use a specific salt2 model directory:

m = salt2.model('/data/salt2models/salt2-2-2')

Find the wavelengths at which the model is natively sampled:

w = m.wavelengths()

Find the model flux at at phase=0 for defaults x1=0.0 c=0.0:

flux = m.flux(0)

find the model flux at an arbitrary phase, x1, and c:

flux = m.flux(phase=10.3, x1=0.5, c=0.2)

Evaluate the model on a different wavelength grid:

w = N.arange(2000.0, 8001.0, 5.0)
flux = m.flux(phase=0, x1=0.5, c=0.2, wavelengths=w)

Get the model error or variance=error**2:

err = m.error(phase=0.0)
var = m.variance(phase=0.0, x1=0.5)

SALT2 MODEL FILES

For convenience, this package comes bundled with salt2 model templates originally available from Julien Guy at:

http://supernovae.in2p3.fr/~guy/salt/download_templates.html

A more recent version of the templates may be available at that site. These templates are included here with Julien's permission.

salt2's People

Contributors

sbailey avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

nikirui

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.