Skip to content

Commit

Permalink
Redshift is always done in photlam to avoid flux unit conversion inco…
Browse files Browse the repository at this point in the history
…nsistency.
  • Loading branch information
pllim committed Aug 20, 2016
1 parent af705f9 commit 19ecfa7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pysynphot/spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@ def redshift(self, z):
"""Apply :ref:`redshift <pysynphot-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
----------
Expand All @@ -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,
Expand All @@ -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):
Expand Down

0 comments on commit 19ecfa7

Please sign in to comment.