Skip to content

Modules for working with stellar spectra for exoplanet imaging data

License

Notifications You must be signed in to change notification settings

AnthonyCheetham/stellar_spectra

Repository files navigation

stellar_spectra

Python tools for dealing with spectra in near-infrared exoplanet imaging data.

This repository contains various functions for loading and fitting spectra. It was developed for use with exoplanet imaging data. For example:

  1. Flux-scaling a model stellar spectrum to various photometric datapoints.

  2. Using the model stellar spectrum to convert a set of exoplanet contrast measurements to fluxes.

  3. Fitting a set of exoplanet fluxes to a set of models.

The code is split into three main parts: modules for loading spectral models (bt_nextgen.py, tremblin.py and morley_2012.py), a script to calculate the zeropoint flux of a given filter (calc_zerpoint.py) and a module that contains more general tools (spectral_tools.py).

Loading Spectral Models

spectral_tools.py

  • Can bin spectra to different resolutions, or calculate the predicted flux for a given filter using bin_spectrum, bin_spectrum_filter_curve, bin_spectrum_gaussian, bin_spectrum_all.

  • Scale a model spectrum in flux to match some photometric points using scale_spectral_model_to_flux.

  • Calculate the goodness-of-fit for a two spectra being the same using spectra spectrum_chi2 (e.g. a model and a dataset), and calculate the best-fit flux ratio between two spectra using fit_to_flux.

  • Flux calibrate spectra from the splat / SpeX Prism library (https://github.com/aburgasser/splat) using calibrate_spex_spectrum. This makes sure it is in the correct units and scaled to the right distance for useful comparison with data.

Copyright (C) 2018 Anthony Cheetham

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

About

Modules for working with stellar spectra for exoplanet imaging data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages