Skip to content

Specutils Other Packages

Steve Crawford edited this page Oct 7, 2013 · 13 revisions

Components of other packages than can be incorporated into specutils

There are many projects being developed in parallel with specutils, or prior to it, that have capabilities we want included in specutils. This wiki page is meant to track those capabilities and point specutils developers to code that can potentially be re-used in specutils (with some editing to meet astropy coding guidelines) or that should serve as a guideline for specutils development.

Projects

spylot

pyspeckit

There are many individual models that can easily be translated into astropy.models subclasses: http://pyspeckit.bitbucket.org/html/sphinx/models.html

Pyspeckit includes matplotlib-based GUI features for selecting data for continuum and/or line fitting. See: http://pyspeckit.readthedocs.org/en/latest/interactive.html for an example https://github.com/pyspeckit/pyspeckit/blob/master/pyspeckit/spectrum/interactive.py for source code

It also includes facilities for unit conversion that are now pretty much all implemented in astropy.units, but eventually this code: https://github.com/pyspeckit/pyspeckit/blob/master/pyspeckit/spectrum/units.py should include an example of how to use astropy.units for that purpose.

Some examples of how to make matplotlib interactive GUI tests: https://github.com/pyspeckit/pyspeckit-tests/blob/master/simple_fit_interactive.py

grism

Grism doesn't contain any actual fitting capabilities apart from a wrapper to call lmfit and a half-written wrapper to call Sherpa. It is rather written to aid in all the stuff that surrounds the fitting: Building composite line profiles, fitting-by-eye, keeping track of which-corresponds-to-which in a complex model of multiple transitions with multiple components across multiple spatial regions within the same slit, and across multiple data files. This is also reflected in the fact that the underlying framework has a stronger focus on bookkeeping for a big and complex model than on sophisticated maths and physics.

It can, in its current state read in a spectrum, show it in 2D, extract a 1D spectrum from a given subset of the rows of the 2D spectrum, set wavelength ranges to include, add transitions to the model, interactively (by buttons and sliders) build multi-component composite line profiles (limited to Gaussian emission and constant values for continuum around the lines, reflecting what I've needed for the work so far), calling a fitting back-end to fit this to the data and accept or reject the result.

Link to the code will follow, so far a link to a few screenshots.

lpbuilder

Stand-alone version of the line profile editor of grism, mostly for demonstration purposes. https://github.com/thriveth/lpbuilder

pysynphot

This is a prototype module for manipulating spectra. It is intended for it to be used for synthetic photometry, i.e. constructing source spectra and then passing these spectra through an astronomical observatory (e.g. HST, JWST...). See:

https://github.com/spacetelescope/pysynphot

PySALT: saltspec

PySALT is a pyraf package for analysis of SALT data. saltspec is a package which is focused on reducing spectroscopic data from SALT. Despite being focused on SALT, it is primarily a wrapper around python code for reducing longslit and multislit data. The code includes a qt-gui that replaces most of the functionality of identify from IRAF.

The code is available here: https://github.com/saltastro/pysalt

The code also uses pyspectrograph which produces a model of a spectrograph to provide an initial guess for the wavelength solution: https://code.google.com/p/pyspectrograph/wiki/PySpectrograph