public class CommonDataModelNCReader extends NCReader
CommonDataModelNCReader
class reads Java NetCDF API
accessible datasets and attempts to use any metadata and
geographic referencing information that the NetCDF layer
provides. If a data variable is found that has two geographic
axes but also time and/or level axes, the variable data is
expanded to a series of 2D variables by extending the variable
name for each non-geographic axis. Datasets must:
dataProjection, info, rawMetadataMap, variables
Constructor and Description |
---|
CommonDataModelNCReader(java.lang.String name)
Creates a new reader from the specified file.
|
Modifier and Type | Method and Description |
---|---|
protected DataVariable |
getActualVariable(int index)
Gets the actual variable with data.
|
java.lang.String |
getDataFormat()
Gets the data format description.
|
Grid |
getGridSubset(java.lang.String varName,
int[] start,
int[] stride,
int[] length)
Reads a subset of a data grid.
|
protected DataVariable |
getPreviewImpl(int index)
Implementation for the subclass.
|
protected void |
initializeReader()
Performs reader initialization after the dataset has been opened.
|
close, getAttribute, getAttribute, getAttribute, getAttributeAsArray, getAttributeAsArray, getAttributeAsArray, getCoordinateSystems, getDataset, getFilename, getVariable, getVariablesForSystem, isNetwork
canUpdateNavigation, finalize, getAllGrids, getAllVariables, getIndex, getInfo, getName, getPreview, getPreview, getRawMetadata, getSceneTime, getSource, getStatistics, getStatisticsVariables, getVariable, getVariables, putStatistics, setDataProjection, setUnitsMap, updateNavigation
public CommonDataModelNCReader(java.lang.String name) throws java.io.IOException
name
- the file name or URL to read.java.io.IOException
- if an error occurred reading the metadata.public java.lang.String getDataFormat()
getDataFormat
in class EarthDataReader
protected void initializeReader() throws java.io.IOException
NCReader
initializeReader
in class NCReader
java.io.IOException
- if an error occurred on initialization.protected DataVariable getPreviewImpl(int index) throws java.io.IOException
EarthDataReader
getPreviewImpl
in class EarthDataReader
java.io.IOException
EarthDataReader.getPreview(int)
protected DataVariable getActualVariable(int index) throws java.io.IOException
NCReader
NCReader.getVariable(int)
for the
required behaviour.getActualVariable
in class NCReader
java.io.IOException
public Grid getGridSubset(java.lang.String varName, int[] start, int[] stride, int[] length) throws java.io.IOException
GridSubsetReader
EarthDataReader.getVariable(String)
method except that it reads
only grid variables and is capable of returning just a subset of
the data values. In some cases, such as across a network
connection, it may be more efficient to access only a subset or
subsampling of data in a variable.getGridSubset
in interface GridSubsetReader
getGridSubset
in class NCReader
varName
- the variable name to access.start
- the 2D starting data coordinates.stride
- the 2D data stride.length
- the total number of values to read in each dimension.java.io.IOException
- if the data source had I/O errors.