Retrievals

Extinction Retrieval

class ExtinctionRetrieval(sensors: List[ALISensorDualChannel], optical_geometry: List[OpticalGeometry], measurement_l1: List[RadianceSpectralImage], output_filename: str | None = None)[source]

Perform an aerosol extinction retrieval (varying number density with an assumed lognormal size distribution).

This class is a wrapper around the MeasurementVector, StateVector, InstrumentSimulator and Rodgers’ classes to help setup and retrieve aerosol extinction.

Parameters:
  • sensors (List[ALISensorDualChannel]) – List of ALI sensors

  • optical_geometry (List[OpticalGeometry]) – List of optical geometries. Should be the same length as sensors.

  • measurement_l1 (List[RadianceSpectralImage]) – Measured data. Should be in the same format that ImagingSimulator will produce given the sensors and optical_geometry

  • output_filename (str) – Name of the output netcdf4 file that retrieval diagnostics and results are written to. If none is provided then nothing is written to file.

max_iterations

maximum number of iterations that the Rodgers retrieval will perform.

Type:

int

vertical_samples

Number of vertical samples in the simulated radiative transfer. Larger values will provide higher accuracy calculations at the expense of computation time.

Type:

int

brdf

Equivalent Lambertian reflectance used in the forward model.

Type:

float

use_cloud_for_lower_bound

Whether to set the lower bound of the retrieval based on the detected cloud top altitude.

Type:

bool

dual_polarization

Compute both polarizations for each sensor passed to the retrieval.

Type:

bool

tikhonov_factor

Factor used to the scale the second order Tikhonov regularization as a function of altitude. Should be an array the same size as tikhonov_altitude.

Type:

np.ndarray

tikhonov_altitude

Altitudes [meters] corresponding to tikhonov_factor.

Type:

np.ndarray

couple_normalization_altitudes

Include the coupling from altitude normalization in the jacobian calculation.

Type:

bool

simulation_atmosphere

If set, this atmosphere will be included in the output file.

Type:

sk.Atmosphere

sun

3 element array defining the sun location. If unset this is calculated by sasktran using the time.

Type:

np.ndarray

cloud_vector_normalization_range

Normalization altitudes used for the cloud top detection algorithm.

Type:

Tuple[float, float]

property aerosol_measurement_vector: MeasurementVector

Measurement vector used for aerosol retrieval

\[I = I_{\parallel} + I_{\perp}\]
\[y = \log(I) - \log(I_{norm})\]
aerosol_state_element()[source]

Aerosol number density state vector element.

property aerosol_vector_wavelength: List[float]

Wavelengths used for the aerosol measurement vectors. A measurement vector is constructed for each wavelength.

property altitude_resolution: float

Vertical resolution of the retrieval [meters]

property altitudes

Profile altitudes [meters] used for Jacobians

property apriori_latitude: float

Latitude used for the a priori profile selection

property apriori_longitude: float

Longitude used for the a priori profile selection

property apriori_mjd: float

Date in modified julian format used for the a priori profile selection

apriori_profile()[source]

A priori number density profile used in the retrieval

property cloud_measurement_vector: MeasurementVector

Measurement vector used for cloud top retrieval.

\[y = \frac{Q}{I}\]
Returns:

cloud_mv – Cloud measurement vector

Return type:

MeasurementVector

find_cloud_top_altitude() float[source]

Find the cloud top altitude by looking for a change in the polarization ratio (Q/I).

Returns:

cloud_top – Cloud top altitude [meters]

Return type:

float

forward_model(retrieval)[source]

Generate the forward model used in the retrieval

generate_retrieval_atmosphere() Atmosphere[source]

Create the base atmosphere used in the retrieval. State Elements (e.g. ‘aerosol’) must still be added using the elements add_to_atmosphere method.

property latitude: float

Mean latitude of the observer tangent point locations

property longitude: float

Mean longitude of the observer tangent point locations

property lower_bound: float

