Skip to content

Repository files navigation

sedkit

Powered by AstropyBuild StatusCoverage StatusDocumentation Status

Introduction

sedkit is a collection of pure Python modules for simple SED construction and analysis. Users can create individual SEDs or SED catalogs from spectra and/or photometry and calculate fundamental parameters (fbol, Mbol, Lbol, Teff, mass, log(g)) using the methods presented in Filippazzo et al. (2015).

Installation

Install via PyPI with

pip install sedkit

or via Github with

git clone https://github.com/hover2pi/sedkit.git
python sedkit/setup.py install

Demo

An SED can be constructed by importing and initializing an SED object.

fromsedkitimportSEDtrap1=SED(name='Trappist-1')

The name argument triggers a lookup in the Simbad database for meta, astrometric, and spectral type data. Interstellar reddening is calculated when possible.

Photometry can be added manually...

trap1.add_photometry('Johnson.V', 18.798, 0.082)
trap1.add_photometry('Cousins.R', 16.466, 0.065)
trap1.add_photometry('Cousins.I', 14.024, 0.115)

...and/or retrieved from Vizier catalogs with built-in methods.

trap1.find_2MASS()

Spectrum arrays or ASCII/FITS files can also be added to the SED data.

frompkg_resourcesimportresource_filenamespec_file=resource_filename('sedkit', 'data/Trappist-1_NIR.fits')
importastropy.unitsasutrap1.add_spectrum_file(spec_file, wave_units=u.um, flux_units=u.erg/u.s/q.cm**2/u.AA)

Other data which may affect the calculated and inferred fundamantal parameters can be set at any time.

trap1.spectral_type='M8'trap1.age=7.6*u.Gyr, 2.2*u.Gyrtrap1.radius=0.121*u.R_sun, 0.003*u.R_sun

Results can be calculated at any time by checking the results property.

trap1.results
paramvalueuncunits
Lbol2.24e+306.49e+28erg / s
Lbol_sun-3.230.013--
Mbol12.8360.031--
SpTM8V----
SpT_fit------
Teff258137K
Teff_bb------
Teff_evo2658.066666666666622.96666666666715K
age7.62.2Gyr
bb_source------
blackbody------
dec-5.0413974999999995----
fbol1.21e-103.49e-12erg / (cm2 s)
gravity------
logg5.2814666666666670.005382456140353042--
luminosity_classV----
mass0.09213333333333330.0013456140350877333solMass
mbol13.3080.031--
membership------
nameTrappist-1----
parallax80.45120.12110000103712082mas
prefix------
ra346.6223683333333----
radius0.1210.003solRad
reddening9.259104263037443e-05----
spectral_type68.00.5--

A variety of evolutionary model grids can be used to infer fundamental parameters,

trap1.evo_model='DUSTY00'trap1.mass_from_age()

A variety of atmospheric model grids can be fit to the data,

fromsedkitimportBTSettltrap1.fit_modelgrid(BTSettl())

And any arbitrary atlas of models can be applied as well.

fromsedkitimportSpexPrismLibrarytrap1.fit_modelgrid(SpexPrismLibrary())

Inspect the SED at any time with the interactive plotting method.

trap1.plot()

Entire catalogs of SED objects can also be created and their properties can be arbitrarily compared and analyzed with the sedkit.catalog.Catalog() object.

Please read the full documentation for details on this functionality and much more.

Documentation

Full documentation for the latest build can be found on ReadTheDocs.

The package also contains detailed Jupyter notebooks highlighting the core functionality of its primary classes, including

If you use or reference this software, please cite Filippazzo et al. (submitted to PASP)

Licensed

This project is Copyright (c) Joe Filippazzo and licensed under the terms of the BSD 3-Clause license. See the licenses folder for more information.

About

Spectral energy distribution construction and analysis tools

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages