OPC.
histogram
(self, distribution, weight='number', base='log10', rh=0.0, \*\*kwargs)¶Return a histogram containing the [weight] of particles in each OPC bin.
This represents what the OPC ‘sees’. All calculations are made assuming the center of the bin is reprentative of the entire bin.
Choose how to weight the pdf. Default is number.
Base algorithm to use. Default is ‘log10’.
The relative humidity in percent (0-100).
Returns an array with the evaluated PDF. This data can be directly plotted as a histogram using matplotlib bar plots. By default, dN/dlogDp is returned.
Examples
Evaluate an OPC for the Urban distribution and return dN/dlogDp
>>> opc = opcsim.OPC(n_bins=5)
>>> opc.calibrate(material="psl")
>>> d = opcsim.load_distribution("urban")
>>> hist = opc.histogram(d, weight="number", rh=0.)
Evaluate an OPC for the Urban distribution and return dV/dlogDp
>>> opc = opcsim.OPC(n_bins=5)
>>> opc.calibrate(material="psl")
>>> d = opcsim.load_distribution("urban")
>>> hist = opc.histogram(d, weight="volume", rh=0.)
Evaluate an OPC for the Urban distribution and return dN/dDp
>>> opc = opcsim.OPC(n_bins=5)
>>> opc.calibrate(material="psl")
>>> d = opcsim.load_distribution("urban")
>>> hist = opc.histogram(d, weight="number", base=None, rh=0.)
Evaluate a distribution of Ammonium Sulfate at 50% RH
>>> opc = opcsim.OPC(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)
>>> hist = opc.histogram(d, weight="number", base="log10", rh=50.)