From 19ecfa7cd3f1d78c2446b86ad5fab29d0179c060 Mon Sep 17 00:00:00 2001 From: Pey Lian Lim Date: Sat, 20 Aug 2016 09:20:28 -0400 Subject: [PATCH] Redshift is always done in photlam to avoid flux unit conversion inconsistency. --- pysynphot/spectrum.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pysynphot/spectrum.py b/pysynphot/spectrum.py index 7f31e49c..0de2dc87 100644 --- a/pysynphot/spectrum.py +++ b/pysynphot/spectrum.py @@ -655,7 +655,8 @@ def redshift(self, z): """Apply :ref:`redshift ` to the spectrum. Redshifted spectrum is never analytic even if the input - spectrum is. + spectrum is. Output units are always Angstrom and PHOTLAM + regardless of user units. Parameters ---------- @@ -671,7 +672,9 @@ def redshift(self, z): # By default, apply only the doppler shift. waveunits = self.waveunits + fluxunits = self.fluxunits self.convert('angstrom') + self.convert('photlam') newwave = self.wave*(1.0+z) copy = ArraySourceSpectrum(wave=newwave, flux=self.flux, @@ -680,6 +683,7 @@ def redshift(self, z): name="%s at z=%g" % (self.name, z)) self.convert(waveunits) + self.convert(fluxunits) return copy def setMagnitude(self, band, value):