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.


License

Copyright © 2019, SDSS-IV/MaNGA Pipeline Group


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

Bases: ParDatabase

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

See ParDatabase for additional attributes.

Each derived class must define its own default directory that contains the relevant databases, the class that defines the base ParSet for each 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, Path) – The SDSS parameter file with the emission-line database.

key

Database signifying keyword

Type:

str

file

File with the emission-line data

Type:

str

size

Number of elements in the database.

Type:

int

_parse_yanny()[source]
_validate()[source]
classmethod available_databases(directory_path=None)[source]

Return the list of available database files.

Parameters:

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

Returns:

A dictionary with the database files and associated keyword.

Return type:

dict

Raises:
  • 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.

Parameters:
  • 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 available_databases(). Note that the file search includes any file with a .par extension. The root of the file should be case-insensitive.