@@ -0,0 +1,923 @@
+# Test Doppler shift%0A%0A# Astropy specutils uses the doopler factor to doppler shift.%0A# I want to test the diference between doppler factor and non-relativistic version.%0A%0Afrom __future__ import division, print_function%0Aimport numpy as np%0Afrom astropy import constants%0Afrom astropy import units as u%0A%0Ac = 299792458 * u.meter / u.second%0A%0Awavelength = np.arange(400, 5000) * u.nanometer%0A%0Arv = 500000 * u.meter / u.second%0A%0A%0Adef doppler_factor_shift(wave, velocity):%0A    %22%22%22 Doppler shift using doppler factor%22%22%22%0A    beta = velocity / constants.c%0A    doppler_factor = ((1 + beta)/(1-beta)) ** 0.5%0A    %0A    y = wave * doppler_factor%0A    return y%0A%0Adef doppler_shift(wave, velocity):%0A    %22%22%22 Doppler shift using non-realtivistically%22%22%22%0A    beta = velocity / constants.c%0A    y = wave * (1 + beta)%0A    return y%0A    %0Ashift_factor = doppler_factor_shift(wavelength, rv)%0Ashift = doppler_shift(wavelength, rv)%0A%0Aprint(shift - shift_factor)%0A

Test doppler factor