mangadap.par.spectralfeaturedb module

Container class for databases of spectral features. This is the base class used by mangadap.par.artifactdb.ArtifactDB, mangadap.par.emissionlinedb.EmissionLineDB, mangadap.par.emissionmomentsdb.EmissionMomentsDB, mangadap.par.absorptionindexdb.AbsorptionIndexDB, and mangadap.par.bandheadindexdb.BandheadIndexDB.

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/spectralfeaturedb.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
if sys.version > '3':
    long = int

import os.path
from os import environ
import glob
import numpy

from .parset import ParSet
from ..config.defaults import dap_source_dir
from ..util.parser import DefaultConfig
Class usage examples:
Add usage examples
Revision history:
18 Mar 2016: Original implementation by K. Westfall (KBW)
25 Feb 2017: (KBW) Change to using mangadap.util.parser.DefaultConfig
class mangadap.par.spectralfeaturedb.SpectralFeatureDBDef(key, file_path)[source]

Bases: mangadap.par.parset.ParSet

Class with parameters used to define an absorption-line index database. Options and defaults in ParSet base class are set to None.

mangadap.par.spectralfeaturedb.available_spectral_feature_databases(sub_directory, dapsrc=None)[source]

Generic routine for finding available spectral-feature database definitions in the config directory path.

Warning

Function is currently only valid for Python 3.2 or greater!

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.

Return type:

list

Raises:
  • NotADirectoryError – Raised if the provided or default dapsrc is not a directory.
  • FileNotFoundError – Raised if the database parameter file is not found.
  • KeyError – Raised if the keywords are not all unique.
  • NameError – Raised if either ConfigParser or ExtendedInterpolation are not correctly imported. The latter is a Python 3 only module!

Todo

  • Add backup function for Python 2.
mangadap.par.spectralfeaturedb.validate_spectral_feature_config(cnfg)[source]

Validate the mangadap.util.parser.DefaultConfig object with the spectral-feature database parameters.

Parameters:cnfg (mangadap.util.parser.DefaultConfig) – Object with spectral-feature database parameters.
Raises:KeyError – Raised if required keyword does not exist.