Package ucar.nc2.dataset
Class CoordinateAxis2D
java.lang.Object
ucar.nc2.CDMNode
ucar.nc2.Variable
ucar.nc2.dataset.VariableDS
ucar.nc2.dataset.CoordinateAxis
ucar.nc2.dataset.CoordinateAxis2D
- All Implemented Interfaces:
Comparable<VariableSimpleIF>,Iterable<Attribute>,IsMissingEvaluator,AttributeContainer,Enhancements,EnhanceScaleMissingUnsigned,VariableEnhanced,ProxyReader,VariableSimpleIF
A 2-dimensional numeric Coordinate Axis. Must be invertible meaning, roughly, that
if you draw lines connecting the points, none would cross.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCoordinateAxis2D.Builder<T extends CoordinateAxis2D.Builder<T>>Nested classes/interfaces inherited from class ucar.nc2.dataset.CoordinateAxis
CoordinateAxis.AxisComparator -
Field Summary
Fields inherited from class ucar.nc2.Variable
defaultCoordsSizeToCache, defaultSizeToCache, permitCaching -
Constructor Summary
ConstructorsConstructorDescriptionCoordinateAxis2D(NetcdfDataset ncd, VariableDS vds) Deprecated.Use CoordinateAxis2D.builder() -
Method Summary
Modifier and TypeMethodDescriptionstatic CoordinateAxis2D.Builder<?>builder()Get Builder for this class that allows subclassing.intfindTimeIndexFromCalendarDate(int run_idx, CalendarDate want) Only call if isInterval()doublegetCoordValue(int j, int i) Get the coordinate value at the i, j index.double[]Get the coordinate values as a 1D double array, in canonical order.getEdges()Deprecated.use getEdges()Deprecated.use getEdges()booleanAn interval coordinate consists of two numbers, bound1 and bound2.static ArrayDouble.D2makeEdges(ArrayDouble.D2 midpoints) Normal case: do something reasonable in deciding on the edges when we have the midpoints of a 2D coordinate.static ArrayDouble.D2Experimental: for WRF rotated (NMM "E") Gridsstatic ArrayDouble.D2Experimental: for WRF rotated (NMM "E") GridsCreate a new CoordinateAxis2D as a section of this CoordinateAxis2D.Turn into a mutable Builder.Methods inherited from class ucar.nc2.dataset.CoordinateAxis
copyNoCache, equals, factory, fromVariableDS, getAxisType, getBoundaryRef, getCalendarFromAttribute, getInfo, getMaxValue, getMinValue, getPositive, getUnitsString, hashCode, isContiguous, isIndependentCoordinate, isNumeric, setAxisType, setBoundaryRef, setPositiveMethods inherited from class ucar.nc2.dataset.VariableDS
addCoordinateSystem, addEnhancement, 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, toStringDebugMethods inherited from class ucar.nc2.Variable
addAll, addAttribute, attributes, compareTo, createNewCache, 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, 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, writeCDLMethods inherited from class ucar.nc2.CDMNode
annotate, annotation, getDODSName, getFullNameEscaped, getGroup, getImmutable, getName, getShortName, getSort, localhash, setDODSName, setParentStructure, setShortName, setSort, unwrapMethods inherited from interface ucar.nc2.AttributeContainer
findAttValueIgnoreCase, getName, hasAttribute, hasAttributeIgnoreCase, iteratorMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface ucar.nc2.dataset.VariableEnhanced
getFullName, getShortNameMethods inherited from interface ucar.nc2.VariableSimpleIF
getName, getShortName
-
Constructor Details
-
CoordinateAxis2D
Deprecated.Use CoordinateAxis2D.builder()Create a 2D coordinate axis from an existing VariableDS- Parameters:
ncd- the containing datasetvds- create it from here
-
-
Method Details
-
getCoordValue
public double getCoordValue(int j, int i) Get the coordinate value at the i, j index.- Parameters:
i- index 0 (fastest varying, right-most)j- index 1- Returns:
- midpoint.get(j, i).
-
isInterval
public boolean isInterval()Description copied from class:CoordinateAxisAn 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.- Overrides:
isIntervalin classCoordinateAxis- Returns:
- true if its an interval coordinate.
-
getCoordValues
public double[] getCoordValues()Get the coordinate values as a 1D double array, in canonical order.- Returns:
- coordinate values
- Throws:
UnsupportedOperationException- if !isNumeric()
-
section
Create a new CoordinateAxis2D as a section of this CoordinateAxis2D.- Parameters:
r1- the section on the first indexr2- the section on the second index- Returns:
- a section of this CoordinateAxis2D
- Throws:
InvalidRangeException- if specified Ranges are invalid
-
getCoordValuesArray
-
getCoordBoundsArray
Only call if isInterval()- Returns:
- bounds array pr null if not an interval
-
getEdges
-
getXEdges
Deprecated.use getEdges() -
getYEdges
Deprecated.use getEdges() -
makeEdges
Normal case: do something reasonable in deciding on the edges when we have the midpoints of a 2D coordinate.- Parameters:
midpoints- values of midpoints with shape (ny, nx)- Returns:
- values of edges with shape (ny+1, nx+1)
-
makeXEdgesRotated
Experimental: for WRF rotated (NMM "E") Grids- Parameters:
midx- x coordinates of midpoints- Returns:
- x coordinates of edges with shape (ny+2, nx+1)
-
makeYEdgesRotated
Experimental: for WRF rotated (NMM "E") Grids- Parameters:
midy- y coordinates of midpoints- Returns:
- y coordinates of edges with shape (ny+2, nx+1)
-
getCoordinateAxisTimeHelper
-
findTimeIndexFromCalendarDate
-
toBuilder
Description copied from class:VariableTurn into a mutable Builder. Can use toBuilder().build() to copy.- Overrides:
toBuilderin classCoordinateAxis
-
builder
Get Builder for this class that allows subclassing.- See Also:
-
- "https://community.oracle.com/blogs/emcmanus/2010/10/24/using-builder-pattern-subclasses"
-