mangadap.par.bandheadindexdb module

Container class for the database of bandhead indices to measure.

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:

from mangadap.par.bandheadindexdb import BandheadIndexDB
bhddb = BandheadIndexDB.from_key('BHBASIC')

The above call uses the BandheadIndexDB.from_key() method to define the database using its keyword and the database provided with the MaNGA DAP source distribution. You can also define the database directly for an SDSS-style parameter file:

from mangadap.par.bandheadindexdb import BandheadIndexDB
bhddb = BandheadIndexDB('/path/to/bandhead/index/database/mybhd.par')

The above will read the file and set the database keyword to ‘MYBHD’ (i.e., the capitalized root name of the *.par file). See Spectral-Index Parameters for the format of the parameter file.

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 functions
06 Oct 2017: (KBW) Add function to return channel names
02 Dec 2019: (KBW) Significantly reworked to use the new base class.


Copyright © 2019, SDSS-IV/MaNGA Pipeline Group

class mangadap.par.bandheadindexdb.BandheadIndexDB(parfile)[source]

Bases: mangadap.par.spectralfeaturedb.SpectralFeatureDB

Basic container class for the database of bandhead or color indices.

Each row of the database is parsed using mangadap.proc.bandpassfilter.BandPassFilterPar. For the format of the input file, see Bandhead or Color Index Parameters.

The primary instantiation requires the SDSS parameter file with the bandpass data. To instantiate using a keyword (and optionally a directory that holds the parameter files), use the mangadap.par.spectralfeaturedb.SpectralFeatureDB.from_key() class method. See the base class for additional attributes.

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

Database signifying keyword


File with the data


Number of features in the database.


Boolean array flagging bandpasses as dummy placeholders.


Parse the yanny file (provided by file) for the bandhead database.

Returns:The list of mangadap.par.parset.ParSet instances for each line of the database.
Return type:list

Return a dictionary with the channel names as the dictionary key and the channel number as the dictionary value. An offset can be added to the channel number; i.e., if the offset is 2, the channel numbers will be a running number starting with 2.

default_data_dir = 'bandhead_indices'