public class CoordinateAxis extends VariableDS
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.
Modifier and Type | Class and Description |
---|---|
static class |
CoordinateAxis.AxisComparator
Standard sort on Coordinate Axes
|
Variable.Cache
Modifier and Type | Field and Description |
---|---|
static int |
axisSizeToCache |
protected AxisType |
axisType |
protected java.lang.String |
boundaryRef |
protected boolean |
isContiguous |
protected NetcdfDataset |
ncd |
protected java.lang.String |
positive |
orgDataType, orgName, orgVar
attributes, cache, dataType, debugCaching, defaultCoordsSizeToCache, defaultSizeToCache, dimensions, elementSize, hashCode, isMetadata, isVariableLength, ncfile, permitCaching, proxyReader, shape, shapeAsSection, sizeToCache, spiObject
annotations, dodsname, group, immutable, parentstruct, shortName, sort
Modifier | Constructor and Description |
---|---|
|
CoordinateAxis(NetcdfDataset ds,
Group group,
java.lang.String shortName,
DataType dataType,
java.lang.String dims,
java.lang.String units,
java.lang.String desc)
Constructor when theres no underlying variable.
|
protected |
CoordinateAxis(NetcdfDataset ncd,
VariableDS vds)
Create a coordinate axis from an existing Variable.
|
Modifier and Type | Method and Description |
---|---|
protected Variable |
copy() |
CoordinateAxis |
copyNoCache()
Make a copy, with an independent cache.
|
boolean |
equals(java.lang.Object oo)
Instances which have same content are equal.
|
static CoordinateAxis |
factory(NetcdfDataset ncd,
VariableDS vds)
Create a coordinate axis from an existing Variable.
|
AxisType |
getAxisType()
Get type of axis
|
java.lang.String |
getBoundaryRef()
The name of this coordinate axis' boundary variable
|
protected Calendar |
getCalendarFromAttribute() |
void |
getInfo(java.util.Formatter buf)
Get a string representation
|
double |
getMaxValue()
The largest coordinate value.
|
double |
getMinValue()
The smallest coordinate value.
|
java.lang.String |
getPositive()
Get the direction of increasing values, used only for vertical Axes.
|
java.lang.String |
getUnitsString()
Get the Unit String for the Variable.
|
int |
hashCode()
Override Object.hashCode() to implement equals.
|
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.
|
boolean |
isCoordinateVariable()
Calculate if this is a classic coordinate variable: has same name as its first dimension.
|
boolean |
isInterval()
An interval coordinate consists of two numbers, bound1 and bound2.
|
boolean |
isNumeric()
Does the axis have numeric values.
|
void |
setAxisType(AxisType axisType)
Set type of axis, or null if none.
|
void |
setBoundaryRef(java.lang.String boundaryRef)
Set a reference to a boundary variable.
|
void |
setPositive(java.lang.String positive)
Set the direction of increasing values, used only for vertical Axes.
|
_read, _read, addCoordinateSystem, clearCoordinateSystems, convertEnums, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, enhance, getCoordinateSystems, getDatasetLocation, getDescription, getEnhanceMode, getMissingDataArray, getOriginalDataType, getOriginalName, getOriginalVariable, getUseNaNs, getValidMax, getValidMin, hasCachedDataRecurse, hasFillValue, hasInvalidData, hasMissing, hasMissingValue, hasScaleOffset, isFillValue, isInvalidData, isMissing, isMissingFast, isMissingValue, lookupEnumString, readToStream, reallyRead, reallyRead, removeCoordinateSystem, setCaching, setFillValueIsMissing, setInvalidDataIsMissing, setMissingDataIsMissing, setName, setOriginalVariable, setUnitsString, setUseNaNs, showScaleMissingProxy, toStringDebug
addAll, addAttribute, compareTo, createNewCache, extraInfo, findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDAPName, getDAPName, getDataType, getDimension, getDimensions, getDimensionsAll, getDimensionsString, getElementSize, getEnumTypedef, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNetcdfFile, getParentGroup, getProxyReader, getRanges, getRank, getScalarData, getShape, getShape, getShapeAll, getShapeAsSection, getShapeNotScalar, getSize, getSizeToCache, getSPobject, hasCachedData, hashCodeShow, invalidateCache, isCaching, isImmutable, isMetadata, isScalar, isUnknownLength, isUnlimited, isUnsigned, isVariableLength, read, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, readToByteChannel, reduce, remove, removeAttribute, removeAttributeIgnoreCase, resetDimensions, resetShape, section, section, setCachedData, setCachedData, setDataType, setDimension, setDimensions, setDimensions, setDimensionsAnonymous, setElementSize, setEnumTypedef, setImmutable, setIsScalar, setParentGroup, setProxyReader, setSizeToCache, setSPobject, setUnsigned, setValues, setValues, slice, toString, writeCDL, writeCDL
annotate, getAnnotation, getAnnotations, getDODSName, getFullName, getFullNameEscaped, getGroup, getImmutable, getName, getParentStructure, getShortName, getSort, isMemberOfStructure, localhash, setDODSName, setImmutable, setParentStructure, setShortName, setSort, unwrap
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDataType, getDimension, getDimensions, getDimensionsAll, getElementSize, getEnumTypedef, getFullName, getFullNameEscaped, getNameAndDimensions, getParentGroup, getParentStructure, getRanges, getRank, getShape, getShapeAsSection, getShortName, getSize, isMemberOfStructure, isMetadata, isScalar, isUnlimited, isUnsigned, isVariableLength, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, section
getName
public static int axisSizeToCache
protected NetcdfDataset ncd
protected AxisType axisType
protected java.lang.String positive
protected java.lang.String boundaryRef
protected boolean isContiguous
protected CoordinateAxis(NetcdfDataset ncd, VariableDS vds)
ncd
- the containing datasetvds
- an existing Variablepublic CoordinateAxis(NetcdfDataset ds, Group group, java.lang.String shortName, DataType dataType, java.lang.String dims, java.lang.String units, java.lang.String desc)
ds
- the containing dataset.group
- the containing group; if null, use rootGroupshortName
- axis name.dataType
- data typedims
- list of dimension namesunits
- units of coordinates, preferably udunit compatible.desc
- long name.public static CoordinateAxis factory(NetcdfDataset ncd, VariableDS vds)
ncd
- the containing datasetvds
- an existing Variable in dataset.public CoordinateAxis copyNoCache()
protected Variable copy()
copy
in class VariableDS
public AxisType getAxisType()
public void setAxisType(AxisType axisType)
axisType
- set to this valuepublic java.lang.String getUnitsString()
Variable
getUnitsString
in interface Enhancements
getUnitsString
in interface VariableIF
getUnitsString
in interface VariableSimpleIF
getUnitsString
in class VariableDS
public boolean isNumeric()
public boolean isContiguous()
public boolean isInterval()
public java.lang.String getPositive()
public void setPositive(java.lang.String positive)
positive
- POSITIVE_UP, POSITIVE_DOWN, or null if you dont know..public java.lang.String getBoundaryRef()
public void setBoundaryRef(java.lang.String boundaryRef)
boundaryRef
- the name of a boundary coordinate variable in the same dataset.public double getMinValue()
public double getMaxValue()
public void getInfo(java.util.Formatter buf)
buf
- place info herepublic boolean equals(java.lang.Object oo)
public int hashCode()
protected Calendar getCalendarFromAttribute()
public boolean isCoordinateVariable()
Variable
isCoordinateVariable
in interface VariableIF
isCoordinateVariable
in class Variable