enyo.util.lineprofiles module

Implements a set of line profile parameterizations.


License

Copyright © 2020, Kyle B. Westfall


#.. _pypi https://pypi.org/project/sdss-mangadap/

class enyo.util.lineprofiles.FFTGaussianLSF(p=None, dx=None, pixel=True)[source]

Bases: enyo.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
sample(x)[source]

Sample the profile.

Warning

Does not check if the provided \(x\) values are sampled at dx.

Parameters:x (array-like) – Independent variable.
class enyo.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
static npar()[source]
parameters_from_moments(mom0, mom1, mom2)[source]

Provided the 0th, 1st, and 2nd moments, produce a set of parameters for the profile.

sample(x)[source]

Sample the profile.

Parameters:x (array-like) – Independent variable.
set_par(p)[source]

Set the internal parameters to the provided set.

Parameters:p (array-like) – LSF parameters.
Raises:ValueError – Raised if the provided parameter vector is not 3 elements long.
class enyo.util.lineprofiles.IntegratedGaussianLSF(p=None, dx=None)[source]

Bases: enyo.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
sample(x)[source]

Sample the profile.

Warning

Does not check if the provided \(x\) values are sampled at dx.

Parameters:x (array-like) – Independent variable.