def residuals(self): residuals = getattr(self, '_residuals', None) if residuals is None: residuals = Spectrum1D.from_array( self.spectrum.wavelength, self.best_fit_spectrum.flux - self.spectrum.flux) self._residuals = residuals return residuals
def residuals(self): residuals = getattr(self, '_residuals', None) if residuals is None: residuals = Spectrum1D.from_array(self.spectrum.wavelength, self.best_fit_spectrum.flux - self.spectrum.flux) self._residuals = residuals return residuals
def test_spectrum(): wave, flux = np.loadtxt(data_path('test_spec.txt'), unpack=True) return Spectrum1D.from_array(wave * u.angstrom, flux * u.erg / u.s / u.cm**2 / u.angstrom)