Class BinMapper
java.lang.Object
uk.ac.starlink.ttools.plot2.layer.BinMapper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetBinIndex(double dvalue) Returns the bin index for a given value.double[]getBinLimits(int index) Returns the bin limits for a given bin index.inthashCode()
-
Constructor Details
-
BinMapper
Constructor.The
dpointparameter is used internally to determine the zero point of the bins. In principle this should make no difference to behaviour, but in case that the data is situated a very long way from 1, setting it close to the actual data point locations may avoid rounding errors.- Parameters:
scale- axis scalingscaleWidth- extent of bins in scale unitsbinPhase- determines sub-bin boundary shifts along axis, normally in range 0..1dpoint- representative data space point on axis which bins are situated
-
-
Method Details
-
getBinIndex
public int getBinIndex(double dvalue) Returns the bin index for a given value. In case of an invalid value (NaN, or non-positive for log scale), behaviour is undefined (quite likely zero will be returned).- Parameters:
dvalue- valid axis value in data space- Returns:
- bin index
-
getBinLimits
public double[] getBinLimits(int index) Returns the bin limits for a given bin index.- Parameters:
index- bin index- Returns:
- (lower,upper) bin limits
-
hashCode
-
equals
-