Spectral Imager¶
-
class
retrieval.instruments.spectral_imager.
MultiSensorImager
(wavel_nm, los, vertical=None, obs=None, mjd=None)¶ Class that holds multiple independent sensors. Useful for grouping multiple sensors into a single instrument, or multiple independent exposures into a single measurement
Parameters: wavel_nm :
a list of arrays, one for each sensors
los :
a list of nx3 arrays. Each list element contains the optical axis lines of sight for a sensor with n subexposures. Specificies in geodetic x,y,z coordinate.
vertical :
a list in the same format and size as los describing the vertical orientation of the sensor. If the sensor has more than one pixel, or the pixel line of sight is oversamples this should be set.
obs :
a list in the same format and size as los describing the observer position. This should be set if the instrument will be used to setup the radiative transfer model.
mjd :
a list in the same format and size as los describing the modified julian date of each line of sight. This should be set if the instrument will be used to setup the radiative transfer model.
Examples
- Ex. 1 Create an instrument with the following properties
- 2 sensors
- Each sensor has one line sight
- Each line of sight has 2 subexposures
- Each sensor measures 3 wavelengths
- Wavelengths and line of sight are not oversampled
>>> from retrieval import instruments as instrument >>> import numpy as np >>> wavel = [np.array([300,400,500]), np.array([450, 600, 800])] >>> los = [np.array([[0,1,0],[0,1,0]]), np.array([[1,0,0],[1,0,0]])] >>> inst = instrument.MultiSensorImager(wavel, los) >>> inst.initialize_sensors_and_optics()
Ex. 2 Create the same sensor, but oversample each wavelength 5 times
>>> from retrieval import instruments as instrument >>> import numpy as np >>> wavel = [np.array([300,400,500]), np.array([450, 600, 800])] >>> los = [np.array([[0,1,0],[0,1,0]]), np.array([[1,0,0],[1,0,0]])] >>> inst = instrument.MultiSensorImager(wavel, los) >>> inst.waveSamples = 5 >>> inst.psf_wavel_nm = np.array([100 200 1000]) >>> inst.psf = np.array([0.2 0.3 1.0]) >>> inst.initialize_sensors_and_optics()
Methods
initialize_sensors_and_optics : Setup the sensors and optics classes. This shoul be called after setup but before using the class to calculate radiances or convert level 1 data. convert_radiance_to_l1 : Takes in radiances calculated using an external radiadive transfer model and integrates over the wavelengths, lines of sight and exposures to produce a level one product. calculate_radiance : A function to calculate level one data using an internal radiative transfer model passed to instrument. This function is provided to simplify retrieval code. setup_radtran_model : Sets up the internal radiative transfer model with lines of sight specified by the instrument. get_meas_geometry : Returns the obs, los and mjd of each level one measurement produced by the instrument. This can be useful when using a high-res instrument to setup a low-res instrument in a retrieval. set_sensor_wavelengths : Set/change the wavelengths of one of the sensors. This is meant primarily as an internal function. radtran_wavelengths : Returns the oversampled wavelengths recommended for use in a radiative transfer calculation. The convert_radiance_to_l1 function expects radiances at these wavelengths. radtran_geometry : Returns the oversampled wavelengths recommended for use in a radiative transfer calculation. The convert_radiance_to_l1 function expects radiances at these geometries. -
calculate_radiance
()¶ Calculates the instrument measurement and weighting function.
-
convert_radiance_to_l1
(radiance)¶ Parameters: radiance : np.array
an nxm array where n is the number of lines of sight and m is the number of wavelenghts.
Returns: measurement : list[np.arrays]
a list of 2 dimensional arrays, one for each sensor. 2 dimensional arrays have dimensions of lines of sight x wavelengths.
-
define_mjd
(mjd)¶ Arranges the mjd into the proper format if none is given
-
define_vertical_axis
(vertical)¶ Arranges the vertical orientation into the proper format if none is given
-
get_meas_geometry
()¶ Provides the lines of sight and observer positions of the instrument measurements
Returns: pixel_los : np.array
list of pixel lines of sight in geographic coordinates
pixel_obs : np.array
list of pixel locations in geographic coordinates
-
radtran_geometry
()¶ Provides the high resolution geometries that the radiative transfer calculation should be done at.
Returns: line of sight : np.array
an array of lines of sight (nx3)
observer : np.array
an array of observer positions (nx3)
line of sight : np.array
an array of modified julian dates, one for each los/observer
-
radtran_wavelengths
()¶ Provides the high resolution wavelengths that the radiative transfer calculation should be done at.
Returns: wavelength : np.array
an array of high resolution wavelengths for the radiative transfer transfer calculation
-
set_sensor_wavelengths
(wavel_nm, sensor_number)¶ Sets the low resolution wavelengths of a sensor. Typically this is used only internally.
-
setup_instrument
()¶ Initializes the instrument geometry including spacial oversampling, this is typically called from
initialize_sensors_and_optics()
Creates the high resolution lines of sight and weighting factors for each pixel using the instrument optics
-
setup_radtran_model
(radtran)¶ Sets up the radiative transfer model lines of sight and wavelengths
Parameters: radtran : pointer to a radtran class
See
radtran
for details