mangadap.par.emissionlinedb module¶
Container class for a database of emission-line parameters, as well as support classes and functions.
Class usage examples¶
To define an emission line:
from mangadap.par.emissionlinedb import EmissionLinePar
p = EmissionLinePar(index=44, name='Ha', restwave=6564.632, action='f', line='l',
flux=1.0, vel=0.0, sig=10., mode='f')
More often, however, you will want to define an emission-line database using an SDSS parameter file. To do so, you can use one of the default set of available emission-line databases:
from mangadap.par.emissionlinedb import EmissionLineDB
print(EmissionLineDB.available_databases())
emldb = EmissionLineDB.from_key('ELPMPL9')
The above call uses the
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.emissionlinedb import EmissionLineDB
emldb = EmissionLineDB('/path/to/emission/line/database/myeml.par')
The above will read the file and set the database keyword to
‘MYEML’ (i.e., the capitalized root name of the *.par
file).
See Emission-Line Measurements for the format of the parameter file.
Copyright © 2019, SDSS-IV/MaNGA Pipeline Group
- class mangadap.par.emissionlinedb.EmissionLineDB(parfile)[source]¶
Bases:
mangadap.par.spectralfeaturedb.SpectralFeatureDB
Basic container class for the database of emission-line parameters.
Each row of the database is parsed using
EmissionLinePar
. For the format of the input file, see Gaussian Emission-Line Modeling.The primary instantiation requires the SDSS parameter file with the emission-line data. To instantiate using a keyword, use the
from_key()
method of the base class; see the base class for instantiation and additional attributes.- key¶
Database signifying keyword
- Type
str
- file¶
File with the emission-line data
- Type
str
- size¶
Number of emission lines in the database.
- Type
int
- _parse_yanny()[source]¶
Parse the yanny file (provided by
file
) for the emission-line database.- Returns
The list of
ParSet
instances for each line of the database.- Return type
list
- channel_names(dicttype=True)[source]¶
Return a dictionary with the channel names as the dictionary key and the channel number as the dictionary value. If
dicttype
is False, a list is returned with just the string keys.
- default_data_dir = 'emission_lines'¶
Name of the directory in the mangadap data path with the distributed emission-line databases.
- property neml¶
Number of emission lines in the database.
- tie_index_match()[source]¶
Return a vector with the row indices for the tied parameters, which is more useful than the ID number of the tied line.
- to_datatable(quiet=False)[source]¶
Constuct an
EmissionLineDefinitionTable
instance with the line database.- Parameters
quiet (
bool
, optional) – Suppress terminal output- Returns
Table with the emission-line metadata.
- Return type
- class mangadap.par.emissionlinedb.EmissionLineDefinitionTable(name_len=1, tie_len=1, shape=None)[source]¶
Bases:
mangadap.util.datatable.DataTable
A
DataTable
with the data from anEmissionLineDB
object.Table includes:
Key
Type
Description
ID
int64
Emission line ID number
NAME
str_
Name of the emission line
RESTWAVE
float64
Rest wavelength of the emission line
ACTION
str_
Action to take for this emission line; see Emission-Line “Actions”
TIE_ID
int64
ID of the line to which this one is tied.
TIE_FLUX
str_
Tying parameter for the flux of each line.
TIE_VEL
str_
Tying parameter for the velocity of each line.
TIE_SIG
str_
Tying parameter for the dispersion of each line.
- Parameters
name_len (
int
, optional) – The maximum length of any of the emission line names.tie_len (
int
, optional) – The maximum length of a tying string. Not sure if this is needed.shape (
int
,tuple
, optional) – The shape of the initial array. If None, the data array will not be instantiated; useinit()
to initialize the data array after instantiation.
- class mangadap.par.emissionlinedb.EmissionLinePar(index=None, name=None, restwave=None, action=None, tie_index=None, tie_par=None, blueside=None, redside=None)[source]¶
Bases:
mangadap.par.parset.KeywordParSet
Metadata used to define an emission line for the DAP to fit parametrically.
These parameters are only for a single emission line; see
EmissionLineDB
for setting a full line list of parameters.Todo
Point to/add a description the paramters.