opcsim 0.5.0
  • API
  • Tutorial
  • Gallery
  • Site
      • Installation
      • Contributing
      • API reference
      • Tutorial
      • Example gallery
  • Page
      • opcsim.OPC.histogram

opcsim.OPC.histogram¶

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.

Parameters
distribution: AerosolDistribution
weight{‘number’ | ‘surface’ | ‘volume’}

Choose how to weight the pdf. Default is number.

base{‘none’ | ‘log10’}

Base algorithm to use. Default is ‘log10’.

rh: float

The relative humidity in percent (0-100).

Returns
d[weight]/d[base]Dparray

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.)

Back to top

Source

© Copyright 2016-2020, David H Hagan and Jesse H Kroll.
Created using Sphinx 3.0.3.