Particles
pysammos.data_handle.particles package
Subpackage for handling particle data.
Particle Statistics module
pysammos.data_handle.particles.particle_statistics module
This module provides functions to compute statistical properties of particle systems. Currently, it includes the following function:
d50_calc(): Computes the D50 (median diameter) from sorted particle diameters and their corresponding masses.
- pysammos.data_handle.particles.particle_stats.d50_calc(diameter_t0_sort, mass_t0_sort)[source]
Calculate the D50 (median diameter) from sorted particle diameters and their corresponding masses. The D50 is the diameter at which 50% of the total mass is contained in particles smaller than this diameter.
The mathematical formula is given by:
- Return type:
float
\[D_{50} = \frac{d_{i-1} + (0.5 - F_{i-1}) \cdot (d_i - d_{i-1})}{F_i - F_{i-1}}\]where \(F_i\) is the cumulative mass fraction at diameter \(d_i\), and \(F_{i-1}\) is the cumulative mass fraction at diameter \(d_{i-1}\).
Inputs
- diameter_t0_sortndarray, shape (N,).
Sorted array of particle diameters.
- mass_t0_sortndarray, shape (N,).
Sorted array of particle masses corresponding to the diameters.
Outputs
- d50float
The D50 diameter value.
Examples
>>> diameters = np.array([0.1, 0.2, 0.3, 0.4, 0.5]) >>> masses = np.array([1, 2, 3, 4, 5]) >>> d50 = d50_calc(diameters, masses) >>> print(d50) 0.3 This indicates that 50% of the total mass is contained in particles with diameters less than or equal to 0.3.