Minimum altitude of the retrieval [meters]. Altitudes below this will use a scaled value of the apriori.

property mjd: float

Mean date of the observer tangent point locations in modified julian date (days since Nov 17, 1858)

property normalization_altitudes: Tuple[float, float]

Normalization range used for the measurement vector [meters].

static plot_results(output_filename, extinction_wavelength: float = 750.0, log_state: bool = True, plot_error: bool = True, plot_meas_vec: bool = True, plot_averaging_kernel: bool = True, aerosol_scale: int | float = 1000, plot_cloud: bool = True, kernel_kwargs: Dict = {})[source]

Plot the retrieved extinction and measurement vectors.

Parameters:
  • output_filename – Retrieval output filename.

  • extinction_wavelength – Wavelength in nanometers to plot extinction at. Default = 750.0 nm.

  • log_state – Whether the statevector is in log space. Default True.

  • plot_error – Whether to plot the error bars on the retrieved parameters.

  • plot_meas_vec – Whether to plot the measurement vectors. Default True

  • plot_cloud – Whether to plot the cloud profile, if available. Default True

  • plot_averaging_kernel – Whether to plot the averaging kernel. Default True

  • aerosol_scale – Scale the aerosol values before plotting. Default 1000.

  • kernel_kwargs – Optional arguments provided to the plot_averaging_kernel. Has no effect if plot_averaging_kernel=False

Returns:

  • fig (plt.Figure) – Figure used for plotting

  • ax (plt.Axes or array of plt.Axes) – Axes used for plotting

retrieval_sensors() List[ALISensorDualChannel][source]

ALI sensor models used for the retrieval.

retrieve()[source]

Perform the aerosol extinction retrieval.

tanalts_from_mv(measurement_vector: MeasurementVector, level1: List[RadianceSpectralImage]) Tuple[ndarray, ndarray][source]

Calculate the tangent altitudes of the measurement vector elements.

Parameters:
  • measurement_vector (MeasurementVector) –

  • level1 (List[RadianceSpectralImage]) –

Returns:

  • tangent_altitude (np.ndarray) – Tangent altitudes of the measurement vector elements

  • indexes (np.ndarray) – Index of the measurement vector elements

property time: datetime64

Mean time of the observer tangent point locations.

property upper_bound: float

Maximum altitude of the retrieval [meters]. Altitudes above this will use a scaled value of the apriori.

Particle Size Retrieval

class LognormalRadiusRetrieval(*args)[source]

Retrieves the lognormal number density and median radius assuming a fixed distribution width.

property particle_size_measurement_vector: MeasurementVector

Measurement vector used for the particle size retrieval.

static plot_results(output_filename, extinction_wavelength: float = 750.0, log_state: bool = True, plot_error: bool = True, plot_meas_vec: bool = True, plot_averaging_kernel: bool = True, plot_effective_radius: bool = True, aerosol_scale: int | float = 1000, plot_cloud: bool = True, kernel_kwargs: Dict = {}, figsize=(5, 6))[source]

Plot the retrieved extinction and measurement vectors.

Parameters:
  • output_filename – Retrieval output filename.

  • extinction_wavelength – Wavelength in nanometers to plot extinction at. Default = 750.0 nm.

  • log_state – Whether the statevector is in log space. Default True.

  • plot_error – Whether to plot the error bars on the retrieved parameters.

  • plot_meas_vec – Whether to plot the measurement vectors. Default True

  • plot_cloud – Whether to plot the cloud profile, if available. Default True

  • plot_averaging_kernel – Whether to plot the averaging kernel. Default True

  • aerosol_scale – Scale the aerosol values before plotting. Default 1000.

  • kernel_kwargs – Optional arguments provided to the plot_averaging_kernel. Has no effect if plot_averaging_kernel=False

Returns:

  • fig (plt.Figure) – Figure used for plotting

  • ax (plt.Axes or array of plt.Axes) – Axes used for plotting

retrieve()[source]

Perform the aerosol extinction retrieval.