OPC.
evaluate
(self, distribution, rh=0.0, \*\*kwargs)¶Return the total number of particles in each bin for a given AerosolDistribution.
We evaluate an OPC for a given distribution by calculating the Cscat value for every particle in the distribution and assigning it to a bin of the OPC. Since we are beginning with a PDF and not a distribution, we must first discretize our PDF - we can choose the number of bins to convert of PDF into which allows us to limit the computation needed by only performing calculations for a small subset of the actual particles (i.e. we can do one calculation for a tiny bin and then replicate it without needing to re-do the Mie calculations).
A valid instance of the AerosolDistribution class.
The relative humidity in % (0-100)
The number of particles in each OPC bin (size is the number of bins)
Examples
Evaluate an OPC for the Urban distribution
>>> opc = opcsim.OPC(wl=0.658, n_bins=5)
>>> opc.calibrate(material="psl")
>>> d = opcsim.load_distribution("urban")
>>> vals = opc.evaluate(d, rh=0.)
Evaluate a distribution of Ammonium Sulfate at various RH’s
>>> opc = opcsim.OPC(wl=0.658, n_bins=5)
>>> d = opcsim.AerosolDistribution()
>>> d.add_mode(n=1000, gm=500e-3, gsd=1.5, kappa=0.53, refr=complex(1.521, 0), rho=1.77)
>>> vals_0 = opc.evaluate(d, rh=0.)
>>> vals_50 = opc.evaluate(d, rh=50.)
>>> als_100 = opc.evaluate(d, rh=100.)