Skip to main content

sedkit

Powered by Astropy Build Status Coverage Status Documentation Status DOI

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) and described in the documentation: https://sedkit.readthedocs.io/.

Installation

Install in an environment with Python 3.11, 3.12, 3.13.

pip install sedkit

Developer Instructions

If you plan to modify and/or contribute to the code, clone the repository and then install an editable version of the package and the requirements for running the tests.

pip install -e ".[test]"

Demo

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

from sedkit import SED
trap1 = 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, '2006AJ....132.1234C')
trap1.add_photometry('Cousins.R', 16.466, 0.065, '2006AJ....132.1234C')
trap1.add_photometry('Cousins.I', 14.024, 0.115, '2006AJ....132.1234C')

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

trap1.find_2MASS()
trap1.find_WISE()

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

import importlib.resources
spec_file = str(importlib.resources.files('sedkit')/ 'data/Trappist-1_NIR.fits')
import astropy.units as u
trap1.add_spectrum_file(spec_file, wave_units=u.um, flux_units=u.erg/u.s/u.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', '2006AJ....132.1234C'
trap1.age = 7.6*u.Gyr, 2.2*u.Gyr, '2017ApJ...845..110B'
trap1.radius = 0.121*u.R_sun, 0.003*u.R_sun, '2021PSJ.....2....1A'

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

trap1.results
param value unc units
name Trappist-1 -- --
ra 346.6223683333333 -- --
dec -5.0413974999999995 -- --
age 7.6 2.2 Gyr
Lbol 2.24e+30 6.49e+28 erg / s
Lbol_sun -3.23 0.013 --
Mbol 12.836 0.031 --
SpT M8V -- --
Teff 2581 37 K
fbol 1.21e-10 3.49e-12 erg / (cm2 s)
logg 5.281466666666667 0.005382456140353042 --
mass 0.0921333333333333 0.0013456140350877333 solMass
mbol 13.308 0.031 --
membership -- -- --
parallax 80.4512 0.12110000103712082 mas
radius 0.121 0.003 solRad
reddening 9.259104263037443e-05 -- --
spectral_type 68.0 0.5 --

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

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

Any arbitrary atlas of models (stored in data\models\atmospheric) can be used to fit the data with or without MCMC analysis.

from sedkit import SpexPrismLibrary
trap1.fit_modelgrid(SpexPrismLibrary(), mcmc=True)

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

trap1.plot(integral=True, best_fit=True)

References for all data can be accessed via the refs attribute.

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 and Notebooks

Full documentation is available: https://sedkit.readthedocs.io/.

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

Metadata

Release files for sedkit 2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sedkit 2.1
File Size Uploaded Provenance Actions
sedkit-2.1.tar.gz 2.4 MB With provenance Details for sedkit-2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sedkit 2.1
File Interpreter ABI Platform Actions
sedkit-2.1-py3-none-any.whl Python 3 none any Details for sedkit-2.1-py3-none-any.whl

Total release size: 4.8 MB

Release files / sedkit-2.1.tar.gz

Download URL sedkit-2.1.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
fc6c29e4fb9571fc4ab9918470c81116138f16fd15e732b7283cad0f6381faee
BLAKE2b-256 checksum
How to use checksums
9b724be31d01eedcfa03d06c901e76d18f13e2b59092556c500360d7dd7fd948
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 12, 2025.

Transparency log

Release files / sedkit-2.1-py3-none-any.whl

Download URL sedkit-2.1-py3-none-any.whl
Size 2.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f1932b71882fde14b347041836171661a1be601c663058a0b01707fc4db4297b
BLAKE2b-256 checksum
How to use checksums
489806bc19ea91bd22c4d37274b61e5d439356edb6f95544d2543f7e6b7e67d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 12, 2025.

Transparency log

Security for sedkit 2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sedkit-2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 12, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page