mangadap.par.emissionmomentsdb module¶
Container class for the database of emission-line bandpass filters used for non-parameteric measurements of emission-line flux and velocity moments.
Todo
Combine this with the main emissionlinemoments.py file.
- 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/emissionmomentsdb.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 import warnings if sys.version > '3': long = int import os.path import numpy from pydl.goddard.astro import airtovac from pydl.pydlutils.yanny import yanny from .parset import ParDatabase from .spectralfeaturedb import available_spectral_feature_databases, SpectralFeatureDBDef from ..proc.bandpassfilter import BandPassFilterPar from ..proc.util import select_proc_method
- Class usage examples:
Emission-line moment databases are defined using SDSS parameter files. To define a database, you can use one of the default set of available emission-line moment databases (see
available_emission_bandpass_filter_databases()
):from mangadap.par.emissionmomentsdb import EmissionMomentsDB p = EmissionMomentsDB('STRONG')
The above call requires that the
$MANGADAP_DIR
environmental variable is set. If it is not, you can define it’s location, as in:from mangadap.par.emissionmomentsdb import EmissionMomentsDB p = EmissionMomentsDB('STRONG', dapsrc='/path/to/dap/source')
Finally, you can create your own SDSS-style parameter file with your own emission line passbands to use. Example files are provided in
$MANGADAP_DIR/data/emission_bandpass_filters
with a companionREADME
file. With your own file, you have to point to the file usingSpectralFeatureDBDef
, which you can then pass toEmissionMomentsDB
:from mangadap.par.spectralfeaturedb import SpectralFeatureDBDef from mangadap.par.emissionmomentsdb import EmissionMomentsDB d = SpectralFeatureDBDef(key='USER', file_path='/path/to/parameter/file') p = EmissionMomentsDB('USER', emldb_list=d)
The reference frame of the emission-line passband wavelengths must be defined as either vacuum or air, using ‘in_vacuum’. It is expected that the object spectra to be analyzed are calibrated to vacuum wavelengths. If ‘in_vacuum’ is false, this class will use
mangadap.util.idlutils.airtovac()
to convert the emission-line bandpass-filter wavelengths to vacuum.- Revision history:
- 17 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 functions06 Oct 2017: (KBW) Add function to return channel names.
-
class
mangadap.par.emissionmomentsdb.
EmissionMomentsDB
(database_key, emldb_list=None, dapsrc=None)[source]¶ Bases:
mangadap.par.parset.ParDatabase
Basic container class for the database of emission-line bandpass filter parameters. See
mangadap.parset.ParDatabase
for additional attributes.Parameters: - database_key (str) – Keyword selecting the database to use.
- emldb_list (list) – (Optional) List of
SpectralFeatureDBDef
objects that define the parameters required to setup the emission-line bandpass filter database. The database_key must select one of the objects in this list. - dapsrc (str) – (Optional) Root path to the DAP source
directory. If not provided, the default is defined by
mangadap.config.defaults.dap_source_dir()
.
-
database
¶ Keyword of the selected database to use.
Type: str
-
neml
¶ Number of emission-line bandpass filters in the database
Type: int
-
mangadap.par.emissionmomentsdb.
available_emission_bandpass_filter_databases
(dapsrc=None)[source]¶ Return the list of database keys and file names for the available emission-line moment databases. The currently available databases are:
KEY N Description STRONG 13 A subset of mostly strong lines. EXTENDED 21 Include HeI/II, SIII, Hgam-Heps This is a simple wrapper for
mangadap.par.spectralfeaturedb.available_spectral_feature_databases()
.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, each of which defines a unique set of absorption-line indices (seemangadap.proc.bandpassfilter.BandPassFilterPar
).Return type: list Todo
- Add backup function for Python 2.
- Somehow add a python call that reads the databases and constructs the table for presentation in sphinx so that the text above doesn’t have to be edited with changes in the available databases.