Database#

speXtra comes with a built-in database of spectral templates, extinction curves and astronomical filters.

The database organized through yaml files which describe the contents of the different data files.

The inner workings of the database are transparent to the user and generally the user does not need to deal with the database when working with speXtra.

There are however few things that might be useful to the user, specially when working in interactive mode (e.g. Jupyter Notebooks)

The database is organized within a directory tree. Depending on what you are requesting, a spectra template, a extinction curve or a filter, it will look for it at that particular place. The syntax is standard:

  • "library_name/template_name" for a spectral template

  • "extinction_curve_family/extinction_curve_name" for extinction curves

  • "filter_system/filter_name" for astronomical filters

Below you can find the contents of the database database-contents

Browsing the database#

There are few ways to interact with the database to examine its contents or to use them programately

from spextra import spextra_database
spextra_database["libraries"]
/home/docs/checkouts/readthedocs.org/user_builds/spextrahb/envs/stable/lib/python3.11/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm
{'ref': 'Library of reference stars',
 'kc96': 'Kinney-Calzetti Atlas',
 'pickles': 'Pickles Stellar Library',
 'dobos': 'SDSS galaxy composite spectra',
 'irtf': 'IRTF spectral library',
 'agn': 'AGN templates',
 'nebulae': 'Emission line nebulae',
 'brown': 'Galaxy SEDs from the UV to the Mid-IR',
 'kurucz': 'Subset of Kurucz 1993 Models',
 'sne': 'Supernova Legacy Survey',
 'moehler': 'flux/telluric standards with X-Shooter',
 'madden': 'High-Resolution Spectra of Habitable Zone Planets',
 'bosz/hr': 'BOSZ stellar atmosphere Grid - High Resolution',
 'bosz/mr': 'BOSZ stellar atmosphere Grid - Medium Resolution',
 'bosz/lr': 'BOSZ stellar atmosphere Grid - Low Resolution',
 'sky': 'Paranal sky background spectra',
 'shapley': 'Rest-Frame Ultraviolet Spectra of z ∼ 3 Lyman Break Galaxies',
 'etc/kurucz': 'ESO ETC subset of the Kurucz 1993 models',
 'etc/marcs/p': 'ESO ETC subset of the MARCS Stellar Models with Plane Parallel Geometry',
 'etc/marcs/s': 'ESO ETC subset of the MARCS Stellar Models with Spherical Geometry',
 'etc/misc': 'Other templates, nubulae and qso'}

it will list the spectral libraries available

spextra_database["extinction_curves"]
{'gordon': 'LMC and SMC extinction laws',
 'cardelli': 'MW extinction laws',
 'calzetti': 'extragalactic attenuation curves'}
spextra_database["filter_systems"]
{'elt/micado': 'MICADO filters',
 'elt/metis': 'METIS filters',
 'etc': 'ESO ETC standard filters'}

will print the extinction curves and filter systems available

SpecLibrary is also important to examine the contents of each spectral library. To use it, simply call it like this

from spextra import SpecLibrary
lib = SpecLibrary("kc96")
list(lib)
['elliptical',
 'bulge',
 's0',
 'sa',
 'sb',
 'sc',
 'starb1',
 'starb2',
 'starb3',
 'starb4',
 'starb5',
 'starb6']

and it will list all templates available for that library.

Similarly FilterSystem holds the information for a particular filter system and ExtinctionCurveLibrary for a particular extinction curve family.

Database contents#

libraries:
  ref: Library of reference stars
  kc96: Kinney-Calzetti Atlas
  pickles: Pickles Stellar Library
  dobos: SDSS galaxy composite spectra
  irtf: IRTF spectral library
  agn: AGN templates
  nebulae: Emission line nebulae
  brown: Galaxy SEDs from the UV to the Mid-IR
  kurucz: Subset of Kurucz 1993 Models
  sne: Supernova Legacy Survey
  moehler: flux/telluric standards with X-Shooter
  madden: High-Resolution Spectra of Habitable Zone Planets
  bosz/hr: BOSZ stellar atmosphere Grid - High Resolution
  bosz/mr: BOSZ stellar atmosphere Grid - Medium Resolution
  bosz/lr: BOSZ stellar atmosphere Grid - Low Resolution
  sky: Paranal sky background spectra
  shapley: Rest-Frame Ultraviolet Spectra of z ∼ 3 Lyman Break Galaxies
  etc/kurucz: ESO ETC subset of the Kurucz 1993 models
  etc/marcs/p: ESO ETC subset of the MARCS Stellar Models with Plane Parallel Geometry
  etc/marcs/s: ESO ETC subset of the MARCS Stellar Models with Spherical Geometry
  etc/misc: Other templates, nubulae and qso

extinction_curves:
  gordon: LMC and SMC extinction laws
  cardelli: MW extinction laws
  calzetti: extragalactic attenuation curves

filter_systems:
   elt/micado: MICADO filters
   elt/metis: METIS filters
   etc: ESO ETC standard filters