I still like to leave this in from a teaching point of view - it's a good example of how to write a function and what they are good for. However, we should probably remark that the current astropy has this capability build-in
http://docs.astropy.org/en/latest/units/equivalencies.html#spectral-doppler-equivalencies