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_function(wavelength: ndarray, zenith_angle: float, temperature: float, pressure: float, water_pressure: float) Callable[[ndarray], 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:

abs_atm_refr_func – 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 | ndarray) float | ndarray[source]#

Calculate the airmass from the zenith angle.

This function calculates the airmass provided a zenith angle. For most cases the plane-parallel atmosphere method works, and it is what this function uses. However, we also use a more accurate formula for airmass at higher zenith angles (>80 degree), namely from DOI:10.1364/AO.28.004735. We use a weighted average between 75 < z < 80 degrees to allow for a smooth transition.

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: ndarray, pressure: float, temperature: float) 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 found in DOI: 10.1088/0026-1394/30/3/004.

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: ndarray) 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 found in DOI: 10.1088/0026-1394/30/3/004.

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: ndarray, temperature: float, pressure: float, water_pressure: float) 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 found in DOI: 10.1088/0026-1394/30/3/004. 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_function(wavelength: ndarray, reference_wavelength: float, zenith_angle: float, temperature: float, pressure: float, water_pressure: float) Callable[[ndarray], 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:

rel_atm_refr_func – 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