public class CoordinateAxis1D extends CoordinateAxis
If this is char valued, it will have rank 2, otherwise it will have rank 1.
If string or char valued, only getCoordName() can be called.
If the coordinates are regularly spaced, isRegular() is true, and the values are equal to getStart() + i * getIncrement().
This will also set "cell bounds" for this axis. By default, the cell bounds are midway between the coordinates values, and are therefore contiguous, and can be accessed though getCoordEdge(i). The only way the bounds can be set is if the coordinate variable has an attribute "bounds" that points to another variable bounds(ncoords,2). These contain the cell bounds, and must be ascending or descending as the coordinate values are. In this case isContiguous() is true when bounds1(i+1) == bounds2(i) for all i.
| Modifier and Type | Class and Description |
|---|---|
static class |
CoordinateAxis1D.Builder<T extends CoordinateAxis1D.Builder<T>> |
CoordinateAxis.AxisComparatorVariable.Cache| Modifier and Type | Field and Description |
|---|---|
protected double[] |
coords |
protected boolean |
wasRead |
axisType, boundaryRef, isContiguous, ncd, positiveorgDataType, orgName, orgVarattributes, cache, dataType, debugCaching, defaultCoordsSizeToCache, defaultSizeToCache, dimensions, elementSize, hashCode, isVariableLength, ncfile, permitCaching, proxyReader, shape, sizeToCache, spiObjectannotations, dodsname, group, immutable, parentstruct, shortName, sort| Modifier | Constructor and Description |
|---|---|
protected |
CoordinateAxis1D(CoordinateAxis1D.Builder<?> builder,
Group parentGroup) |
|
CoordinateAxis1D(NetcdfDataset ds,
Group group,
java.lang.String shortName,
DataType dataType,
java.lang.String dims,
java.lang.String units,
java.lang.String desc)
Deprecated.
Use CoordinateAxis1D.builder()
|
|
CoordinateAxis1D(NetcdfDataset ncd,
VariableDS vds)
Deprecated.
Use CoordinateAxis1D.builder()
|
| Modifier and Type | Method and Description |
|---|---|
protected CoordinateAxis1D.Builder<?> |
addLocalFieldsToBuilder(CoordinateAxis1D.Builder<? extends CoordinateAxis1D.Builder<?>> b) |
static CoordinateAxis1D.Builder<?> |
builder()
Get Builder for this class that allows subclassing.
|
protected CoordinateAxis1D |
copy()
Deprecated.
Use
toBuilder() |
CoordinateAxis |
copyNoCache()
Make a copy, with an independent cache.
|
void |
correctLongitudeWrap()
Deprecated.
do not use.
|
int |
findCoordElement(double coordVal)
Given a coordinate value, 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 |
getCoordBoundsMidpoint(int i) |
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 |
getMaxEdgeValue() |
double |
getMaxValue()
The largest coordinate value.
|
double |
getMinEdgeValue() |
double |
getMinValue()
The smallest coordinate value.
|
java.util.List<NamedObject> |
getNames()
Deprecated.
will move in ver 6
|
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().
|
protected void |
readValues() |
CoordinateAxis1D |
section(Range r)
Create a new CoordinateAxis1D as a section of this CoordinateAxis1D.
|
CoordinateAxis1D.Builder<?> |
toBuilder()
Turn into a mutable Builder.
|
addLocalFieldsToBuilder, equals, factory, fromVariableDS, getAxisType, getBoundaryRef, getCalendarFromAttribute, getInfo, getPositive, getUnitsString, hashCode, isIndependentCoordinate, isNumeric, setAxisType, setBoundaryRef, setPositive_read, _read, addCoordinateSystem, addEnhancement, addLocalFieldsToBuilder, applyScaleOffset, applyScaleOffset, clearCoordinateSystems, convert, convertMissing, convertMissing, convertUnsigned, convertUnsigned, convertUnsigned, enhance, fillValueIsMissing, getCoordinateSystems, getDatasetLocation, getDescription, getEnhanceMode, getFillValue, getMissingDataArray, getMissingValues, getNetcdfFile, getOffset, getOriginalDataType, getOriginalName, getOriginalVariable, getScaledOffsetType, getScaleFactor, getSignedness, getUnsignedConversionType, getValidMax, getValidMin, hasCachedDataRecurse, hasFillValue, hasMissing, hasMissingValue, hasScaleOffset, hasValidData, invalidDataIsMissing, isFillValue, isInvalidData, isMissing, isMissingValue, lookupEnumString, missingDataIsMissing, readToStream, reallyRead, reallyRead, removeCoordinateSystem, removeEnhancement, setCaching, setFillValueIsMissing, setInvalidDataIsMissing, setMissingDataIsMissing, setName, setOriginalVariable, setUnitsString, showScaleMissingProxy, toStringDebug_readScalarData, addAll, addAttribute, addLocalFieldsToBuilder, attributes, compareTo, createNewCache, extraInfo, findAttribute, findAttributeDouble, findAttributeIgnoreCase, findAttributeInteger, findAttributeString, findDimensionIndex, getAttributes, getDAPName, getDAPName, getDataType, getDimension, getDimensions, getDimensionsAll, getDimensionsString, getElementSize, getEnumTypedef, getFileTypeId, getFullName, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getParentGroup, getParentGroupOrRoot, getParentStructure, getProxyReader, getRanges, getRank, getScalarData, getShape, getShape, getShapeAll, getShapeAsSection, getSize, getSizeToCache, getSPobject, hasCachedData, invalidateCache, isCaching, isCoordinateVariable, isEmpty, isImmutable, isMemberOfStructure, isMetadata, isScalar, isUnknownLength, isUnlimited, 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, setValues, setValues, slice, toString, writeCDL, writeCDLannotate, annotation, getDODSName, getFullNameEscaped, getGroup, getImmutable, getName, getShortName, getSort, localhash, setDODSName, setParentStructure, setShortName, setSort, unwrapclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetFullName, getShortNamegetName, getShortNamefilter, findAttValueIgnoreCase, getName, hasAttribute, hasAttributeIgnoreCase, iterator@Deprecated public CoordinateAxis1D(NetcdfDataset ncd, VariableDS vds)
ncd - the containing datasetvds - wrap this VariableDS, which is not changed.@Deprecated 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.protected CoordinateAxis1D(CoordinateAxis1D.Builder<?> builder, Group parentGroup)
public CoordinateAxis1D section(Range r) throws InvalidRangeException
r - the section rangeInvalidRangeException - if IllegalRange@Deprecated protected CoordinateAxis1D copy()
toBuilder()copy in class CoordinateAxispublic CoordinateAxis copyNoCache()
CoordinateAxiscopyNoCache in class CoordinateAxis@Deprecated 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()
CoordinateAxisgetMinValue in class CoordinateAxispublic double getMaxValue()
CoordinateAxisgetMaxValue in class CoordinateAxispublic double getMinEdgeValue()
public double getMaxEdgeValue()
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()
CoordinateAxisisContiguous in class CoordinateAxispublic boolean isInterval()
isInterval in class CoordinateAxispublic double[] getBound1()
java.lang.UnsupportedOperationException - if !isNumeric()public double[] getBound2()
java.lang.UnsupportedOperationException - if !isNumeric()public double[] getCoordBounds(int i)
i - coordinate indexpublic double getCoordBoundsMidpoint(int i)
public int findCoordElement(double coordVal)
edge[i] <= value < edge[i+1] (if values are ascending) edge[i] > value >= 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()
@Deprecated public void correctLongitudeWrap()
protected void readValues()
public CoordinateAxis1D.Builder<?> toBuilder()
VariabletoBuilder in class CoordinateAxisprotected CoordinateAxis1D.Builder<?> addLocalFieldsToBuilder(CoordinateAxis1D.Builder<? extends CoordinateAxis1D.Builder<?>> b)
public static CoordinateAxis1D.Builder<?> builder()