Commit 587db747 authored by Simon Conseil's avatar Simon Conseil

Merge branch 'pyplatefit_integration' into 'master'

Add `fit_lines` method to spectrum

See merge request !162
parents c880a3c5 9e4a4ad5
Pipeline #3096 passed with stage
in 14 minutes and 56 seconds
......@@ -2316,6 +2316,31 @@ class Spectrum(ArithmeticMixin, DataArray):
for i in range(self.shape[0])])
return res
def fit_lines(self, redshift, **kwargs):
"""Use pyPLATEFIT to fit the spectrum lines.
This method uses the `pyPLATEFIT.fit_mpdaf_spectrum` function to
perform a line fitting. Refer to its documentation.
Parameters
----------
redshift : float
Expected redshift of the spectrum.
**kwargs : keyword arguments
Additional arguments passed to the `fit_mpdaf_spectrum` function.
Returns
-------
See pyPLATEFIT documentation.
"""
try:
from pyPLATEFIT import fit_mpdaf_spectrum
except ImportError:
raise ImportError("You need to install pyPLATEFIT.")
return fit_mpdaf_spectrum(self, redshift=redshift, **kwargs)
def plot(self, max=None, title=None, noise=False, snr=False,
lmin=None, lmax=None, ax=None, stretch='linear', unit=u.angstrom,
noise_kwargs=None, **kwargs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment