public class CoordinateAxis1D extends CoordinateAxis
CoordinateAxis.AxisComparator
Variable.Cache
axisSizeToCache, axisType, boundaryRef, isContiguous, ncd, 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
Constructor and Description |
---|
CoordinateAxis1D(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.
|
CoordinateAxis1D(NetcdfDataset ncd,
VariableDS vds)
Create a 1D coordinate axis from an existing Variable
|
Modifier and Type | Method and Description |
---|---|
protected Variable |
copy() |
CoordinateAxis |
copyNoCache()
Make a copy, with an independent cache.
|
void |
correctLongitudeWrap() |
int |
findCoordElement(double coordVal)
Given a coordinate position, find what grid element contains it.
|
int |
findCoordElement(double coordVal,
int lastIndex)
Deprecated.
use findCoordElement(coordVal)
|
int |
findCoordElementBounded(double coordVal)
Given a coordinate position, find what grid element contains it, or is closest to it.
|
double[] |
getBound1()
Get the coordinate bound1 as a double array.
|
double[] |
getBound2()
Get the coordinate bound1 as a double array.
|
double[] |
getCoordBounds(int i)
Get the coordinate bounds for the ith coordinate.
|
double |
getCoordEdge(int index)
Get the ith coordinate edge.
|
double[] |
getCoordEdges()
Get the coordinate edges as a double array.
|
java.lang.String |
getCoordName(int index)
The "name" of the ith coordinate.
|
double |
getCoordValue(int index)
Get the ith coordinate value.
|
double[] |
getCoordValues()
Get the coordinate values as a double array.
|
double |
getIncrement()
Get increment value if isRegular()
|
double |
getMaxValue()
The largest coordinate value.
|
double |
getMinValue()
The smallest coordinate value.
|
java.util.List<NamedObject> |
getNames()
Get the list of names, to be used for user selection.
|
double |
getStart()
Get starting value if isRegular()
|
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 |
isInterval()
If this coordinate has interval values.
|
boolean |
isRegular()
If true, then value(i) = getStart() + i * getIncrement().
|
CoordinateAxis1D |
section(Range r)
Create a new CoordinateAxis1D as a section of this CoordinateAxis1D.
|
equals, factory, getAxisType, getBoundaryRef, getCalendarFromAttribute, getInfo, getPositive, getUnitsString, hashCode, isCoordinateVariable, isNumeric, setAxisType, setBoundaryRef, setPositive
_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 CoordinateAxis1D(NetcdfDataset ncd, VariableDS vds)
ncd
- the containing datasetvds
- wrap this VariableDS, which is not changed.public CoordinateAxis1D(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 CoordinateAxis1D section(Range r) throws InvalidRangeException
r
- the section rangeInvalidRangeException
- if IllegalRangeprotected Variable copy()
copy
in class CoordinateAxis
public CoordinateAxis copyNoCache()
CoordinateAxis
copyNoCache
in class CoordinateAxis
public java.util.List<NamedObject> getNames()
public java.lang.String getCoordName(int index)
index
- which one ?public double getCoordValue(int index)
index
- which coordinate. Between 0 and getNumElements()-1 inclusive.java.lang.UnsupportedOperationException
- if !isNumeric()public double getMinValue()
CoordinateAxis
getMinValue
in class CoordinateAxis
public double getMaxValue()
CoordinateAxis
getMaxValue
in class CoordinateAxis
public double getCoordEdge(int index)
Coordinate edges must be strictly monotonic: coordEdge(0) < coordValue(0) < coordEdge(1) < coordValue(1) ... ... coordEdge(i) < coordValue(i) < coordEdge(i+1) < coordValue(i+1) ... ... coordEdge(n-1) < coordValue(n-1) < coordEdge(n)
index
- which coordinate. Between 0 and getNumElements() inclusive.java.lang.UnsupportedOperationException
- if !isNumeric()public double[] getCoordValues()
java.lang.UnsupportedOperationException
- if !isNumeric()public double[] getCoordEdges()
java.lang.UnsupportedOperationException
- if !isNumeric()public boolean isContiguous()
CoordinateAxis
isContiguous
in class CoordinateAxis
public boolean isInterval()
isInterval
in class CoordinateAxis
public double[] getBound1()
java.lang.UnsupportedOperationException
- if !isNumeric()public double[] getBound2()
java.lang.UnsupportedOperationException
- if !isNumeric()public double[] getCoordBounds(int i)
i
- coordinate indexpublic int findCoordElement(double coordVal)
edge[i] <= pos < edge[i+1] (if values are ascending) edge[i] > pos >= edge[i+1] (if values are descending)
coordVal
- position in this coordinate systempublic int findCoordElementBounded(double coordVal)
coordVal
- position in this coordinate systempublic int findCoordElement(double coordVal, int lastIndex)
public double getStart()
public double getIncrement()
public boolean isRegular()
public void correctLongitudeWrap()