Package ucar.nc2.dataset
Class CoordinateAxis
java.lang.Object
ucar.nc2.CDMNode
ucar.nc2.Variable
ucar.nc2.dataset.VariableDS
ucar.nc2.dataset.CoordinateAxis
- All Implemented Interfaces:
Comparable<VariableSimpleIF>,Iterable<Attribute>,IsMissingEvaluator,AttributeContainer,ucar.nc2.dataset.Enhancements,ucar.nc2.dataset.EnhanceScaleMissingUnsigned,VariableEnhanced,ProxyReader,VariableSimpleIF
- Direct Known Subclasses:
CoordinateAxis1D,CoordinateAxis2D
A Coordinate Axis is a Variable that specifies one of the coordinates of a CoordinateSystem.
Mathematically it is a scalar function F from index space to S:
F:D -> S where D is a product set of dimensions (aka index space), and S is the set of reals (R) or Strings.If its element type is char, it is considered a string-valued Coordinate Axis and rank is reduced by one, since the outermost dimension is considered the string length: v(i, j, .., strlen). If its element type is String, it is a string-valued Coordinate Axis. Otherwise it is numeric-valued, and isNumeric() is true. The one-dimensional case F(i) -> R is the common case which affords important optimizations. In that case, use the subtype CoordinateAxis1D. The factory methods will return either a CoordinateAxis1D if the variable is one-dimensional, a CoordinateAxis2D if its 2D, or a CoordinateAxis for the general case. A CoordinateAxis is optionally marked as georeferencing with an AxisType. It should have a units string and optionally a description string. A Structure cannot be a CoordinateAxis, although members of Structures can.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStandard sort on Coordinate Axesstatic classCoordinateAxis.Builder<T extends CoordinateAxis.Builder<T>> -
Field Summary
Fields inherited from class ucar.nc2.Variable
defaultCoordsSizeToCache, defaultSizeToCache, permitCaching -
Method Summary
Modifier and TypeMethodDescriptionstatic CoordinateAxis.Builder<?>builder()Get Builder for this class that allows subclassing.Make a copy, with an independent cache.booleanInstances which have same content are equal.static CoordinateAxis.BuilderfromVariableDS(VariableDS.Builder<?> vdsBuilder) Create a coordinate axis from an existing Variable.Builder.Get type of axisThe name of this coordinate axis' boundary variablevoidGet a string representationdoubleThe largest coordinate value.doubleThe smallest coordinate value.Get the direction of increasing values, used only for vertical Axes.Get the Unit String for the Variable.inthashCode()Override Object.hashCode() to implement equals.booleanIf the edges are contiguous or disjoint Caution: many datasets do not explicitly specify this info, this is often a guess; default is true.booleanbooleanAn interval coordinate consists of two numbers, bound1 and bound2.booleanDoes the axis have numeric values.Turn into a mutable Builder.Methods inherited from class ucar.nc2.dataset.VariableDS
applyScaleOffset, applyScaleOffset, convertMissing, convertMissing, convertUnsigned, convertUnsigned, convertUnsigned, fillValueIsMissing, getCoordinateSystems, getDatasetLocation, getDescription, getEnhanceMode, getFillValue, getMissingDataArray, getMissingValues, getNetcdfFile, getOffset, getOriginalDataType, getOriginalName, getOriginalVariable, getScaledOffsetType, getScaleFactor, getSignedness, getUnsignedConversionType, getValidMax, getValidMin, hasFillValue, hasMissing, hasMissingValue, hasScaleOffset, hasValidData, invalidDataIsMissing, isFillValue, isInvalidData, isMissing, isMissingValue, lookupEnumString, missingDataIsMissing, readToStream, reallyRead, reallyRead, showScaleMissingProxy, toStringDebugMethods inherited from class ucar.nc2.Variable
attributes, compareTo, createNewCache, findAttribute, findAttributeString, findDimensionIndex, getDataType, getDimension, getDimensions, getDimensionsString, getElementSize, getEnumTypedef, getFileTypeId, getFullName, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getParentGroup, getParentStructure, getRanges, getRank, getShape, getShape, getShapeAsSection, getSize, getSizeToCache, getSPobject, hasCachedData, isCaching, isCoordinateVariable, isMemberOfStructure, isMetadata, isScalar, isUnlimited, isVariableLength, read, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, reduce, section, section, slice, toStringMethods inherited from class ucar.nc2.CDMNode
getShortNameMethods inherited from interface ucar.nc2.AttributeContainer
findAttributeDouble, findAttributeIgnoreCase, findAttributeInteger, getName, hasAttribute, hasAttributeIgnoreCase, isEmpty, iteratorMethods inherited from interface ucar.nc2.dataset.Enhancements
addCoordinateSystem, removeCoordinateSystemMethods inherited from interface ucar.nc2.dataset.EnhanceScaleMissingUnsigned
convertMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface ucar.nc2.dataset.VariableEnhanced
getFullName, getShortNameMethods inherited from interface ucar.nc2.VariableSimpleIF
getShortName
-
Method Details
-
fromVariableDS
Create a coordinate axis from an existing Variable.Builder.- Parameters:
vdsBuilder- an existing Variable in dataset.- Returns:
- CoordinateAxis or one of its subclasses (CoordinateAxis1D, CoordinateAxis2D, or CoordinateAxis1DTime).
-
copyNoCache
Make a copy, with an independent cache.- Returns:
- copy of this CoordinateAxis
-
getAxisType
Get type of axis- Returns:
- type of axis, or null if none.
-
getUnitsString
Description copied from class:VariableGet the Unit String for the Variable. Looks for the CDM.UNITS attribute value- Specified by:
getUnitsStringin interfaceucar.nc2.dataset.Enhancements- Specified by:
getUnitsStringin interfaceVariableSimpleIF- Overrides:
getUnitsStringin classVariableDS- Returns:
- unit string, or null if not found.
-
isNumeric
public boolean isNumeric()Does the axis have numeric values.- Returns:
- true if the CoordAxis is numeric, false if its string valued ("nominal").
-
isContiguous
public boolean isContiguous()If the edges are contiguous or disjoint Caution: many datasets do not explicitly specify this info, this is often a guess; default is true.- Returns:
- true if the edges are contiguous or false if disjoint. Assumed true unless set otherwise.
-
isInterval
public boolean isInterval()An interval coordinate consists of two numbers, bound1 and bound2. The coordinate value must lie between them, but otherwise is somewhat arbitrary. If not interval, then it has one number, the coordinate value.- Returns:
- true if its an interval coordinate.
-
isIndependentCoordinate
public boolean isIndependentCoordinate() -
getPositive
Get the direction of increasing values, used only for vertical Axes.- Returns:
- POSITIVE_UP, POSITIVE_DOWN, or null if unknown.
-
getBoundaryRef
The name of this coordinate axis' boundary variable- Returns:
- the name of this coordinate axis' boundary variable, or null if none.
-
getMinValue
public double getMinValue()The smallest coordinate value. Only call if isNumeric.- Returns:
- the minimum coordinate value
-
getMaxValue
public double getMaxValue()The largest coordinate value. Only call if isNumeric.- Returns:
- the maximum coordinate value
-
getInfo
Get a string representation- Parameters:
buf- place info here
-
equals
Instances which have same content are equal. -
hashCode
public int hashCode()Override Object.hashCode() to implement equals. -
getCalendarFromAttribute
-
toBuilder
Description copied from class:VariableTurn into a mutable Builder. Can use toBuilder().build() to copy.- Overrides:
toBuilderin classVariableDS
-
builder
Get Builder for this class that allows subclassing.- See Also:
-
- "https://community.oracle.com/blogs/emcmanus/2010/10/24/using-builder-pattern-subclasses"
-