Commit 9e4a4ad5 authored by Yannick Roehlly's avatar Yannick Roehlly

Add `fit_lines` method to spectrum

Use pyPLATEFIT and keep the compatibility with line_fitting branch
parent c880a3c5
Pipeline #3093 passed with stage
in 14 minutes and 39 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.
redshift : float
Expected redshift of the spectrum.
**kwargs : keyword arguments
Additional arguments passed to the `fit_mpdaf_spectrum` function.
See pyPLATEFIT documentation.
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