Spectral Template Libraries¶
The two main full-spectrum-fitting modules of the DAP, the stellar
kinematics module
(StellarContinuumModel
)
and the emission-line module
(EmissionLineModel
), use
template libraries to fit the stellar continuum. We describe below
the template libraries included in the DAP repository and the format
needed to add new libraries.
Included Libraries¶
The following spectral template libraries are included with the DAP distribution:
Key |
Reference |
Type |
Pedigree |
Comments |
---|---|---|---|---|
BC03 |
SPS |
Empirical |
||
BPASS |
SPS |
Theoretical |
||
M11ELODIE |
SPS |
Empirical |
||
M11MARCS |
SPS |
Theoretical |
||
M11MILES |
SPS |
Empirical |
||
M11STELIB |
SPS |
Empirical |
||
M11STELIBZSOL |
SPS |
Empirical |
||
MASTARHC |
Stellar |
Empirical |
||
MASTARHC2 |
Stellar |
Empirical |
||
MILES |
Stellar |
Empirical |
||
MILESAVG |
Stellar |
Empirical |
||
MILESHC |
Stellar |
Empirical |
||
MILESTHIN |
Stellar |
Empirical |
||
MIUSCAT |
SPS |
Empirical |
||
MIUSCATTHIN |
SPS |
Empirical |
||
STELIB |
Stellar |
Empirical |
Template Library Datamodel¶
Input Data Format¶
The primary constraint on the format of the spectra to be used as
templates is that they are read using
read_template_spectrum()
. That is:
Each spectrum must be in its own fits file.
The flux data must be in the first extension.
The wavelength vector is constructed from the header WCS (see
wavelength_vector()
). The wavelength range of each spectrum need not be the same.The inverse variance or wavelength dependent spectral resolution (\(R=\lambda/\delta\lambda\)) can be optionally provided. If the spectral resolution is not provided, it should be defined by the Template Library Definition.
Template Library Definition¶
Template libraries are defined for use in the DAP using the
configuration files in
$MANGADAP_DIR/mangadap/config/spectral_templates
. These
configuration files are parsed by
available_template_libraries()
,
which provides a list of
TemplateLibraryDef
instances
that can be selected using a keyword.
The critical components to the definition of the template library are:
file_search
: the search string used by glob.glob to find the fits files with the template library spectra and
fwhm
orsres_ext
: the FWHM of the (Gaussian) line-spread function in angstroms or the name of the extension in each template fits file with the spectral resolution, \(R=\lambda/\delta\lambda\).
Output¶
When instantiating a template library, the processed library will be
written to disk, depending on the hardcopy
argument; by default
this argument is True. If the template library has already been
processed and written to disk, the instantiation of the object will
skip processing the library and just read the result of the previous
instantiation.
The path (directory_path
) and name of the file
(processed_file
) can be defined upon instantiating the object. If
not provided, the default path is set by
dap_common_path()
, and the output
file name is set by dap_file_name()
.
The format of the output file is:
HDU |
Name |
Description |
---|---|---|
0 |
|
Empty |
1 |
|
Wavelength vector |
2 |
|
Flux array |
3 |
|
Bitmask values; see
|
4 |
|
Spectral resolution |
5 |
|
If needed, the offset in km/s between the target
resolution of the spectra and the actual resolution
acheived. See
|
Adding new template libraries¶
Adding new template libraries is relatively straight-forward. First,
make sure the templates adhere to the Input Data Format.
Then, you can either use the library by defining it programmatically,
or by adding a new configuration file to the
$MANGADAP_DIR/mangadap/config/spectral_templates
directory. See
the TemplateLibrary Class usage examples and the
TemplateLibrary example provided by the DAP
Development Guidelines.