API Reference

Aerosol Distributions

Aerosol Distribution Class

opcsim.AerosolDistribution([label])

Define an aerosol distribution.

AerosolDistribution Methods

opcsim.AerosolDistribution.add_mode(self, n, …)

Add a mode to the distribution as defined using N, GM, and GSD.

opcsim.AerosolDistribution.pdf(self, dp[, …])

Evaluate and return the probability distribution function at particle diameter dp.

opcsim.AerosolDistribution.cdf(self, dmax[, …])

Evaluate and return the cumulative probability distribution function between dmin and dmax.

Models

OPC

OPC Class

opcsim.OPC(wl[, bins, n_bins, dmin, dmax, theta])

Define an Optical Particle Counter (OPC) with unique properties for wavelength, bins, and viewing angle.

OPC Methods

opcsim.OPC.calibrate(self, material[, …])

Calibrate the OPC assuming a specific material.

opcsim.OPC.evaluate(self, distribution[, rh])

Return the total number of particles in each bin for a given AerosolDistribution.

opcsim.OPC.histogram(self, distribution[, …])

Return a histogram containing the [weight] of particles in each OPC bin.

opcsim.OPC.integrate(self, distribution[, …])

Integrate the distribution according to the OPC for any [weight].

Nephelometer

Nephelometer Class

opcsim.Nephelometer(wl[, theta])

Define a Nephelometer by its wavelength and range of viewing angles.

Nephelometer Methods

opcsim.Nephelometer.calibrate(self, distribution)

Calibrate a Nephelometer using any AerosolDistribution.

opcsim.Nephelometer.evaluate(self, distribution)

Evaluate a Nephelometer for an AerosolDistribution at a given relative humidity.

Visualization

opcsim.plots.histplot(data, bins[, ax, …])

Plot the particle size distribution as a histogram/bar chart.

opcsim.plots.pdfplot(distribution[, ax, …])

Plot the PDF of an aerosol size distribution.

opcsim.plots.cdfplot(distribution[, ax, …])

Plot the CDF of a particle size distribution.

opcsim.plots.calplot(opc[, ax, plot_kws, …])

Metrics Functions

opcsim.metrics.compute_bin_assessment(opc, …)

Assess the ability of an OPC to assign particles to their correct bin.

Utility Functions

opcsim.load_distribution(label)

Load sample distributions as described by Seinfeld+Pandis Table 8.3.

opcsim.utils.make_bins(dmin, dmax, n_bins[, …])

Returns a 3xn array of bin diameters.

opcsim.utils.midpoints(bins[, base])

Returns a 3xn array of bin diameters.

opcsim.utils.k_kohler(diam_dry[, kappa, rh])

Calculate the wet diameter of a particle based on the hygroscopic growth parameter, kappa (k-Kohler theory).

opcsim.utils.rho_eff(rho[, weights, diams])

Calculate the effective density of a particle by calculating the wet and dry percentages and taking the weighted sum.

opcsim.utils.k_eff(kappas[, weights, diams])

Calculate the effective k-kohler coefficient from an array of kappa values and their weights.

opcsim.utils.ri_eff(species[, weights])

Calculate the effective refractive index for an array of refractive indices and their respective weights.

Mie Theory Calculations

opcsim.mie.coef_pi_tau(theta, x)

Compute the angle-dependant functions (pi and tau) using upward recurrence.

opcsim.mie.coef_ab(refr, x)

Compute the external field coefficients using the logarithmic derivative.

opcsim.mie.s1s2(refr, x, theta)

Compute the complex scattering amplitudes S1 and S2 at angle theta.

opcsim.mie.cscat(dp, wl, refr, theta1, theta2)

Compute the scattering cross section between two angles according to Jaenicke and Hanusch (1993).

Equations

opcsim.equations.pdf.dn_ddp(dp, n, gm, gsd)

Evaluate the number distribution as a lognormal PDF.

opcsim.equations.pdf.ds_ddp(dp, n, gm, gsd)

The surface-area weighted PDF of a lognormal distribution as calculated using equation 8.4 from Seinfeld and Pandis.

opcsim.equations.pdf.dv_ddp(dp, n, gm, gsd)

The volume weighted PDF of a lognormal distribution as calculated using equation 8.6 from Seinfeld and Pandis.

opcsim.equations.pdf.dn_dlndp(dp, n, gm, gsd)

The PDF of a lognormal distribution as calculated using equation 8.33 by way of 8.21 from Seinfeld and Pandis.

opcsim.equations.pdf.ds_dlndp(dp, n, gm, gsd)

The surface-area weighted PDF of a lognormal distribution as calculated using equation 8.10 from Seinfeld and Pandis.

opcsim.equations.pdf.dv_dlndp(dp, n, gm, gsd)

The volume weighted PDF of a lognormal distribution as calculated using equation 8.10 from Seinfeld and Pandis.

opcsim.equations.pdf.dn_dlogdp(dp, n, gm, gsd)

The PDF of a lognormal distribution on a log10 basis as calculated using equation 8.18 from Seinfeld and Pandis.

opcsim.equations.pdf.ds_dlogdp(dp, n, gm, gsd)

The surface-area weighted PDF of a lognormal distribution as calculated using equation 8.19 from Seinfeld and Pandis.

opcsim.equations.pdf.dv_dlogdp(dp, n, gm, gsd)

The volume weighted PDF of a lognormal distribution as calculated using equation 8.20 from Seinfeld and Pandis.

opcsim.equations.cdf.nt(n, gm, gsd[, dmin, dmax])

Evaluate the total number of particles between two diameters.

opcsim.equations.cdf.st(n, gm, gsd[, dmin, dmax])

Evaluate the total surface area of the particles between two diameters.

opcsim.equations.cdf.vt(n, gm, gsd[, dmin, dmax])

Evaluate the total volume of the particles between two diameters.