pyrt.Column#
- class pyrt.Column(optical_depth, single_scattering_albedo, legendre_coefficients)[source]#
A data class to hold column information and interact with other column objects.
- Parameters:
optical_depth (ArrayLike) – 1-dimensional array of optical depths.
single_scattering_albedo (ArrayLike) – 1-dimensional array of single-scattering albedos. Must be the same shape as optical_depth.
legendre_coefficients (ArrayLike) – 2-dimensional array of Legendre coefficients. Axis 0 can have any length but axis 1 must have the same shape as optical_depth. These get divided by 2k + 1 to keep with DISORT’s convention.
Examples
Suppose you have some dust aerosols that you want to use in a 15-layer RT model. You can group these properties together in a Column object.
>>> import numpy as np >>> import pyrt >>> dust_optical_depth = np.linspace(0.1, 1, num=15) >>> dust_single_scattering_albedo = np.ones((15,)) * 0.7 >>> dust_legendre_coefficients = np.ones((128, 15)) >>> dust_column = Column(dust_optical_depth, dust_single_scattering_albedo, dust_legendre_coefficients)
You can access these via this object’s properties. The optical depth and single scattering albedo are unchanged, but the Legendre coefficients are divided by 2k + 1 to match what DISORT wants.
>>> dust_column.single_scattering_albedo array([0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7])
Suppose you also want to add some ice aerosols to your model. You can create a separate Column for these.
>>> ice_optical_depth = np.linspace(0, 0.5, num=15) >>> ice_single_scattering_albedo = np.ones((15,)) >>> ice_legendre_coefficients = np.ones((128, 15)) >>> ice_column = Column(ice_optical_depth, ice_single_scattering_albedo, ice_legendre_coefficients)
If these are all the aerosols that make up your model, you can add them to get a new Column that represents these properties for the combined atmosphere.
>>> total_column = dust_column + ice_column >>> total_column.optical_depth array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2, 1.3, 1.4, 1.5]) >>> total_column.single_scattering_albedo array([0.7 , 0.75357143, 0.77142857, 0.78035714, 0.78571429, 0.78928571, 0.79183673, 0.79375 , 0.7952381 , 0.79642857, 0.7974026 , 0.79821429, 0.7989011 , 0.7994898 , 0.8 ])
- __init__(optical_depth, single_scattering_albedo, legendre_coefficients)[source]#
- Parameters:
optical_depth (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
single_scattering_albedo (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
legendre_coefficients (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])
Methods
__init__(optical_depth, ...)Attributes
legendre_coefficientsoptical_depthsingle_scattering_albedo