<p>If you have bins of equal log wavelength increment then a velocity shift corresponds directly to a pixel shift. That is the reason for binning in equal log wavelength increments.</p>

<p>See  <a href="https://astronomy.stackexchange.com/questions/14518/why-do-linear-velocity-redshifts-correspond-to-linear-pixel-shifts-when-the-spec?rq=1">this question</a> for a short proof. All you need to do is work out what each pixel corresponds to in terms of a velocity.
$$\Delta V  = c\, \Delta \log \lambda$$</p>

CC BY-SA 3.0
2016-06-17T16:53:14.567Z
Thanks I figured it out. The exact algorithm is: (1) take the natural log of your wavelength array in Angstroms, (2) add a velocity shift to your log-wavelength array via (c*logArray + velShift) / c, (3) convert your shifted log-wavelength array back to Angstroms by taking the exponential of it.
quantumflash
CC BY-SA 3.0
2016-06-17T12:57:07.937Z
2016-06-17T12:57:07.937Z
2017-04-13T12:59:06.910Z
ProfRob
<p>Suppose I have a wavelength array for a spectrum in units of Angstroms. Suppose further that the wavelength has "uniform logarithmic spacing" such that if I just take the difference in Angstroms between neighboring array elements i and i+1, this won't be the same as the difference in Angstroms between any other two neighboring elements j and j+1. However, if I first took the log10 of the wavelength array, then the difference between any two neighboring logarithmic array elements i and i+1 would be equal to the difference between any other logarithmic array elements j and j+1. </p>

<p>Now, I know a priori that this wavelength array has a velocity offset of X km/s, which I basically want to remove. How do I apply a velocity shift of -X km/s to this wavelength array which has uniform logarithmic spacing?</p>

<redshift><spectroscopy><observational-astronomy><velocity><wavelength>
How do I apply a velocity shift to a wavelength array with uniform logarithmic spacing?
quantumflash
# How do I apply a velocity shift to a wavelength array with uniform logarithmic spacing?

(Asked by: username_0 on 2016-06-16)

Suppose I have a wavelength array for a spectrum in units of Angstroms. Suppose further that the wavelength has "uniform logarithmic spacing" such that if I just take the difference in Angstroms between neighboring array elements i and i+1, this won't be the same as the difference in Angstroms between any other two neighboring elements j and j+1. However, if I first took the log10 of the wavelength array, then the difference between any two neighboring logarithmic array elements i and i+1 would be equal to the difference between any other logarithmic array elements j and j+1.

Now, I know a priori that this wavelength array has a velocity offset of X km/s, which I basically want to remove. How do I apply a velocity shift of -X km/s to this wavelength array which has uniform logarithmic spacing?

**Tags:** redshift, spectroscopy, observational-astronomy, velocity, wavelength

---

## 1 answers

### Answer by username_1 on 2016-06-17. Score: 4 | Accepted answer

If you have bins of equal log wavelength increment then a velocity shift corresponds directly to a pixel shift. That is the reason for binning in equal log wavelength increments.

See [this question](https://astronomy.stackexchange.com/questions/14518/why-do-linear-velocity-redshifts-correspond-to-linear-pixel-shifts-when-the-spec?rq=1) for a short proof. All you need to do is work out what each pixel corresponds to in terms of a velocity.
$$\Delta V = c\, \Delta \log \lambda$$

> **Comments:**
> **username_0**: Thanks I figured it out. The exact algorithm is: (1) take the natural log of your wavelength array in Angstroms, (2) add a velocity shift to your log-wavelength array via (c*logArray + velShift) / c, (3) convert your shifted log-wavelength array back to Angstroms by taking the exponential of it.  

---

