sheap.Utils.BasicFunctions module

Basic Functions

This module provides core physical conversions frequently used in spectral analysis, including wavelength ↔ velocity conversions and vacuum ↔ air wavelength corrections.

Functions

kms_to_wl(kms, line_center, C_KMS=DEFAULT_DEFAULT_C_KMS)

Convert velocity in km/s to a wavelength shift at a given line center.

wl_to_kms(wl, line_center, C_KMS=DEFAULT_DEFAULT_C_KMS)

Convert wavelength shift to velocity in km/s at a given line center.

vac_to_air(lam_vac)

Convert vacuum wavelengths to air wavelengths using the IAU standard.

kms_to_wl(kms, line_center, C_KMS=299792.458)[source]

Convert a velocity in km/s to a wavelength shift based on the line center.

Parameters:

kmsfloat or array-like

The velocity value(s) in kilometers per second.

line_centerfloat

The central (reference) wavelength of the spectral line.

C_KMSfloat, optional

The speed of light in km/s. The default value is 2.99792458e5 km/s.

Returns:

wlfloat or array-like

The calculated wavelength shift corresponding to the input velocity.

vac_to_air(lam_vac)[source]

Convert vacuum to air wavelengths

:param lam_vac - Wavelength in Angstroms :return: lam_air - Wavelength in Angstroms

wl_to_kms(wl, line_center, C_KMS=299792.458)[source]

Convert a velocity in km/s to a wavelength shift based on the line center.

Parameters:

wlfloat or array-like

The calculated wavelength shift corresponding to the input velocity.

line_centerfloat

The central (reference) wavelength of the spectral line.

C_KMSfloat, optional

The speed of light in km/s. The default value is 2.99792458e5 km/s.

Returns:

kmsfloat or array-like

The velocity value(s) in kilometers per second.