constant_width¶
- pyrt.observation.constant_width(center_wavelength, width)[source]¶
Create an instance of Spectral assuming the wavelengths all have a constant spectral width.
- Parameters
center_wavelength (ArrayLike) – The center wavelength [microns] of each spectral bin.
width (float) – The width of each spectral bin.
- Raises
TypeError – Raised if any values in the input arrays are nonnumerical.
ValueError – Raised if the inputs contain values outside of 0.1 to 50 microns (I assume this is the valid range to do retrievals).
- Return type
Examples
Create an instance of Spectral for an observation taken at 1 to 3 microns in 1 micron increments, with each channel having a 50 nm spectral width.
>>> import numpy as np >>> from pyrt.observation import constant_width >>> center = [1, 2, 3] >>> width = 0.05 >>> constant_width(center, width) Spectral: low_wavenumber = [9756.09756098 4938.27160494 3305.78512397] high_wavenumber = [10256.41025641 5063.29113924 3361.34453782]