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 |
||
MASTARSSP |
SPS |
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
or by defining the
required parameters in the Analysis Plans. The required parameters are:
Key |
Type |
Options |
Default |
Description |
---|---|---|---|---|
|
str |
|
Keyword to distinguish the template library. |
|
|
str |
|
Search pattern used to find the 1D fits spectra to include in the template library. The search string must either include the full path or be within the template directory of the DAP source distribution. |
|
|
int, float |
2.5 |
FWHM of the resolution element in angstroms. |
|
|
str |
Extension in the fits files with measurements of the spectral resolution as a function of wavelength. If present, this supercedes any provided FWHM. |
||
|
bool |
False |
Flag that the wavelengths of the spectra are in vacuum, not air. |
|
|
ndarray, list |
Two-element array with the starting and ending wavelengths for the valid spectral range of the templates. |
||
|
int, float |
Minimum valid flux in the template spectra. |
||
|
bool |
False |
Flag that the template spectra have been binned logarithmically in wavelength. |
For example, to define a new template library for use in the stellar-continuum fitting module, you could include the following in your Analysis Plans:
[default.continuum.fit.templates]
key = 'MYLIB' # Library keyword
file_search = '/path/to/library/*.fits' # Search string
fwhm = 2.50 # FWHM of resolution element
in_vacuum = false # Wavelength in vacuum?
wave_limit = [3575., 7400. ] # Valid wavelength range
lower_flux_limit = 0.0 # Lower limit for valid flux
log10 = False # Log binned?
Whereas to use one of the existing template libraries, you only need to define the keyword of the library:
[default.continuum.fit.templates]
key = 'MILESHC'
Output
When instantiating a template library, the processed library will be written to
disk, depending on the hardcopy
argument; by default this argument is False.
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 (output_path
) and name of the file (output_file
) can be defined
upon instantiating the object. If not provided, the default path is set to the
current working directory and the output file name is set to the name of the
library; see
default_paths()
.
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 straight-forward. First, make sure the templates adhere to the Input Data Format. Then add the parameters for the templates to your Analysis Plans file, as described above.