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.database import Database
db = Database()
db.libraries
{'ref': 'A 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',
'assef': 'Low-resolution spectral templates for AGN and galaxies',
'sky': 'Paranal sky background spectra'}
it will list the spectral libraries available
db.extinction_curves
{'gordon': 'LMC and SMC extinction laws',
'cardelli': 'MW extinction laws',
'calzetti': 'extragalactic attenuation curves'}
db.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.database import SpecLibrary
lib = SpecLibrary("kc96")
lib.templates
updating/loading 'libraries/kc96/index.yml'
Downloading https://homepage.univie.ac.at/miguel.verdugo/database/libraries/kc96/index.yml
[Done]
{'elliptical': None,
'bulge': None,
's0': None,
'sa': None,
'sb': None,
'sc': None,
'starb1': 'starburst with E(B-V)<0.1',
'starb2': 'starburst with 0.11<E(B-V)<0.21',
'starb3': 'starburst with 0.25<E(B-V)<0.35',
'starb4': 'starburst with 0.39<E(B-V)<0.50',
'starb5': 'starburst with 0.51<E(B-V)<0.60',
'starb6': 'starburst with 0.61<E(B-V)<0.70'}
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¶
# Database contents
libraries:
ref : A 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
assef : Low-resolution spectral templates for AGN and galaxies
sky : Paranal sky background spectra
# here go the extinction curves
extinction_curves:
gordon : LMC and SMC extinction laws
cardelli : MW extinction laws
calzetti : extragalactic attenuation curves
# here go filters not found at SVO
filter_systems:
elt/micado : MICADO filters
elt/metis : METIS filters
etc : ESO ETC standard filters