The determination of whether a star has a blueshift or a redshift is based on the observed shift in the wavelengths of the light emitted by the star. This phenomenon is known as the Doppler effect.
The Doppler effect describes how the observed wavelength of light changes depending on the relative motion between the source of light (in this case, the star) and the observer (e.g., an astronomer on Earth).
Blueshift: A blueshift occurs when the wavelengths of the light from a star appear shorter (shifted towards the blue end of the spectrum) compared to what is expected from a stationary source. This indicates that the star is moving towards the observer. The amount of blueshift is proportional to the speed of the star's motion.
Redshift: A redshift occurs when the wavelengths of the light from a star appear longer (shifted towards the red end of the spectrum) compared to what is expected from a stationary source. This indicates that the star is moving away from the observer. The amount of redshift is proportional to the speed of the star's motion.
To determine whether a star exhibits a blueshift or a redshift, astronomers analyze the spectrum of the star's light. They compare the observed positions of spectral lines (such as absorption or emission lines) with their known rest positions. If the observed lines are shifted towards shorter wavelengths (towards the blue end), it indicates a blueshift. Conversely, if the lines are shifted towards longer wavelengths (towards the red end), it indicates a redshift.
By analyzing the magnitude of the shift, astronomers can also estimate the velocity of the star along the line of sight (radial velocity). This information provides valuable insights into the motion and dynamics of stars, galaxies, and other celestial objects.