Emission-line Modeling
Analysis class: EmissionLineModel
Reference root: see method_path;
$MANGA_SPECTRO_ANALYSIS/$MANGADRP_VER/$MANGADAP_VER/[METHOD]/[PLATE]/[IFUDESIGN]/ref for MaNGA
Reference file: see default_paths;
manga-[PLATE]-[IFUDESIGN]-[RDXQA]-[BINNING]-[CONTINUUM]-[ELFIT].fits.gz for MaNGA
Optional Parameters: see Analysis Plans. The table below lists the parameters
defined by EmissionLineModelDef
Key |
Type |
Options |
Default |
Description |
|---|---|---|---|---|
|
str |
|
Keyword used to distinguish between different emission-line moment databases. |
|
|
int, float |
0.0 |
Minimum S/N of spectrum to fit |
|
|
str |
|
Name of the emission-line moments band used to set the initial velocity guess for each spaxel. |
|
|
str |
Name of the emission-line moments band used to set the initial velocity dispersion guess for each spaxel. |
||
|
ParSet, dict |
Fitting function parameters |
||
|
Undefined |
Class used to perform the fit. |
||
|
Undefined |
Function or method that performs the fit; must be callable. |
||
|
bool |
False |
If the output file already exists, redo all the calculations and overwrite it. |
Important class dependencies:
SpectralPixelMask: Used to mask spectral regions.
EmissionLineDB: Generalized class that provides the detailed parameters for a set of emission lines to fit
lineprofiles: Generalized class that provides the detailed profile shapes for each line.
EmissionLineTemplates: Used to construct the emission-line templates to use with pPXF.
EmissionLineFit: Provides functions common to both the moment and Gaussian-fit calculations.
Sasuke: The equivalent ofPPXFFitfor the emission-line fits that is primarily a wrapper for pPXF. Critically, this uses the emission-line fitter contributed by Xihan Ji and Michele Cappellari,emline_fitter_with_ppxf().
TemplateLibrary: If usingSasuketo perform the fit, this generalized interface provides the spectral-template library for use in modeling the stellar continuum.
Elric: Provides the main fitting functions when just fitting Gaussians to continuum-subtracted spectra. BEWARE: This class has not been used or tested regularly since MPL-5.
Algorithm:
Setup the fitting method:
Instantiate the
SpectralPixelMaskusing theartifact_maskandwaverangefrom config.
The
BADSKYartifact mask is read and used to build anArtifactDBinstance that masks the typical residuals around the strong sky line at 5577 angstroms.The
waverangeconfig parameter can be used to limit the fitted spectral range; will fit as much as possible if no range is provided.If
fit_method = elric,baseline_ordersets the Legendre function used to set the baseline in each fitting window andwindow_buffersets the +/- window in angstroms around each line to use during the fit.If
fit_method = sasuke:
etpl_line_sigma_modeandetpl_line_sigma_mindetermines the method used to set the emission-line template instrumental dispersion; the available options are set byetpl_line_sigma_options().
reject_boxcarsets the size of the boxcar (pixels) to use for the rejection iterations.The templates used to fit the stellar continuum during the emission-line modeling can be different than those used during the stellar kinematics fit. Use
continuum_templatesandvelscale_ratioto select the new templates and set their sampling. Ifcontinuum_templatesis not givenvelscale_ratiois ignored and the templates are identical between the two modules. If the templates are switched, a newTemplateLibraryobject is instantiated. When switching template libraries, the templates must have their resolution matched to the MaNGA data so that the corrected stellar kinematics from the existingStellarContinuumModelinstance can be held fixed during the fitting.
bias,degree,mdegreeare passed directly to pPXF (at the momentmomentsis ignored and always 2!)
internal_reddening = Trueforces use of the Calzetti (2000) attenuation law; will override any non-zeromdegree.If
deconstruct_bins = True, method will fit the emission lines on an individual spaxel basis instead of the binned spectra; currently this can only be used iffit_method = sasuke.If
mom_vel_nameormom_disp_nameis defined, the DAP will use the corresponding moment measurements from theEmissionLineMomentsobject to set the initial guess for the velocity (default is the datacube metadata redshift) and/or velocity dispersion (default is 100 km/s) for the fit.If requested, call the “Elric” fitter:
WARNING: The Elric fitter has not been used in the DAP for some time. It should generally not be selected; if it is, one may need to spend some time debugging… For this reason, the method is not well documented here. Its main DAP wrapper fitting function is
fit_SpatiallyBinnedSpectra()and its generalized fitting function isfit().Or, call “Sasuke” fitter:
The main DAP wrapper function is
fit_SpatiallyBinnedSpectra()and does the following:
Get the binned spectra from the
SpatiallyBinnedSpectraobjectEither get the stellar templates from the
TemplateLibraryobject pointed to by theStellarContinuumModelobject or, if new templates were selected, build the newTemplateLibraryinstance (which must have its resolution matched to the MaNGA data).Get the fitted stellar kinematics from the
StellarContinuumModelobject usingmatched_kinematics().Determine which binned spectra have the
minimum_snrfrom config, and have a good continuum model (cannot be flagged asNOVALUEorFITFAILED).If deconstructing bins:
Get the individual spaxel spectra from the
DataCubeobjectApply the reddening defined in the
SpatiallyBinnedSpectraobjectGet the individual on-sky spaxel coordinates from the
ReductionAssessmentobject and the unweighted on-sky binned-spectra coordinates from theSpatiallyBinnedSpectraobject.Run the generalized fitting function (see description below), providing the spectra to which the stellar-continuum results are “remapped” to for fitting the emission lines.
Measure the equivalent widths for the individual spaxels using
measure_equivalent_width().Otherwise:
Run the generalized fitting function (see description below), only providing the binned spectra.
Measure the equivalent widths for the binned spectra using
measure_equivalent_width().Construct the “emission-line baseline” as the difference between continuum+emission-line optimized fit from Sasuke and the stellar continuum fit for the stellar kinematics (from the
StellarContinuumModelobject)The generalized fitter is
mangadap.proc.sasuke.Sasuke.fit()and initially proceeds very similarly tomangadap.proc.ppxffit.PPXFFit.fit():
Check the input spectra to fit, guess kinematics, and remapping coordinates if provided
Check and set stellar templates and stellar kinematics if provided
Determine the spectral resolution to use for the emission-line templates; available options are set by
etpl_line_sigma_options().Construct and add emission-line templates using
EmissionLineTemplates.
Parse the
EmissionLineDBobject: Determine which lines to fit and how to group lines into the same template (flux ratio fixed and same kinematics) kinematic components (same velocity and velocity dispersion), velocity groups, and sigma groups using_parse_emission_line_database().Sample the desired spectral resolution at each input line center.
Convert the profile parameters into pixel coordinates.
Construct each template with the specified line profile using classes/methods in
mangadap.util.lineprofiles. Lines with a fixed flux ratio are placed in the same template (this means they’ll also have tied velocities and velocity dispersions).Parse the velocity and sigma groups into tied parameters to provide to pPXF.
Given the template and object spectral range, determine the maximum viable fitting range for pPXF using
fitting_mask().Run fit iterations using
emline_fitter_with_ppxf().
If deconstructing the bins (for the Hybrid (HYB) binning scheme):
(a.) First fit the binned spectra (with a 3-sigma rejection iteration) forcing all the gas components into a single kinematic component (all velocities and velocity dispersions are tied).
(b.) Deconstruct the binned spectrum into its individual spaxels.
(c.) Use the result of the first fit to create a single, optimal stellar template and to set the starting kinematics for first fit to each spaxel.
(d.) Fit each spaxel (with a 3-sigma rejection iteration) with the optimized template and all gas components in a single kinematic component
(e.) Reset the starting guesses and refit each spaxel (without a rejection iteration) with the gas components in the appropriate velocity and sigma groups.
Otherwise:
Perform steps a, c, and e above, but just using the provided spectra (whether or not they’re bins or individual spaxels).
Parse the results of the fit iterations into the output using
_save_results().