Aerosol

The aerosol module contains structures to make the aerosol properties required by DISORT.

class pyrt.aerosol.Conrath(altitude, q0, scale_height, nu)[source]

A structure to compute a Conrath profile(s).

Conrath creates Conrath profile(s) on an input grid of altitudes given a volumetric mixing ratio and Conrath parameters.

Parameters
  • altitude (numpy.ndarray) – The altitude [km] at which to construct a Conrath profile.

  • q0 (numpy.ndarray) – The surface mixing ratio for each of the Conrath profiles.

  • scale_height (numpy.ndarray) – The scale height [km] of each of the Conrath profiles.

  • nu (numpy.ndarray) – The nu parameter of each of the Conrath profiles.

Raises
  • TypeError – Raised if any of the inputs are not a numpy.ndarray.

  • ValueError – Raised if many things…

Return type

None

Notes

The Conrath profile is defined as

\[q(z) = q_0 * e^{\nu(1 - e^{z/H})}\]

where \(q\) is a volumetric mixing ratio, \(z\) is the altitude, \(\nu\) is the Conrath nu parameter, and \(H\) is the scale height.

For an MxN array of pixels, q0, scale_height, and nu should be of shape MxN. altitude should have shape ZxMxN, where Z is the number of altitudes. Additionally, the units of altitude and scale_height should be the same.

property profile: numpy.ndarray

Get the Conrath profile(s). This will have the same shape as altitude.

class pyrt.aerosol.ForwardScattering(scattering_cross_section, extinction_cross_section, particle_size_grid, wavelength_grid, particle_size, wavelength, reference_wavelength, asymmetry_parameter=None)[source]

A structure to store forward scattering properties.

ForwardScattering will simply hang on to forward scattering properties and provides methods to regrid them into the input particle size profile and wavelengths.

Parameters
  • scattering_cross_section (numpy.ndarray) – 2D array of the scattering cross section (the 0th axis is assumed to be the particle size axis, while the 1st axis is assumed to be the wavelength axis).

  • extinction_cross_section (numpy.ndarray) – 2D array of the extinction cross section with same dims as above.

  • particle_size_grid (numpy.ndarray) – 1D array of particle sizes over which the above properties are defined.

  • wavelength_grid (numpy.ndarray) – 1D array of wavelengths over which the above properties are defined.

  • particle_size (numpy.ndarray) – 1D array of particle sizes to regrid the properties onto.

  • wavelength (numpy.ndarray) – 1D array of wavelengths to regrid the properties onto.

  • asymmetry_parameter (numpy.ndarray) – 2D array of the Henyey-Greenstein asymmetry parameter with the same dims as the scattering and extinction cross sections. This is optional.

  • reference_wavelength (float) –

Return type

None

property asymmetry_parameter: numpy.ndarray

Get the asymmetry parameter on the new grid.

property extinction: numpy.ndarray

Get the extinction coefficient at the reference wavelength on the new grid.

property extinction_cross_section: numpy.ndarray

Get the extinction cross section on the new grid.

make_linear_properties()[source]

Make the forward scattering properties at the input particle sizes and wavelengths by linearly interpolating them onto the input grid.

Warning

Due to a known bug, this does not work!

Return type

None

make_nn_properties()[source]

Make the forward scattering properties at the nearest neighbor particle sizes and wavelengths.

Return type

None

property scattering_cross_section: numpy.ndarray

Get the scattering cross section on the new grid.

property single_scattering_albedo: numpy.ndarray

Get the single scattering albedo on the new grid.

class pyrt.aerosol.HenyeyGreenstein(asymmetry)[source]

Hold the HenyeyGreenstein asymmetry parameters.

HenyeyGreenstein holds the asymmetry parameters and ensures they’re valid. It provides a method to convert these to Legendre polynomials.

Parameters

asymmetry (numpy.ndarray) – The asymmetry parameter.

Raises

ValueError – Raised if the asymmetry parameter is not between -1 and 1.

Return type

None

Notes

The Henyey-Greenstein phase function is defined as follows

