gauss_fit gives unrelated error when outside the wavelength range
When running Spectrum.gauss_fit with wavelengths outside of the wavelength range, an error occurs due to the interpolation of the data. Instead, could the message be more explicit regarding the values being outside of the Spectrum wavelength range?
Here is the message obtained: in Spectrum.gauss_fit(self, lmin, lmax, lpeak, flux, fwhm, cont, peak, spline, weight, plot, plot_factor, unit, fix_lpeak) 1418 lmax = (lmax[0] + lmax[1]) / 2. 1420 spec = self.subspec(lmin, lmax, unit=unit) -> 1421 data = spec._interp_data(spline) 1422 if unit is None: 1423 l = np.arange(self.shape, dtype=float)
AttributeError: 'numpy.float64' object has no attribute '_interp_data'
Note that gauss_fit implicitly assumes values in Angstroms by default, regardless of the spectrum units provided in .info(), and therefore the lmin and lmax could be provided with a wrong unit by the user.