From 42e5ab9faef327fd3190795de8c559a055e932b7 Mon Sep 17 00:00:00 2001 From: Jarron Leisenring Date: Thu, 5 Sep 2024 12:52:33 -0700 Subject: [PATCH] Update spectra.py --- webbpsf_ext/spectra.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webbpsf_ext/spectra.py b/webbpsf_ext/spectra.py index 878810a..378a51f 100644 --- a/webbpsf_ext/spectra.py +++ b/webbpsf_ext/spectra.py @@ -1178,7 +1178,7 @@ def model_IRexcess(self, x, sp=None): bb_flux = x[0] * self.bb_jy(wave/1e4, x[1]) * (wave/1e4)**x[2] / 1e17 sp_bb = s_ext.ArraySpectrum(wave, bb_flux, fluxunits='Jy') - sp_bb.convert('photlam') + sp_bb.convert(sp.fluxunits) return sp + sp_bb @@ -1222,7 +1222,7 @@ def func_resid(self, x, IR_excess=False, wlim=[0.1, 30], use_err=True): mod_interp = np.interp(wvals, sp_star.wave, sp_model.flux) # Normalize values so the residuals aren't super small/large - norm = np.mean(yvals) + norm = np.nanmedian(yvals) resid = (mod_interp - yvals) if use_err: resid /= evals