mangadap.par.spectralfeaturedb module

Container class for databases of spectral features. This implements 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.

Revision history

18 Mar 2016: Original implementation by K. Westfall (KBW)
25 Feb 2017: (KBW) Change to using mangadap.util.parser.DefaultConfig
02 Dec 2019: (KBW) Significantly reworked to provide a more useful and user-friendly base class.


Copyright © 2019, SDSS-IV/MaNGA Pipeline Group

class mangadap.par.spectralfeaturedb.SpectralFeatureDB(parfile)[source]

Bases: mangadap.par.parset.ParDatabase

Basic container class for the parameters databases of spectral features. This is the base class for all of the following:

See mangadap.parset.ParDatabase for additional attributes.

Each derived class must define its own default directory that contains the relevant databases, the class that defines the base mangadap.par.parset.ParSet for each mangadap.par.parset.ParDatabase entry, and the method that parses the parameter file into the parameter list.

The primary instantiation requires the SDSS parameter file. To instantiate using a keyword (and optionally a directory that holds the parameter files), use from_key().

Parameters:parfile (str) – The SDSS parameter file with the emission-line database.

Database signifying keyword


File with the emission-line data


Number of elements in the database.

classmethod available_databases(directory_path=None)[source]

Return the list of available database files.


directory_path (str, optional) – Root path with the database files. If None, uses the default directory defined by default_path().


A dictionary with the database files and associated keyword.

Return type:


  • NotADirectoryError – Raised if the provided or default directory does not exist.
  • ValueError – Raised if the keywords found for all the *.par files are not unique.
default_data_dir = None
classmethod default_path()[source]

Return the default path with the emission-line databases.

classmethod from_key(key, directory_path=None)[source]

Instantiate the object using a keyword.

  • key (str) – Keyword selecting the database to use.
  • directory_path (str, optional) – Root path with the database parameter files. If None, uses the default set by default_emission_line_database_path(). Note that the file search includes any file with a .par extension. The root of the file should be case-insensitive.