pyrt.rayleigh_legendre#
- pyrt.rayleigh_legendre(n_layers, n_wavelengths)[source]#
Make the generic Legendre decomposition of the Rayleigh scattering phase function.
- Parameters:
n_layers (int) – The number of layers to make the phase function for.
n_wavelengths (int) – The number of wavelengths to make
- Returns:
3-dimensional array of the Legendre decomposition of the phase function with a shape of
(3, n_layers, n_wavelengths).- Return type:
np.ndarray
Notes
Moment 0 is always 1 and moment 2 is always 0.5. The Rayleigh scattering phase function is given by
\[P(\theta) = \frac{3}{4} (1 + \cos^2(\theta)).\]Since \(P_0(x) = 1\) and \(P_2(x) = \frac{3x^2 - 1}{2}\), \(P(\mu) = P_0(\mu) + 0.5 P_2(\mu)\).
Examples
Make the Rayleigh scattering phase function for a model with 15 layers and 5 wavelengths.
>>> import pyrt >>> rayleigh_pf = pyrt.rayleigh_legendre(15, 5) >>> rayleigh_pf.shape (3, 15, 5)