Distributions¶
Size distribution classes and pre-built aerosol climatology collections.
Distribution classes¶
Lognorm ¶
Bases: BaseDistribution
Lognormal size distribution.
An instance of Lognorm contains a construction of a lognormal distribution
and the utilities necessary for computing statistical functions associated
with that distribution. The parameters of the constructor are invariant with respect
to what length and concentration unit you choose; that is, if you use meters for
mu and cm**-3 for N, then you should keep these in mind when evaluating
the pdf and cdf functions and when interpreting moments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
float
|
Median/geometric mean radius, length unit. |
required |
sigma
|
float
|
Geometric standard deviation, unitless. |
required |
N
|
(float, optional(default=1.0))
|
Total number concentration, concentration unit. |
1.0
|
Attributes:
| Name | Type | Description |
|---|---|---|
median |
float
|
Geometric mean (= |
mean |
float
|
Arithmetic mean: |
Methods:
| Name | Description |
|---|---|
pdf |
Evaluate size distribution density dN/dx (not logarithmic) at a particular radius x |
pdfloge |
Evaluate size distribution logarithmic density dN/dln(x) at a particular radius x |
pdflog10 |
Evaluate size distribution logarithmic density dN/dlog(x) at a particular radius x |
cdf |
Evaluate cumulative concentration up to a particular radius x |
moment |
Compute the k-th moment of the lognormal distribution. |
Source code in pyrcel/distributions.py
invcdf ¶
Inverse of cumulative density function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y
|
float
|
CDF value, between 0 and |
required |
Returns:
| Type | Description |
|---|---|
float
|
Radius (same unit as |
Source code in pyrcel/distributions.py
cdf ¶
Cumulative density function
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
Radius (must match unit of |
required |
Returns:
| Type | Description |
|---|---|
float
|
Cumulative concentration up to radius |
Source code in pyrcel/distributions.py
pdf ¶
Distribution density function dN/dx (not logarithmic).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
Radius (must match unit of |
required |
Returns:
| Type | Description |
|---|---|
float
|
Distribution density value at radius |
Source code in pyrcel/distributions.py
pdfloge ¶
Distribution density function dN/dln(x) (natural logarithm).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
Radius (must match unit of |
required |
Returns:
| Type | Description |
|---|---|
float
|
Logarithmic distribution density value at radius |
Source code in pyrcel/distributions.py
pdflog10 ¶
Distribution density function dN/dlog(x) (base 10 logarithm).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
Radius (must match unit of |
required |
Returns:
| Type | Description |
|---|---|
float
|
Base-10 logarithmic distribution density value at radius |
Source code in pyrcel/distributions.py
moment ¶
Compute the k-th moment of the lognormal distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k
|
int
|
Moment to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The k-th moment of the distribution. |
Source code in pyrcel/distributions.py
stats ¶
Compute useful statistics for a lognormal distribution
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary containing the stats |
Source code in pyrcel/distributions.py
MultiModeLognorm ¶
MultiModeLognorm(
mus: tuple[float, ...] | list[float],
sigmas: tuple[float, ...] | list[float],
Ns: tuple[float, ...] | list[float],
base: float = np.e,
)
Bases: BaseDistribution
Multimode lognormal distribution class.
Container for multiple Lognorm classes representing a full aerosol size distribution.
Source code in pyrcel/distributions.py
Gamma distribution
pyrcel.distributions.Gamma is a placeholder class and is not yet implemented.
Pre-built collections¶
Four published aerosol size distribution climatologies are available as module-level
dicts of Lognorm or MultiModeLognorm objects:
| Name | Source | Keys |
|---|---|---|
pyrcel.distributions.FN2005_single_modes |
Fountoukis & Nenes (2005) | SM1–SM5 |
pyrcel.distributions.NS2003_single_modes |
Nenes & Seinfeld (2003) | SM1–SM5 |
pyrcel.distributions.whitby_distributions |
Whitby (1978) | marine, continental, background, urban |
pyrcel.distributions.jaenicke_distributions |
Jaenicke (1993) | Polar, Urban, Background, Maritime, Remote Continental, Rural |
whitby_distributions values are lists of Lognorm objects (nucleation, accumulation,
coarse modes). jaenicke_distributions values are MultiModeLognorm objects.