@@ -0,0 +1,624 @@
+%0Afrom astropy import units as u%0Aimport numpy as np%0A%0A%0Adef optical_to_radio(vel, freq, rest):%0A%0A    return freq * vel / rest%0A%0A%0Adef radio_to_optical(vel, freq, rest):%0A%0A    return rest * vel / freq%0A%0A%0Adef test_opt_to_rad():%0A%0A    opt_vel = -2126.1876453900204 * (u.km/u.s)%0A%0A    rad_vel = -2141.374699999949 * (u.km/u.s)%0A%0A    rest = 1.4 * u.GHz%0A%0A    freq = 1.41 * u.GHz%0A%0A    np.testing.assert_almost_equal(opt_vel.value,%0A                                   radio_to_optical(rad_vel, freq, rest).value)%0A%0A    np.testing.assert_almost_equal(rad_vel.value,%0A                                   optical_to_radio(opt_vel, freq, rest).value)%0A

Convert between optical and radio velocities.