lezargus.library.atmosphere module#

Atmospheric functions and other operations.

This file keeps track of all of the functions and computations which deal with the atmosphere. Note that seeing convolution and spectral convolution is in the lezargus.library.convolution module.

lezargus.library.atmosphere.absolute_atmospheric_refraction(wavelength: hint.NDArray, zenith_angle: float, temperature: float, pressure: float, water_pressure: float) hint.NDArray[source]#

Compute the absolute atmospheric refraction.

The absolute atmospheric refraction is not as useful as the relative atmospheric refraction function. To calculate how the atmosphere refracts one’s object, use that function: py:func:relative_atmospheric_refraction.

Parameters:
  • wavelength (ndarray) – The wavelength over which the absolute atmospheric refraction is being computed over, in meters.

  • zenith_angle (float) – The zenith angle of the sight line, in radians.

  • temperature (float) – The temperature of the atmosphere, in Kelvin.

  • pressure (float) – The pressure of the atmosphere, in Pascals.

  • water_pressure (float) – The partial pressure of water in the atmosphere, Pascals.

Returns:

absolute_refraction – The computed absolute refraction at the input wavelengths, in radians.

Return type:

ndarray

lezargus.library.atmosphere.absolute_atmospheric_refraction_function(wavelength: hint.NDArray, zenith_angle: float, temperature: float, pressure: float, water_pressure: float) hint.Callable[[hint.NDArray], hint.NDArray][source]#

Compute the absolute atmospheric refraction function.

The absolute atmospheric refraction is not as useful as the relative atmospheric refraction function. To calculate how the atmosphere refracts one’s object, use that function instead.

Parameters:
  • wavelength (ndarray) – The wavelength over which the absolute atmospheric refraction is being computed over, in meters.

  • zenith_angle (float) – The zenith angle of the sight line, in radians.

  • temperature (float) – The temperature of the atmosphere, in Kelvin.

  • pressure (float) – The pressure of the atmosphere, in Pascals.

  • water_pressure (float) – The partial pressure of water in the atmosphere, Pascals.

Returns:

refraction_function – The absolute atmospheric refraction function, as an actual callable function. The input is wavelength in meters and output is refraction in radians.

Return type:

Callable

lezargus.library.atmosphere.airmass(zenith_angle: float | hint.NDArray) float | hint.NDArray[source]#

Calculate the airmass from the zenith angle.

This function calculates the airmass provided a zenith angle. We use a hybrid plane-parallel model and Young et. al. 1989 model to cover higher zenith angles. See [[TODO]] for more information.

Parameters:

zenith_angle (float or ndarray) – The zenith angle, in radians.

Returns:

airmass_value – The airmass. The variable name is to avoid name conflicts.

Return type:

float or ndarray

lezargus.library.atmosphere.index_of_refraction_dry_air(wavelength: hint.NDArray, pressure: float, temperature: float) hint.NDArray[source]#

Calculate the refraction of air of pressured warm dry air.

The index of refraction depends on wavelength, pressure and temperature, we use the updated Edlén equations; see [[TODO]].

Parameters:
  • wavelength (ndarray) – The wavelength that we are calculating the index of refraction over. This must in meters.

  • pressure (float) – The pressure of the atmosphere, in Pascals.

  • temperature (float) – The temperature of the atmosphere, in Kelvin.

Returns:

ior_dry_air – The dry air index of refraction.

Return type:

ndarray

lezargus.library.atmosphere.index_of_refraction_ideal_air(wavelength: hint.NDArray) hint.NDArray[source]#

Calculate the ideal refraction of air over wavelength.

The index of refraction of air depends slightly on wavelength, we use the updated Edlen equations; see [[TODO]].

Parameters:

wavelength (ndarray) – The wavelength that we are calculating the index of refraction over. This must in meters.

Returns:

ior_ideal_air – The ideal air index of refraction.

Return type:

ndarray

lezargus.library.atmosphere.index_of_refraction_moist_air(wavelength: hint.NDArray, temperature: float, pressure: float, water_pressure: float) hint.NDArray[source]#

