Package ucar.nc2.dataset
Class CoordinateAxis1DTime
java.lang.Object
ucar.nc2.CDMNode
ucar.nc2.Variable
ucar.nc2.dataset.VariableDS
ucar.nc2.dataset.CoordinateAxis
ucar.nc2.dataset.CoordinateAxis1D
ucar.nc2.dataset.CoordinateAxis1DTime
- All Implemented Interfaces:
Comparable<VariableSimpleIF>,Iterable<Attribute>,IsMissingEvaluator,AttributeContainer,ucar.nc2.dataset.Enhancements,ucar.nc2.dataset.EnhanceScaleMissingUnsigned,VariableEnhanced,ProxyReader,VariableSimpleIF
A 1-dimensional Coordinate Axis representing Calendar time.
Its coordinate values can be represented as Dates.
May use udunit dates, or ISO Strings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from class ucar.nc2.dataset.CoordinateAxis
CoordinateAxis.AxisComparator -
Field Summary
Fields inherited from class ucar.nc2.Variable
defaultCoordsSizeToCache, defaultSizeToCache, permitCaching -
Method Summary
Modifier and TypeMethodDescriptionstatic CoordinateAxis1DTime.Builder<?>builder()Get Builder for this class that allows subclassing.static CoordinateAxis1DTimefactory(NetcdfDataset ncd, VariableDS org, Formatter errMessages) intGiven a Date, find the corresponding time index on the time coordinate axis.getCalendarDate(int idx) Get the the ith CalendarDate.Get calendar date rangeGet the list of datetimes in this coordinate as CalendarDate objects.getCoordBoundsDate(int i) getCoordBoundsMidpointDate(int i) List<ucar.nc2.util.NamedObject>getNames()only if isRegular() LOOK REDObooleanhasCalendarDate(CalendarDate date) See if the given CalendarDate appears as a coordinateCreate a new CoordinateAxis1D as a section of this CoordinateAxis1D.Turn into a mutable Builder.Methods inherited from class ucar.nc2.dataset.CoordinateAxis1D
copyNoCache, findCoordElement, findCoordElementBounded, getBound1, getBound2, getCoordBounds, getCoordBoundsMidpoint, getCoordEdge, getCoordEdges, getCoordName, getCoordValue, getCoordValues, getIncrement, getMaxEdgeValue, getMaxValue, getMinEdgeValue, getMinValue, getStart, isContiguous, isInterval, isRegularMethods inherited from class ucar.nc2.dataset.CoordinateAxis
equals, fromVariableDS, getAxisType, getBoundaryRef, getCalendarFromAttribute, getInfo, getPositive, getUnitsString, hashCode, isIndependentCoordinate, isNumericMethods 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
-
factory
public static CoordinateAxis1DTime factory(NetcdfDataset ncd, VariableDS org, Formatter errMessages) throws IOException - Throws:
IOException
-
section
Description copied from class:CoordinateAxis1DCreate a new CoordinateAxis1D as a section of this CoordinateAxis1D.- Overrides:
sectionin classCoordinateAxis1D- Parameters:
r- the section range- Returns:
- a new CoordinateAxis1D as a section of this CoordinateAxis1D
- Throws:
InvalidRangeException- if IllegalRange
-
getCalendarDate
Get the the ith CalendarDate.- Parameters:
idx- index- Returns:
- the ith CalendarDate
-
getCalendarDateRange
Get calendar date range- Returns:
- calendar date range
-
getNames
-
getTimeResolution
only if isRegular() LOOK REDO- Returns:
- time unit
- Throws:
Exception- on bad unit string
-
findTimeIndexFromCalendarDate
Given a Date, find the corresponding time index on the time coordinate axis. Can only call this is hasDate() is true. This will return- i, if time(i) <= d < time(i+1).
- 0, if d < time(0)
- n-1, if d > time(n-1), where n is length of time coordinates
- Parameters:
d- date to look for- Returns:
- corresponding time index on the time coordinate axis
- Throws:
UnsupportedOperationException- is no time axis or isDate() false
-
hasCalendarDate
See if the given CalendarDate appears as a coordinate- Parameters:
date- test this- Returns:
- true if equals a coordinate
-
getCalendarDates
Get the list of datetimes in this coordinate as CalendarDate objects.- Returns:
- list of CalendarDates.
-
getCoordBoundsDate
-
getCoordBoundsMidpointDate
-
toBuilder
Description copied from class:VariableTurn into a mutable Builder. Can use toBuilder().build() to copy.- Overrides:
toBuilderin classCoordinateAxis1D
-
builder
Get Builder for this class that allows subclassing.- See Also:
-
- "https://community.oracle.com/blogs/emcmanus/2010/10/24/using-builder-pattern-subclasses"
-