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$.enter image description here 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 enter image description here

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

1 Answer 1


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).

When binned in this way then you can apply a uniform velocity shift/redshift to all the pixels.

See How do I apply a velocity shift to a wavelength array with uniform logarithmic spacing? and Why do linear velocity redshifts correspond to linear pixel shifts when the spectra are binned in constant log wavelength?

  • $\begingroup$ First I am not quite sure if I really understand why the redshift is not the same over all the spectrum. The cosmological redshift due to expansion should act uniform on all wavelength areas right? $\endgroup$
    – trynerror
    Jun 15, 2022 at 8:32
  • $\begingroup$ Second, I have added the function that computes the redshift to my question. The redshift I get agrees with observations. But if I want to shift my wavelength array to the restframe using: loglam_gal - delta_loglam. The peeks of the spectral lines of galaxy and template not match up. The delta_loglam I receive from my function seems to be to small. Can you spot any mistake ? $\endgroup$
    – trynerror
    Jun 15, 2022 at 8:36
  • 1
    $\begingroup$ @trynerror The shift, $\Delta \lambda$ is not a constant. Redshift multiplies the wavelength by a fixed value. $\endgroup$
    – ProfRob
    Jun 15, 2022 at 9:36
  • $\begingroup$ I guess my question for the application is then, how do I shift my galaxywavelengtharray to the rest frame so that for example the peaks of the MG-triplet match up with the peaks of my template star. $\endgroup$
    – trynerror
    Jun 15, 2022 at 10:46
  • $\begingroup$ @trynerror you can't "shift" it by a uniform amount of you have adoped linear binning. You multiply each wavelength value by $1+z$. $\endgroup$
    – ProfRob
    Jun 15, 2022 at 11:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .