public class Sequence extends Structure
Variable.Cache
defaultBufferSize, isSubset, log, memberHash, members
attributes, cache, dataType, debugCaching, defaultCoordsSizeToCache, defaultSizeToCache, dimensions, elementSize, hashCode, isMetadata, isVariableLength, ncfile, permitCaching, proxyReader, shape, shapeAsSection, sizeToCache, spiObject
annotations, dodsname, group, immutable, parentstruct, shortName, sort
Constructor and Description |
---|
Sequence(NetcdfFile ncfile,
Group group,
Structure parent,
java.lang.String shortName) |
Modifier and Type | Method and Description |
---|---|
StructureDataIterator |
getStructureIterator(int bufferSize)
Get an efficient iterator over all the data in the Structure.
|
Array |
read(int[] origin,
int[] shape)
UnsupportedOperation
|
Array |
read(java.util.List<Range> ranges)
UnsupportedOperation
|
Array |
read(Section section)
UnsupportedOperation
|
Array |
read(java.lang.String sectionSpec)
UnsupportedOperation
|
StructureData |
readStructure()
UnsupportedOperation
|
StructureData |
readStructure(int index)
UnsupportedOperation
|
ArrayStructure |
readStructure(int start,
int count)
UnsupportedOperation
|
Variable |
section(Section subsection)
UnsupportedOperation
|
Variable |
slice(int dim,
int value)
UnsupportedOperation
|
addMemberVariable, calcElementSize, calcStructureSize, copy, findVariable, getElementSize, getNameAndAttributes, getNumberOfMemberVariables, getStructureIterator, getVariableNames, getVariables, isCaching, isSubset, makeStructureMembers, removeMemberVariable, replaceMemberVariable, select, select, setCaching, setImmutable, setMemberVariables, setParentGroup, writeCDL
_read, _read, addAll, addAttribute, compareTo, createNewCache, equals, extraInfo, findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDAPName, getDAPName, getDatasetLocation, getDataType, getDescription, getDimension, getDimensions, getDimensionsAll, getDimensionsString, getEnumTypedef, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNetcdfFile, getParentGroup, getProxyReader, getRanges, getRank, getScalarData, getShape, getShape, getShapeAll, getShapeAsSection, getShapeNotScalar, getSize, getSizeToCache, getSPobject, getUnitsString, hasCachedData, hashCode, hashCodeShow, invalidateCache, isCoordinateVariable, isImmutable, isMetadata, isScalar, isUnknownLength, isUnlimited, isUnsigned, isVariableLength, lookupEnumString, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, readToByteChannel, readToStream, reallyRead, reallyRead, reduce, remove, removeAttribute, removeAttributeIgnoreCase, resetDimensions, resetShape, section, setCachedData, setCachedData, setDataType, setDimension, setDimensions, setDimensions, setDimensionsAnonymous, setElementSize, setEnumTypedef, setIsScalar, setName, setProxyReader, setSizeToCache, setSPobject, setUnsigned, setValues, setValues, toString, toStringDebug, writeCDL
annotate, getAnnotation, getAnnotations, getDODSName, getFullName, getFullNameEscaped, getGroup, getImmutable, getName, getParentStructure, getShortName, getSort, isMemberOfStructure, localhash, setDODSName, setImmutable, setParentStructure, setShortName, setSort, unwrap
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getFullName, getFullNameEscaped, getParentStructure, getShortName, isMemberOfStructure
getName
public Sequence(NetcdfFile ncfile, Group group, Structure parent, java.lang.String shortName)
public StructureDataIterator getStructureIterator(int bufferSize) throws java.io.IOException
Structure
Example: StructureDataIterator ii = structVariable.getStructureIterator(100 * 1000); while (ii.hasNext()) { StructureData sdata = ii.next(); }
getStructureIterator
in class Structure
bufferSize
- size in bytes to buffer, set < 0 to use default sizejava.io.IOException
- on read errorpublic Array read(int[] origin, int[] shape) throws java.io.IOException, InvalidRangeException
read
in interface VariableIF
read
in class Variable
origin
- int array specifying the starting index. If null, assume all zeroes.shape
- int array specifying the extents in each dimension.
This becomes the shape of the returned Array.java.lang.UnsupportedOperationException
java.io.IOException
InvalidRangeException
public Array read(java.lang.String sectionSpec) throws java.io.IOException, InvalidRangeException
read
in interface VariableIF
read
in class Variable
sectionSpec
- specification string, eg "1:2,10,:,1:100:10". May optionally have ().java.lang.UnsupportedOperationException
java.io.IOException
InvalidRangeException
for sectionSpec syntax
public Array read(java.util.List<Range> ranges) throws java.io.IOException, InvalidRangeException
read
in class Variable
ranges
- list of Range specifying the section of data to read.java.lang.UnsupportedOperationException
java.io.IOException
- if errorInvalidRangeException
- if ranges is invalidVariable.read(Section)
public Array read(Section section) throws java.io.IOException, InvalidRangeException
read
in interface VariableIF
read
in class Variable
section
- list of Range specifying the section of data to read.
Must be null or same rank as variable.
If list is null, assume all data.
Each Range corresponds to a Dimension. If the Range object is null, it means use the entire dimension.java.lang.UnsupportedOperationException
java.io.IOException
- if errorInvalidRangeException
- if section is invalidpublic StructureData readStructure() throws java.io.IOException
readStructure
in class Structure
java.lang.UnsupportedOperationException
java.io.IOException
- on read errorpublic StructureData readStructure(int index) throws java.io.IOException, InvalidRangeException
readStructure
in class Structure
index
- index into 1D arrayjava.lang.UnsupportedOperationException
java.io.IOException
- on read errorInvalidRangeException
- if index out of rangepublic ArrayStructure readStructure(int start, int count) throws java.io.IOException, InvalidRangeException
readStructure
in class Structure
start
- start at this indexcount
- return this many StructureDatajava.lang.UnsupportedOperationException
java.io.IOException
- on read errorInvalidRangeException
- if start, count out of rangepublic Variable slice(int dim, int value) throws InvalidRangeException
slice
in class Variable
dim
- which dimension to fixvalue
- at what index valuejava.lang.UnsupportedOperationException
InvalidRangeException
- if dimension or value is illegalpublic Variable section(Section subsection) throws InvalidRangeException
section
in class Variable
subsection
- Section of this variable.
Each Range in the section corresponds to a Dimension, and specifies the section of data to read in that Dimension.
A Range object may be null, which means use the entire dimension.java.lang.UnsupportedOperationException
InvalidRangeException
- if section not compatible with shape