mangadap.par.bandheadindexdb module¶
Container class for the database of bandhead 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/bandheadindexdb.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:
Bandhead index databases are defined using SDSS parameter files. To define a database, you can use one of the default set of available bandhead index databases (see
available_bandhead_index_databases()
):from mangadap.par.bandheadindexdb import BandheadIndexDB p = BandheadIndexDB('STANDARD')
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.bandheadindexdb import BandheadIndexDB p = BandheadIndexDB('STANDARD', dapsrc='/path/to/dap/source')
Finally, you can create your own SDSS-style parameter file with your own bandhead indices to use. Example files are provided in
$MANGADAP_DIR/data/bandhead_indices
with a companionREADME
file. With your own file, you have to point to the file usingSpectralFeatureDBDef
, which you can then pass toBandheadIndexDB
:from mangadap.par.spectralfeaturedb import SpectralFeatureDBDef from mangadap.par.bandheadindexdb import BandheadIndexDB d = SpectralFeatureDBDef(key='USER', file_path='/path/to/parameter/file') p = BandheadIndexDB('USER', indxdb_list=d)
The reference frame of the bandhead 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,
BandheadIndexDB
will convert the input index definition to vacuum on a case-by-case basis based on the SDSS parameter file entries, meaningBandheadIndexDB
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 functions06 Oct 2017: (KBW) Add function to return channel names
-
class
mangadap.par.bandheadindexdb.
BandheadIndexDB
(database_key, indxdb_list=None, dapsrc=None)[source]¶ Bases:
mangadap.par.parset.ParDatabase
Basic container class for the database of bandhead-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 bandhead-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.bandheadindexdb.
available_bandhead_index_databases
(dapsrc=None)[source]¶ Return the list of database keys and file names for the available bandhead-line index databases. The currently available databases are:
KEY N Description STANDARD 3 D4000, Dn4000, and Ti0 (8860 A). 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 bandhead 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.