public class HistoRanger extends Object implements Ranger
This ranger is not intended to calculate arithmetically accurate
quantile values, but it's hopefully good enough to come up with colour maps.
The current implementation does a reasonable job of adaptive sampling,
but for large datasets (greater than the storage capacity)
it may be biassed, especially the add(uk.ac.starlink.ttools.plot2.Ranger)
method required for
range calculation in parallel.
Constructor and Description |
---|
HistoRanger(int nStore,
int nQuantile)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Ranger other)
Merges the contents of the supplied ranger into this one.
|
static boolean |
canScaleHistograms(Span span)
Indicates whether a given span can be used to scale histograms.
|
Ranger |
createCompatibleRanger()
Returns a Ranger instance that is compatible with this one.
|
Span |
createSpan()
Returns an object characterising the range of data submitted so far.
|
void |
submitDatum(double d)
Accepts a data value.
|
public HistoRanger(int nStore, int nQuantile)
nStore
- maximum number of samples to storenQuantile
- maximum number of quantiles on which to base
scalingpublic void submitDatum(double d)
Ranger
submitDatum
in interface Ranger
d
- datumpublic void add(Ranger other)
Ranger
The supplied ranger is assumed to be compatible with this one, which probably means created in the same way. If not, some RuntimeException such as a ClassCastException may result.
public Ranger createCompatibleRanger()
Ranger
Ranger.add(uk.ac.starlink.ttools.plot2.Ranger)
method.createCompatibleRanger
in interface Ranger
public Span createSpan()
Ranger
Ranger.submitDatum(double)
.createSpan
in interface Ranger
public static boolean canScaleHistograms(Span span)
Span.createScaler(uk.ac.starlink.ttools.plot2.Scaling, uk.ac.starlink.ttools.plot2.Subrange)
method will work
with a Scaling argument like Scaling.HISTO
.
This method relies on this class's knowledge of its implementation
details.span
- span instance to testCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.