lezargus.library.container.atmosphere module#

Container classes to hold both atmospheric transmission and radiance.

We define small wrappers to hold atmospheric transmission and radiance data so that it can be used more easily. The data itself usually has been derived from PSG. These container classes are just intuitive wrappers around interpolation.

class lezargus.library.container.atmosphere.AtmosphereSpectrumGenerator(wavelength: hint.NDArray, zenith_angle: hint.NDArray, pwv: hint.NDArray, data: hint.NDArray, wavelength_unit: hint.Unit | str = 'm', data_unit: hint.Unit | str = '', spectral_scale: float | None = None)[source]#

Bases: object

Atmospheric spectrum generator/interpolator.

This class generates, via interpolation of a pre-computed grid. Typically this is used for atmospheric transmission and radiance spectrum, but, others may be used as well.

wavelength#

The wavelength axis of the grid data we are interpolating over.

Type:

ndarray

zenith_angle#

The zenith angle axis of the grid data we are interpolating over. The actual interpolation uses airmass instead of zenith angle.

Type:

ndarray

airmass#

The calculated airmass axis of the grid data we are interpolating over.

Type:

ndarray

pwv#

The precipitable water vapor axis of the grid data we are interpolating over.

Type:

ndarray

data#

The data grid, usually transmission or radiance. The axes are defined by the other attributes.

Type:

ndarray

wavelength_unit#

The wavelength unit of the wavelength array provided, if provided.

Type:

Unit

data_unit#

The data unit of the data provided, if provided.

Type:

Unit

spectral_scale#

The spectral resolution (scale) of the computed grid, if provided.

Type:

float

_data_interpolator#

The interpolator class for the data which we use as the backbone of this generator. This should not be called directly.

Type:

RegularNDInterpolator

__init__(wavelength: hint.NDArray, zenith_angle: hint.NDArray, pwv: hint.NDArray, data: hint.NDArray, wavelength_unit: hint.Unit | str = 'm', data_unit: hint.Unit | str = '', spectral_scale: float | None = None) None[source]#

Initialize the atmospheric transmission and radiance container.

Parameters:
  • wavelength (ndarray) – The wavelength axis of the grid data that defines the transmission and radiance data.

  • zenith_angle (ndarray) – The zenith angle axis of the grid data that defines the transmission and radiance data, in radians.

  • pwv (ndarray) – The precipitable water vapor axis of the grid data that defines the transmission and radiance data, in millimeters.

  • data (ndarray) – The atmospheric data for the generator to “generate” via interpolation. The shape of the data should match that created by the domain of the previous attributes.

  • wavelength_unit (Unit or str, default = "m") – The wavelength unit of the wavelength provided. By default and by convention, this should be in meters.

  • data_unit (Unit or str) – The data unit of the data provided. By default, we assume a dimensionless spectrum.

  • spectral_scale (float, default = 0) – The spectral (scale) resolution of the simulation.

interpolate(wavelength: hint.NDArray | None = None, zenith_angle: float = 0, pwv: float = 0.005) hint.NDArray[source]#

Generate atmospheric spectrum, through interpolation.

Parameters:
  • wavelength (ndarray, default = None) – The wavelengths to compute the spectrum at. If None, we default to the wavelength basis used to generate this class.

  • zenith_angle (float, default = 0) – The zenith angle for the transmission spectrum generation, in radians.

  • pwv (float, default = 0.005) – The precipitable water vapor for the transmission spectrum generation, in meters.

Returns:

generated_data – The generated/interpolated data sampled at the provided wavelengths.

Return type:

ndarray

interpolate_spectrum(wavelength: hint.NDArray | None = None, zenith_angle: float = 0, pwv: float = 0.005) hint.LezargusSpectrum[source]#

Generate a atmospheric LezargusSpectrum, through interpolation.

This function really is a wrapper around the usual interpolator, repackaging the results as a LezargusSpectrum. Note, most of the meta data parameters are wrong and need to be fixed manually.

Parameters:
  • wavelength (ndarray, default = None) – The wavelengths to compute the spectrum at. If None, we default to the wavelength basis used to generate this class.

  • zenith_angle (float, default = 0) – The zenith angle for the transmission spectrum generation, in radians.

  • pwv (float, default = 0.005) – The precipitable water vapor for the transmission spectrum generation, in meters.

Returns:

generated_spectrum – The generated/interpolated data sampled at the provided wavelengths. This is packaged as a LezargusSpectrum.

Return type:

LezargusSpectrum