\[p(\theta) = \frac{1}{4\pi} \frac{1 - g^2}{[1 + g^2 -2g \cos(\theta)]^{3/2}}\]
legendre_decomposition(n_moments)[source]

Get the Legendre decomposition of the asymmetry parameters up to a given number of moments.

Parameters

n_moments (int) – The maximum number of moments to get the coefficients for (not including the 0th moment).

Return type

numpy.ndarray

Notes

The Legendre decomposition is actually quite simple. The phase function can be decomposed as follows

\[p(\mu) = \sum_{n=0}^{\infty} (2n + 1)g^n P_n(\mu)\]

where \(n\) is the moment number, \(g\) is the asymmetry parameter, and \(P_n(\mu)\) is the \(n\)th Legendre polynomial. I’m not a mathematician so if \(g=0\) I still assume the 0 th coefficient is 1.

class pyrt.aerosol.OpticalDepth(mixing_ratio_profile, column_density_layers, extinction, column_integrated_optical_depth)[source]

A structure to compute the optical depth given profiles.

OpticalDepth accepts a mixing ratio profile and atmospheric column density profile to compute the optical depth at each wavelength. It also accepts an extinction profile to scale the optical depth to a reference wavelength, and ensures that the sum over the layers is equal to the total column integrated optical depth.

Parameters
  • mixing_ratio_profile (numpy.ndarray) – 1D array of mixing ratio.

  • column_density_layers (numpy.ndarray) – 1D array of the column density in the layers.

  • extinction (numpy.ndarray) – 2D array of extinction coefficients.

  • column_integrated_optical_depth (float) – The total column integrated optical depth.

Return type

None

property total: numpy.ndarray

Get the total optical depth in each of the layers.

class pyrt.aerosol.TabularLegendreCoefficients(coefficients, particle_size_grid, wavelength_grid, particle_size_profile, wavelengths, max_moments=None)[source]

Create a grid of Legendre coefficients (particle size, wavelength).

TabularLegendreCoefficients accepts a 3D array of Legendre polynomial coefficients of the phase function that depend on particle size and wavelength and casts them to an array of the proper shape for use in DISORT given a vertical particle size gradient.

Parameters
  • coefficients (numpy.ndarray) – 3D array of Legendre coefficients that depend on particle size and wavelength. It is assumed to have shape [n_moments, particle_size_grid, wavelength_grid]

  • particle_size_grid (numpy.ndarray) – 1D array of particle sizes associated with the coefficients matrix.

  • wavelength_grid (numpy.ndarray) – 1D array of wavelengths associated with the coefficients matrix.

  • wavelengths (numpy.ndarray) – ND array of wavelengths where to cast coefficients to.

  • particle_size_profile (numpy.ndarray) – 1D array of particle sizes.

  • max_moments (int) – The maximum number of coefficients to use in the array. If None, all available coefficients are used.

Return type

None

make_linear_phase_function()[source]

Make the phase function by linearly interpolating between the input grid of particle sizes and wavelengths.

Return type

None

make_nn_phase_function()[source]

Make the phase function at the nearest neighbor particle sizes and wavelengths.

Return type

None

property phase_function: numpy.ndarray

Get the Legendre coefficients cast to the proper grid.

class pyrt.aerosol.Uniform(altitude, bottom, top)[source]

A structure to create a uniform profile(s).

Uniform creates uniform volumetric mixing ratio profile(s) on an input grid of altitudes given a set of top and bottom altitudes.

Parameters
  • altitude (numpy.ndarray) – The altitude boundaries at which to construct uniform profile(s). These are assumed to be decreasing to keep with DISORT’s convention.

  • bottom (numpy.ndarray) – The bottom altitudes of each of the profiles.

  • top (numpy.ndarray) – The top altitudes of each of the profiles.

Raises
  • TypeError – Raised if any inputs are not a numpy.ndarray.

  • ValueError – Raised if a number of things…

Return type

None

property profile: numpy.ndarray

Get the uniform profile(s). This will have the same shape as altitude.