Trying to plot a spectrum, ie, velocity versus intensity, with lower x axis = velocity, on the upper twin axis = frequency
The relationship between them (doppler for
Your "linear function" is a "simple scaling law" (with an offset). Just replace the pm_to_kms definition with your function.
pm_to_kms