ucar.nc2.dataset
Class CoordinateAxis1DTime
java.lang.Object
ucar.nc2.Variable
ucar.nc2.dataset.VariableDS
ucar.nc2.dataset.CoordinateAxis
ucar.nc2.dataset.CoordinateAxis1D
ucar.nc2.dataset.CoordinateAxis1DTime
- All Implemented Interfaces:
- Comparable<VariableSimpleIF>, Enhancements, EnhanceScaleMissing, VariableEnhanced, ProxyReader, VariableIF, VariableSimpleIF
public class CoordinateAxis1DTime
- extends CoordinateAxis1D
A 1-dimensional Coordinate Axis representing Calendar time.
Its coordinate values can be represented as Dates.
May use udunit dates, or ISO Strings.
- Author:
- caron
Fields inherited from class ucar.nc2.Variable |
attributes, cache, dataType, debugCaching, defaultCoordsSizeToCache, defaultSizeToCache, dimensions, elementSize, group, isMetadata, isVariableLength, ncfile, parent, proxyReader, shape, shapeAsSection, shortName, sizeToCache, spiObject |
Methods inherited from class ucar.nc2.dataset.CoordinateAxis1D |
copyNoCache, findCoordElement, findCoordElement, findCoordElementBounded, getBound1, getBound2, getCoordEdge, getCoordEdges, getCoordEdges, getCoordName, getCoordValue, getCoordValues, getIncrement, getMaxValue, getMinValue, getStart, isContiguous, isInterval, isRegular |
Methods inherited from class ucar.nc2.dataset.CoordinateAxis |
equals, factory, getAxisType, getBoundaryRef, getInfo, getPositive, getUnitsString, hashCode, isNumeric, setAxisType, setBoundaryRef, setPositive |
Methods inherited from class ucar.nc2.dataset.VariableDS |
_read, _read, addCoordinateSystem, clearCoordinateSystems, convertEnums, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, enhance, getCoordinateSystems, getDescription, getEnhanceMode, getMissingDataArray, getOriginalDataType, getOriginalName, getOriginalVariable, getUseNaNs, getValidMax, getValidMin, hasCachedDataRecurse, hasFillValue, hasInvalidData, hasMissing, hasMissingValue, hasScaleOffset, isFillValue, isInvalidData, isMissing, isMissingFast, isMissingValue, lookupEnumString, reallyRead, reallyRead, removeCoordinateSystem, setCaching, setFillValueIsMissing, setInvalidDataIsMissing, setMissingDataIsMissing, setName, setOriginalVariable, setUnitsString, setUseNaNs, showScaleMissingProxy, toStringDebug |
Methods inherited from class ucar.nc2.Variable |
addAttribute, clone, compareTo, createNewCache, extraInfo, findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDataType, getDimension, getDimensions, getDimensionsAll, getDimensionsString, getElementSize, getEnumTypedef, getFullName, getFullNameEscaped, getName, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getParentGroup, getParentStructure, getProxyReader, getRanges, getRank, getScalarData, getShape, getShape, getShapeAll, getShapeAsSection, getShortName, getSize, getSizeToCache, getSPobject, hasCachedData, invalidateCache, isCaching, isCoordinateVariable, isImmutable, isMemberOfStructure, isMetadata, isScalar, isUnknownLength, isUnlimited, isUnsigned, isVariableLength, read, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, readToByteChannel, remove, removeAttribute, removeAttributeIgnoreCase, resetDimensions, resetShape, section, section, setCachedData, setCachedData, setDataType, setDimension, setDimensions, setDimensions, setDimensionsAnonymous, setElementSize, setEnumTypedef, setImmutable, setIsScalar, setParentGroup, setParentStructure, setProxyReader, setSizeToCache, setSPobject, setValues, setValues, slice, toString, writeCDL, writeCDL |
Methods inherited from interface ucar.nc2.VariableIF |
findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDataType, getDimension, getDimensions, getDimensionsAll, getElementSize, getFullName, getFullNameEscaped, getNameAndDimensions, getParentGroup, getParentStructure, getRanges, getRank, getShape, getShapeAsSection, getShortName, getSize, isCoordinateVariable, isMemberOfStructure, isMetadata, isScalar, isUnlimited, isUnsigned, isVariableLength, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, section |
factory
public static CoordinateAxis1DTime factory(NetcdfDataset ncd,
VariableDS org,
Formatter errMessages)
throws IOException
- Throws:
IOException
copy
protected Variable copy()
- Overrides:
copy
in class CoordinateAxis1D
getTimeDates
public Date[] getTimeDates()
- Get the list of times as Dates.
- Returns:
- array of java.util.Date, or null.
getTimeDate
public Date getTimeDate(int idx)
getDateRange
public DateRange getDateRange()
getNames
public List<NamedObject> getNames()
- Description copied from class:
CoordinateAxis1D
- Get the list of names, to be used for user selection.
The ith one refers to the ith coordinate.
- Overrides:
getNames
in class CoordinateAxis1D
- Returns:
- List of ucar.nc2.util.NamedObject, or empty list.
getTimeResolution
public TimeUnit getTimeResolution()
throws Exception
- only if isRegular() LOOK REDO
- Returns:
- time unit
- Throws:
Exception
- on bad unit string
findTimeIndexFromDate
public int findTimeIndexFromDate(Date d)
- 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
hasTime
public boolean hasTime(Date date)
- See if the given Date appears is a coordinate
- Parameters:
date
- test this
- Returns:
- true if equals a coordinate
section
public CoordinateAxis1D section(Range r)
throws InvalidRangeException
- Description copied from class:
CoordinateAxis1D
- Create a new CoordinateAxis1D as a section of this CoordinateAxis1D.
- Overrides:
section
in class CoordinateAxis1D
- Parameters:
r
- the section range
- Returns:
- a new CoordinateAxis1D as a section of this CoordinateAxis1D
- Throws:
InvalidRangeException
- if IllegalRange
Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.