# redshift puzzle

I have the central line of the spectrum of an elliptical galaxy (NGC:4697) and a template K-star. I have calculated the redshift z by computing the crosscorrelation function between the galaxy and the template star(blue) and the auto-correlation function of the template (orange), the x-axis is velocity $$v \approx c*z$$. In nonrelativistic approximation: $$\Delta v \approx c*z$$ giving me $$z = 0.0041$$. The redshift also is: $$z = \frac{\Delta \lambda}{\lambda_{0}} = \frac{\Delta v}{c}$$. I want an expression for $$\Delta \lambda = z* \lambda_{0}$$ to be able to shift my galaxy spectrum to the restframe for a plot.The problem is which wavelength $$\lambda{0}$$ to use in this formula? I tried one case for taking $$\lambda_{0} = 518.364 nm$$ (one line of the Mg-triplet) and got almost matching peaks for galaxy(shifted to restframe) and template. How can I compute $$\Delta \lambda$$ in general without the need of a specific $$\lambda_0$$?

Plot before shifting

Edit: function for computing the redshift and wavelength shift

   def calc_redshift(vel_corr, corr_gal_tem):
"""calculate the galaxies redshift by looking at the shifted peaks from the correlation functions"""
c = 299792.458                              # speed of light in km/s
vel_rad = vel_corr[np.argmax(corr_gal_tem)] # velocity value of the peak from the ccf between galaxy and template
delta_loglam = np.log(1 + (vel_rad/c))      # shift in logarithmic wavelength
z = np.exp(delta_loglam)-1                  # redshift
return z, delta_loglam


But $$\Delta \lambda$$ does depend on $$\lambda_0$$. The wavelength redshift is not a uniform value.
In order to (correctly) do the redshift estimation by cross-correlation, your spectra should have been binned into bins of constant $$\Delta \log \lambda$$, such that the relation between bin number and wavelength is $$n = A \log \lambda + B$$ rather than $$n = A\lambda + B$$ (see section III of the canonical Tonry & Davis 1979).
• @trynerror The shift, $\Delta \lambda$ is not a constant. Redshift multiplies the wavelength by a fixed value. Commented Jun 15, 2022 at 9:36
• @trynerror you can't "shift" it by a uniform amount of you have adoped linear binning. You multiply each wavelength value by $1+z$. Commented Jun 15, 2022 at 11:01