uk.ac.starlink.ttools.plot2.layer
Class KnnKernelDensityPlotter

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.layer.Pixel1dPlotter<AbstractKernelDensityPlotter.KDenseStyle>
      extended by uk.ac.starlink.ttools.plot2.layer.AbstractKernelDensityPlotter
          extended by uk.ac.starlink.ttools.plot2.layer.KnnKernelDensityPlotter
All Implemented Interfaces:
Plotter<AbstractKernelDensityPlotter.KDenseStyle>

public class KnnKernelDensityPlotter
extends AbstractKernelDensityPlotter

Kernel Density Plotter that uses a variable-width kernel whose width is assigned using K-Nearest-Neighbours counting.

Since:
30 Mar 2015
Author:
Mark Taylor

Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.starlink.ttools.plot2.layer.AbstractKernelDensityPlotter
AbstractKernelDensityPlotter.KDenseStyle, AbstractKernelDensityPlotter.KernelFigure
 
Nested classes/interfaces inherited from class uk.ac.starlink.ttools.plot2.layer.Pixel1dPlotter
Pixel1dPlotter.BinArray, Pixel1dPlotter.Pixel1dPlan
 
Field Summary
static ConfigKey<Double> KNN_CKEY
          Config key for number of nearest neighbours.
static ConfigKey<BinSizer> MAXSIZER_CKEY
          Config key for maximum smoothing width configuration.
static ReportKey<Double> MAXWIDTH_RKEY
          Report key for actual maximum smoothing width.
static ConfigKey<BinSizer> MINSIZER_CKEY
          Config key for minimum smoothing width.
static ReportKey<Double> MINWIDTH_RKEY
          Report key for actual minimum smoothing width.
static ConfigKey<Boolean> SYMMETRIC_CKEY
          Config key for determining symmetry of KNN search.
 
Fields inherited from class uk.ac.starlink.ttools.plot2.layer.AbstractKernelDensityPlotter
BINS_KEY, THICK_KEY
 
Fields inherited from class uk.ac.starlink.ttools.plot2.layer.Pixel1dPlotter
KERNEL_KEY, SMOOTHSIZER_KEY, SMOOTHWIDTH_KEY
 
Constructor Summary
KnnKernelDensityPlotter(FloatingCoord xCoord, boolean hasWeight, ConfigKey<Normalisation> normKey)
          Constructor.
 
Method Summary
protected  AbstractKernelDensityPlotter.KernelFigure createKernelFigure(ConfigMap config)
          Constructs an object for plot-time kernel construction based on a particular config map.
protected  ConfigKey[] getKernelConfigKeys()
          Returns a list of keys that specify how the smoothing kernel will be configured.
 String getPlotterDescription()
          Returns an XML description of this plotter.
 
Methods inherited from class uk.ac.starlink.ttools.plot2.layer.AbstractKernelDensityPlotter
createStyle, extendPixel1dCoordinateRanges, getLayerOpt, getPixel1dReport, getPixelPadding, getStyleKeys, paintBins
 
Methods inherited from class uk.ac.starlink.ttools.plot2.layer.Pixel1dPlotter
calculatePixelPlan, createKernel, createLayer, getCoordGroup, getDataBins, getEffectiveExtent, getPixelWidth, getPlotterIcon, getPlotterName, getWeightCoordIndex, hasReports, readBins
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MINWIDTH_RKEY

public static final ReportKey<Double> MINWIDTH_RKEY
Report key for actual minimum smoothing width.


MAXWIDTH_RKEY

public static final ReportKey<Double> MAXWIDTH_RKEY
Report key for actual maximum smoothing width.


KNN_CKEY

public static final ConfigKey<Double> KNN_CKEY
Config key for number of nearest neighbours.


SYMMETRIC_CKEY

public static final ConfigKey<Boolean> SYMMETRIC_CKEY
Config key for determining symmetry of KNN search.


MINSIZER_CKEY

public static final ConfigKey<BinSizer> MINSIZER_CKEY
Config key for minimum smoothing width.


MAXSIZER_CKEY

public static final ConfigKey<BinSizer> MAXSIZER_CKEY
Config key for maximum smoothing width configuration.

Constructor Detail

KnnKernelDensityPlotter

public KnnKernelDensityPlotter(FloatingCoord xCoord,
                               boolean hasWeight,
                               ConfigKey<Normalisation> normKey)
Constructor.

Parameters:
xCoord - X axis coordinate
hasWeight - true to permit histogram weighting
normKey - config key for normalisation options
Method Detail

getPlotterDescription

public String getPlotterDescription()
Description copied from interface: Plotter
Returns an XML description of this plotter.

Note: really this should appear at the LayerType level.

Returns:
one or more <p> elements

getKernelConfigKeys

protected ConfigKey[] getKernelConfigKeys()
Description copied from class: AbstractKernelDensityPlotter
Returns a list of keys that specify how the smoothing kernel will be configured.

Specified by:
getKernelConfigKeys in class AbstractKernelDensityPlotter
Returns:
list of implementation-specific kernel config keys

createKernelFigure

protected AbstractKernelDensityPlotter.KernelFigure createKernelFigure(ConfigMap config)
                                                                throws ConfigException
Description copied from class: AbstractKernelDensityPlotter
Constructs an object for plot-time kernel construction based on a particular config map.

Specified by:
createKernelFigure in class AbstractKernelDensityPlotter
Parameters:
config - config map with kernel config keys in it
Throws:
ConfigException
See Also:
AbstractKernelDensityPlotter.getKernelConfigKeys()


Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.