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,Enhancements,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.intDeprecated.use findTimeIndexFromCalendarDategetCalendarDate(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) Deprecated.use getCalendarDateRange()getNames()Get the list of names, to be used for user selection.getTimeDate(int idx) Deprecated.use getCalendarDate()Date[]Deprecated.use getCalendarDates() to correctly interpret calendarsonly if isRegular() LOOK REDObooleanhasCalendarDate(CalendarDate date) See if the given CalendarDate appears as a coordinatebooleanDeprecated.use hasCalendarDateCreate a new CoordinateAxis1D as a section of this CoordinateAxis1D.Turn into a mutable Builder.Methods inherited from class ucar.nc2.dataset.CoordinateAxis1D
copyNoCache, correctLongitudeWrap, findCoordElement, 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, factory, fromVariableDS, getAxisType, getBoundaryRef, getCalendarFromAttribute, getInfo, getPositive, getUnitsString, hashCode, 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
-
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
Description copied from class:CoordinateAxis1DGet the list of names, to be used for user selection. The ith one refers to the ith coordinate.- Overrides:
getNamesin classCoordinateAxis1D- Returns:
- List of ucar.nc2.util.NamedObject, or empty list.
-
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
-
getTimeDates
Deprecated.use getCalendarDates() to correctly interpret calendarsDoes not handle non-standard Calendars -
getTimeDate
Deprecated.use getCalendarDate()Does not handle non-standard Calendars -
getDateRange
Deprecated.use getCalendarDateRange()Does not handle non-standard Calendars -
findTimeIndexFromDate
Deprecated.use findTimeIndexFromCalendarDateDoes not handle non-standard Calendars -
hasTime
Deprecated.use hasCalendarDateDoes not handle non-standard Calendars -
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"
-