PSD data¶
Particle size distribution (PSD) data consists of a range of particle densities given w.r.t to a corresponding grid of particle sizes. This module prvodies functionality for the handling of such PSD data.
Class reference¶
-
class
parts.scattering.psd.data.psd_data.
PSDData
(x, data, size_parameter)[source]¶ Bases:
object
The
PSDData
class handles PSD data given as a discrete distribution over a given size grid.The PSD data is stored as a
numpy.ndarray
of which the last dimension is assumed to correspond to the size parameter.Attributes:
data(numpy.array): The discrete PSD data.
x(numpy.array): The size grid corresponding to the last dimension in
data
size_parameter(SizeParameter): The size parameter used to represent the PSD.
-
change_size_parameter
(size_parameter)[source]¶ Change the size parameter of the data.
- Parameters:
- size_parameter(SizeParameter): The size parameter to convert the
- data to.
rho(np.float): Particle density.
-
get_mass_density
()[source]¶ Computes the particle mass density corresponding to the PSD data.
- Returns:
- Array containing the particle mass density for each of the bulk volumes described by the PSD data
-
get_moment
(p, reference_size_parameter=None)[source]¶ Compute the p th moment :math:M(p) of the PSD data:
M(p)=∫∞0XPrac{dN}{dX}(X):dX
The physical significance of a moment of a PSD depends on the size parameter. So in general, the moments of the same PSD given w.r.t. different size parameters differ. If :code: reference_size_parameter argument is given then the computed moment will correspond to the Moment of the PSD w.r.t. to the given size parameter.
Parameters:
p(numpy.float): The moment which to compute.
reference_size_parameter(:class: SizeParameter): Size parameter with respect to which the moment should be computed.
- Return:
- The p th moment of the particle size distribution.
-
-
class
parts.scattering.psd.data.psd_data.
SizeParameter
(a, b)[source]¶ Bases:
object
General representation of a size parameter of a PSD. The size parameter is represented by its mass-size relation, which gives the mass m as a function of the size parameter X:
m(X)=a⋅XbAttributes:
a(numpy.float): The a factor of the mass-size relation
b(numpy.float): The b exponent of the mass-size-relation
-
convert
(src, x, y)[source]¶ Conversion of PSD data given over one size parameter to another.
Parameters:
src(SizeParameter): The size parameter in which the PSD data is given.
x(numpy.ndarray): The size grid over which the PSD data is given. Must be broadcastable into the shape of
y
.y(numpy.ndarray): The PSD data with the last axis corresponding to the size grid
x
.Returns:
(x, y)
: Tuple containing the transformed size gridx
and PSD datay
-