Skip to content

Commit

Permalink
Merge pull request #15 from pllim/fix-redshift
Browse files Browse the repository at this point in the history
Redshift is now always done in photlam
  • Loading branch information
pllim committed Aug 20, 2016
2 parents af705f9 + 19ecfa7 commit 482dacb
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 482dacb

Please sign in to comment.