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_rest for a source with radial velocity v.

Standard astronomical convention: a receding source (v > 0) is redshifted, so f > 1. The factor relates to the redshift by f = 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 - 1 for a source with radial velocity v. A receding source (v > 0) gives z > 0; computed as compute_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