utils.astro
Air/vacuum wavelength conversion and relativistic Doppler/redshift helpers.
- kpfpipe.utils.astro.air_to_vac(wave_air)
Convert air wavelengths to vacuum via the Edlén 1953 formula (two iterations; only wavelengths > 2000 Å are modified).
Not yet wired into a pipeline module: retained for the forthcoming vacuum-wavelength work and used as a test oracle for wavelength-calibration output.
- Parameters:
wave_air (array-like) – Wavelengths [Å, air].
- Returns:
Wavelengths [Å, vacuum].
- Return type:
ndarray
- kpfpipe.utils.astro.compute_doppler_factor(v)
Relativistic Doppler factor
f = lambda_obs / lambda_restfor a source with radial velocity v.Standard astronomical convention: a receding source (
v > 0) is redshifted, sof > 1. The factor relates to the redshift byf = 1 + z.- Parameters:
v (astropy.units.Quantity) – Radial velocity [km/s] (any velocity unit accepted); positive = receding. Passing a bare (unitless) value raises, so units stay explicit.
- Returns:
Dimensionless Doppler factor
lambda_obs / lambda_rest.- Return type:
float or ndarray
- kpfpipe.utils.astro.compute_redshift(v)
Relativistic redshift
z = lambda_obs / lambda_rest - 1for a source with radial velocity v. A receding source (v > 0) givesz > 0; computed ascompute_doppler_factor(v) - 1.- Parameters:
v (astropy.units.Quantity) – Radial velocity [km/s] (any velocity unit accepted); positive = receding. Passing a bare (unitless) value raises, so units stay explicit.
- Returns:
Dimensionless redshift.
- Return type:
float or ndarray