Calculate the refraction of air of pressured warm moist air.

The index of refraction depends on wavelength, pressure, temperature, and humidity, we use the updated Edlen equations ; see [[TODO]]. We use the partial pressure of water in the atmosphere as opposed to actual humidity.

Parameters:
  • wavelength (ndarray) – The wavelength that we are calculating the index of refraction over. This must in meters.

  • temperature (float) – The temperature of the atmosphere, in Kelvin.

  • pressure (float) – The pressure of the atmosphere, in Pascals.

  • water_pressure (float) – The partial pressure of water in the atmosphere, Pascals.

Returns:

ior_moist_air – The moist air index of refraction.

Return type:

ndarray

lezargus.library.atmosphere.relative_atmospheric_refraction(wavelength: hint.NDArray, reference_wavelength: float, zenith_angle: float, temperature: float, pressure: float, water_pressure: float) hint.NDArray[source]#

Compute the relative atmospheric refraction.

The relative atmospheric refraction is computed similarly to the absolute refraction, but is measured relative to the absolute refraction at the reference wavelength.

Parameters:
  • wavelength (ndarray) – The wavelength over which the absolute atmospheric refraction is being computed over, in meters.

  • reference_wavelength (float) – The reference wavelength which the relative refraction is computed against, in meters.

  • zenith_angle (float) – The zenith angle of the sight line, in radians.

  • temperature (float) – The temperature of the atmosphere, in Kelvin.

  • pressure (float) – The pressure of the atmosphere, in Pascals.

  • water_pressure (float) – The partial pressure of water in the atmosphere, Pascals.

Returns:

relative_refraction – The computed relative refraction at the input wavelengths, in radians.

Return type:

ndarray

lezargus.library.atmosphere.relative_atmospheric_refraction_function(wavelength: hint.NDArray, reference_wavelength: float, zenith_angle: float, temperature: float, pressure: float, water_pressure: float) hint.Callable[[hint.NDArray], hint.NDArray][source]#

Compute the relative atmospheric refraction function.

The relative refraction function is the same as the absolute refraction function, however, it is all relative to some specific wavelength.

Parameters:
  • wavelength (ndarray) – The wavelength over which the absolute atmospheric refraction is being computed over, in meters.

  • reference_wavelength (float) – The reference wavelength which the relative refraction is computed against, in meters.

  • zenith_angle (float) – The zenith angle of the sight line, in radians.

  • temperature (float) – The temperature of the atmosphere, in Kelvin.

  • pressure (float) – The pressure of the atmosphere, in Pascals.

  • water_pressure (float) – The partial pressure of water in the atmosphere, Pascals.

Returns:

refraction_function – The relative atmospheric refraction function, as an actual callable function. The input is wavelength in meters and output is refraction in radians.

Return type:

Callable

lezargus.library.atmosphere.seeing(wavelength: hint.NDArray, zenith_angle: float, reference_seeing: float, reference_wavelength: float, reference_zenith_angle: float = 0) hint.NDArray[source]#

Compute seeing as a function of wavelength.

The seeing, as a function of wavelength, is computed from wavelength and airmass ratios from some provided base reference seeing value. See [[TODO]] for more information.

Parameters:
  • wavelength (ndarray) – The wavelengths that we are calculating the seeing at, typically in meters.

  • zenith_angle (float) – The zenith angle where we are calculating the seeing from, in radians.

  • reference_seeing (float) – The provided reference seeing at the reference_wavelength and the reference_zenith_angle, in radians.

  • reference_wavelength (float) – The reference wavelength where the reference seeing measurement reference_seeing is taken at. Must be in the same units as the wavelength parameter, typically meters.

  • reference_zenith_angle (float, default = 0) – The reference zenith angle where the reference seeing measurement reference_seeing is taken at, in radians.

Returns:

seeing_ – The seeing values as a function of wavelength, in the same units as the provided reference_seeing.

Return type:

ndarray