libtcspc.LinearBinMapper

class libtcspc.LinearBinMapper(offset, bin_width, max_bin_index, clamp=False, numeric_traits=None)[source]

Bases: BinMapper

Bin mapper that maps datapoints to bins of equal width.

Parameters:
  • offset (int or Param[int]) – Datapoint value mapped to the start of bin 0.

  • bin_width (int or Param[int]) – Width of each bin in datapoint units. May be negative to reverse the mapping.

  • max_bin_index (int or Param[int]) – Largest bin index (the histogram has max_bin_index + 1 bins).

  • clamp (bool) – If True, datapoints outside the range are clamped to the first or last bin instead of discarded. Default False.

  • numeric_traits (NumericTraits or None) – Numeric traits specifying datapoint_type and bin_index_type. Defaults to NumericTraits().

See also

tcspc::linear_bin_mapper

The underlying C++ bin mapper.