Class LevelMode
java.lang.Object
uk.ac.starlink.ttools.plot2.layer.LevelMode
Defines a strategy for calculating contour level values from an
array of data.
- Since:
- 17 Feb 2013
- Author:
- Mark Taylor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic LevelMode
Equal-area scaling - levels are spaced to provide equally sized inter-contour regions.static LevelMode
Linear scaling - level values are equally spaced.static LevelMode
Logarithmic scaling - level logarithms are equally spacedstatic final LevelMode[]
Known level mode instances. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract double[]
calculateLevels
(NumberArray array, int nLevel, double offset, boolean isCounts) Calculates the contour levels for a given data array.Returns a short description of this mode.toString()
-
Field Details
-
LINEAR
Linear scaling - level values are equally spaced. -
LOG
Logarithmic scaling - level logarithms are equally spaced -
EQU
Equal-area scaling - levels are spaced to provide equally sized inter-contour regions. -
MODES
Known level mode instances.
-
-
Constructor Details
-
LevelMode
Constructor.- Parameters:
name
- mode namedescription
- short description of mode
-
-
Method Details
-
calculateLevels
public abstract double[] calculateLevels(NumberArray array, int nLevel, double offset, boolean isCounts) Calculates the contour levels for a given data array.- Parameters:
array
- data array; NaN elements are permitted and ignorednLevel
- number of requested levels; actual level count may not be the same as this depending on dataoffset
- offset from zero of the value of the first contour, expected in the range 0..1; adjusting this will sweep contours over all positionsisCounts
- true if the values are counts rather than continuously varying; if true, some adjustments are made on the basis of the assumption that differences of scale smaller than 1 don't make much sense
-
getDescription
Returns a short description of this mode.- Returns:
- description
-
toString
-