odc.geo.math.Bin1D

class odc.geo.math.Bin1D(sz, origin=0.0, direction=1)[source]

Class for translating continous coordinates to bin index.

Binning is defined using following parameters:

Parameters:
  • sz (float) – Bin size (positive floating point number)

  • origin (float) – Location of the left edge of bin 0

  • direction (Literal[1, -1]) – Direction of the bin index +1|-1

__init__(sz, origin=0.0, direction=1)[source]

Construct Bin1D object.

Parameters:
  • sz (float) – Size of each bin, must be positive

  • origin (float) – Location of the left edge of bin 0, defaults to 0.0

  • direction (Literal[1, -1]) – Default is to increment bin index left to right, supply -1 to go the other way

Methods

__init__(sz[, origin, direction])

Construct Bin1D object.

bin(x)

Lookup bin index that x falls into.

from_sample_bin(idx, bin[, direction])

Construct Bin1D from a sample.

Attributes

sz

origin

direction