Skip to content

Commit

Permalink
Merge pull request #478 from desihub/same_speedoflight
Browse files Browse the repository at this point in the history
import speed of light from scipy
  • Loading branch information
geordie666 authored Mar 25, 2019
2 parents 030a07f + 86447fb commit f7df92e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion py/desitarget/QA.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
matplotlib.use('Agg')
import matplotlib.pyplot as plt # noqa: E402

try:
from scipy import constants
C_LIGHT = constants.c/1000.0
except TypeError: # This can happen during documentation builds.
C_LIGHT = 299792458.0/1000.0

# ADM set up the default logger from desiutil
log = get_logger()

Expand Down Expand Up @@ -1053,7 +1059,7 @@ def mock_qanz(cat, objtype, qadir='.', area=1.0, dndz=None, nobjscut=1000,
zmax = truez.max()*1.1

if 'STD' in objtype or 'MWS' in objtype or 'WD' in objtype:
truez *= 2.99e5 # [km/s]
truez *= C_LIGHT # [km/s]
zlabel = 'True Radial Velocity (km/s)'
else:
zlabel = r'True Redshift $z$'
Expand Down

0 comments on commit f7df92e

Please sign in to comment.