mangadap.util.lineprofiles module¶
Implements a set of line profile parameterizations.
- License:
- Copyright (c) 2017, SDSS-IV/MaNGA Pipeline Group
- Licensed under BSD 3-clause license - see LICENSE.rst
- Source location:
- $MANGADAP_DIR/python/mangadap/util/lineprofiles.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 if sys.version > '3': long = int import numpy from scipy import special, fftpack from astropy.modeling import FittableModel, Parameter
- Class usage examples:
- Add usage
- Revision history:
- 25 May 2017: Original implementation by K. Westfall (KBW)
-
class
mangadap.util.lineprofiles.
FFTGaussianLSF
(p=None, dx=None, pixel=True)[source]¶ Bases:
mangadap.util.lineprofiles.GaussianLSF
Define a Gaussian line profile by first constructing the analytic FFT of the profile and then returning the inverse real FFT. See ppxf_util.emline by M. Cappellari. The sampling must be uniform in \(x\).
Parameters: - p (array-like) – (Optional) Input parameters ordered as the total integral of the profile, the profile center, and the profile standard deviation. Assumed to be (1.0, 0.0, 1.0) by default.
- dx (float) – (Optional) Sampling width. Default is 1.
- pixel (bool) – (Optional) Flag to produce profile integrated over the sampling width.
-
p
¶ Most recently used parameters
Type: numpy.ndarray
-
dx
¶ Assumed sampling.
Type: float
-
pixel
¶ Flag to produce profile integrated over the sampling width.
Type: bool
Raises: ValueError
– Raised if the provided parameter vector is not 3 elements long.
-
class
mangadap.util.lineprofiles.
GaussianLSF
(p=None)[source]¶ Bases:
object
Define a Gaussian line profile, sampled over the width of the sampling step, parameterized by its integral (\(F\)), center (\(\mu\)), and standard deviation (\(\sigma\)). I.e:
\[\mathcal{N}(x|f,\mu,\sigma) = \frac{f}{\sqrt{2\pi}\sigma} \exp\left(\frac{-\Delta^2}{2\sigma^2}\right)\]where \(\Delta = x-\mu\). The coordinate vector \(x\) does not need to be uniformly sampled.
Parameters: p (array-like) – (Optional) Input parameters ordered as the total integral of the profile, the profile center, and the profile standard deviation. Assumed to be (1.0, 0.0, 1.0) by default. -
p
¶ Most recently used parameters
Type: numpy.ndarray
Raises: ValueError
– Raised if the provided parameter vector is not 3 elements long.-
-
class
mangadap.util.lineprofiles.
GaussianLineProfile
(zmom=1.0, mean=0.0, sigma=1.0, **kwargs)[source]¶ Bases:
astropy.modeling.core.FittableModel
Define a Gaussian line profile as parameterized by its zeroth moment, mean, and standard deviation:
\[\mathcal{N}(x|f,\mu,\sigma) = \frac{f}{\sqrt{2\pi}\sigma} \exp\left(\frac{-(x-\mu)^2}{2\sigma^2}\right)\]The base class is astropy.modeling.FittableModel, which facilitates its use in combining multiple components and other models in the astropy.modeling suite.
-
_abc_cache
= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache
= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache_version
= 54¶
-
_abc_registry
= <_weakrefset.WeakSet object>¶
-
_is_dynamic
= False¶
-
_parameters_
= {'mean': Parameter('mean', default=0.0), 'sigma': Parameter('sigma', default=1.0), 'zmom': Parameter('zmom', default=1.0)}¶
-
inputs
= ('x',)¶
-
mean
¶
-
outputs
= ('y',)¶
-
param_names
= ('zmom', 'mean', 'sigma')¶
-
sigma
¶
-
zmom
¶
-
-
class
mangadap.util.lineprofiles.
IntegratedGaussianLSF
(p=None, dx=None)[source]¶ Bases:
mangadap.util.lineprofiles.GaussianLSF
Define a Gaussian line profile, integrated over the width of the sampling step, parameterized by its integral (\(F\)), center (\(\mu\)), and standard deviation (\(\sigma\)). I.e:
\[\mathcal{N}(x|F,\mu,\sigma) = \frac{F}{2} \left[ {\rm erf}\left(\frac{\Delta+\delta_x/2}{\sqrt{2}\sigma}\right) - {\rm erf}\left(\frac{\Delta-\delta_x/2}{\sqrt{2}\sigma}\right)\right]\]where \({\rm erf}(x)\) is the error function, \(\Delta = x-\mu\), and \(\delta_x\) is the sampling step. The sampling must be uniform in \(x\).
Parameters: - p (array-like) – (Optional) Input parameters ordered as the total integral of the profile, the profile center, and the profile standard deviation. Assumed to be (1.0, 0.0, 1.0) by default.
- dx (float) – (Optional) Sampling width. Default is 1.
-
p
¶ Most recently used parameters
Type: numpy.ndarray
-
dx
¶ Assumed sampling.
Type: float
Raises: ValueError
– Raised if the provided parameter vector is not 3 elements long.
-
class
mangadap.util.lineprofiles.
NCompLineProfile
(ncomp, par=None, err=None, profile=<class 'mangadap.util.lineprofiles.GaussianLineProfile'> Name: GaussianLineProfile Inputs: ('x', ) Outputs: ('y', ) Fittable parameters: ('zmom', 'mean', 'sigma'))[source]¶ Bases:
object
Construct a single line profile from many components with the same profile parameterization.