opcsim 0.5.0
  • API
  • Tutorial
  • Gallery
  • Site
      • Installation
      • Contributing
      • API reference
      • Tutorial
      • Example gallery
  • Page
      • opcsim.utils.midpoints

opcsim.utils.midpoints¶

opcsim.utils.midpoints(bins, base='log')¶

Returns a 3xn array of bin diameters.

Build a 3xn array of bin diameters from a 2xn array that can then be fed directly into the OPC class. The default behaviour is to space the bins equally on a log10 basis.

Parameters
bins2xn array

A 2xn array with bin boundaries.

base{‘log’ | ‘none’ | None}
Returns
binsarray

Returns a 3xn_bins array in the format of [left edge, midpoint, right edge]

Examples

Build a set of bins for an OPC similar to a Dylos DC1100 Pro:

>>> arr = np.array([0.5, 2.5], [2.5, 10])
>>> bins = opcsim.utils.midpoints(arr)

Back to top

Source

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