mangadap.par.absorptionindexdb module¶
Container class for the database of absorption-line indices to measure.
- License:
- Copyright (c) 2015, SDSS-IV/MaNGA Pipeline Group
- Licensed under BSD 3-clause license - see LICENSE.rst
- Source location:
- $MANGADAP_DIR/python/mangadap/par/absorptionindexdb.py
- Imports and python version compliance:
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import sys import warnings if sys.version > '3': long = int import os.path import numpy from pydl.goddard.astro import airtovac from pydl.pydlutils.yanny import yanny from .parset import ParDatabase from .spectralfeaturedb import available_spectral_feature_databases, SpectralFeatureDBDef from ..proc.bandpassfilter import BandPassFilterPar from ..proc.util import select_proc_method
- Class usage examples:
Absorption-line index databases are defined using SDSS parameter files. To define a database, you can use one of the default set of available absorption-line index databases (see
available_absorption_index_databases()
):from mangadap.par.absorptionindexdb import AbsorptionIndexDB p = AbsorptionIndexDB('LICK')
The above call requires that the
$MANGADAP_DIR
environmental variable is set. If it is not, you can define it’s location, as in:from mangadap.par.absorptionindexdb import AbsorptionIndexDB p = AbsorptionIndexDB('LICK', dapsrc='/path/to/dap/source')
Finally, you can create your own SDSS-style parameter file with your own absorption-line indices to use. Example files are provided in
$MANGADAP_DIR/data/absorption_indices
with a companionREADME
file. With your own file, you have to point to the file usingSpectralFeatureDBDef
, which you can then pass toAbsorptionIndexDB
:from mangadap.par.spectralfeaturedb import SpectralFeatureDBDef from mangadap.par.absorptionindexdb import AbsorptionIndexDB d = SpectralFeatureDBDef(key='USER', file_path='/path/to/parameter/file') p = AbsorptionIndexDB('USER', indxdb_list=d)
The reference frame of the absorption-line index can be different for each index; a column in the SDSS parameter file is used to specify either air or vacuum wavelengths. When reading the input parameter file,
AbsorptionIndexDB
will convert the input index definition to vacuum on a case-by-case basis based on the SDSS parameter file entries, meaningAbsorptionIndexDB
only provides vacuum wavelengths.- Revision history:
- 18 Mar 2016: Original implementation by K. Westfall (KBW)11 May 2016: (KBW) Switch to using pydl.pydlutils.yanny and pydl.goddard.astro.airtovac instead of internal functions01 Dec 2016: (KBW) Relocated from proc to par.06 Oct 2017: (KBW) Add function to return channel names
-
class
mangadap.par.absorptionindexdb.
AbsorptionIndexDB
(database_key, indxdb_list=None, dapsrc=None)[source]¶ Bases:
mangadap.par.parset.ParDatabase
Basic container class for the database of absorption-line index parameters. See
mangadap.parset.ParDatabase
for additional attributes.Parameters: - database_key (str) – Keyword selecting the database to use.
- indxdb_list (list) – (Optional) List of
SpectralFeatureDBDef
objects that define the parameters required to setup the absorption-line index database. The database_key must select one of the objects in this list. - dapsrc (str) – (Optional) Root path to the DAP source
directory. If not provided, the default is defined by
mangadap.config.defaults.dap_source_dir()
.
-
database
¶ Database parameters.
Type: mangadap.par.ParSet
-
nindx
¶ Number of artifacts in the database
Type: int
-
mangadap.par.absorptionindexdb.
available_absorption_index_databases
(dapsrc=None)[source]¶ Return the list of database keys and file names for the available absorption-line index databases. The currently available databases are:
KEY N Description LICK 21 The standard Lick indices from Trager et al. (1998). STANDARD 38 Includes additional Balmer and IMF-sensitive indices This is a simple wrapper for
mangadap.par.spectralfeaturedb.available_spectral_feature_databases()
.Parameters: dapsrc (str) – (Optional) Root path to the DAP source directory. If not provided, the default is defined by mangadap.config.defaults.dap_source_dir()
.Returns: An list of SpectralFeatureDBDef
objects, each of which defines a unique set of absorption-line indices (seemangadap.proc.bandpassfilter.BandPassFilterPar
).Return type: list Todo
- Add backup function for Python 2.
- Somehow add a python call that reads the databases and constructs the table for presentation in sphinx so that the text above doesn’t have to be edited with changes in the available databases.