public class TSHDFReader extends HDFReader
A TSHDFReader
reads SeaSpace TeraScan HDF format
files using the HDF library class. TeraScan HDF files are created
using the TeraScan command 'tdftohdf'. This class has been tested
using TeraScan versions 3.1 and 3.2 -- see the SeaSpace web site for
information on TeraScan and current versions.
Currently only a subset of TeraScan datasets are supported. In particular:
When a TeraScan HDF dataset is accessed, only attributes that
are required by the reader class are actually read -- for example
the date and time information, the projection, the variable scaling
factors, and so on. Other TeraScan user-defined attributes are
ignored. To make up for this problem, there is a mechanism that
forces the user-defined attributes to be read into the attribute
maps held by the reader (accessed via
EarthDataReader.getInfo().getMetadataMap()
) and by the
variables (accessed by DataVariable.getMetadataMap()
).
If the user defines a string attribute named
import_atts
(using setattr
for example)
which contains a slash-separated list of attribute names, then
those attributes listed will be imported into the metadata maps.
The import_atts
attribute can be defined for a
dataset, or for a variable and it will be handled accordingly.
This mechanism allows tools like cwimport to import attributes from
TeraScan-produced datasets and preserve the user-defined attributes
that are of value to the user.
Modifier and Type | Field and Description |
---|---|
static double |
SWATH_POLY_SIZE
Swath polynomial size in kilometers.
|
dataProjection, info, rawMetadataMap, variables
Constructor and Description |
---|
TSHDFReader(java.lang.String file)
Constructs a TSHDF reader from the specified file.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDataFormat()
Gets the data format description.
|
protected EarthDataInfo |
getGlobalInfo()
Reads the earth data info metadata.
|
DataVariable |
getPreview(int index)
Creates a data variable preview.
|
close, getAttribute, getAttribute, getAttributeAsArray, getAttributeAsArray, getAttributes, getAttributes, getChunkLengths, getClass, getFilename, getPreviewImpl, getSDID, getUnsigned, getVariable, getVariableDimensions, getVariableNames, readAllMetadata
canUpdateNavigation, finalize, getAllGrids, getAllVariables, getCoordinateSystems, getIndex, getInfo, getName, getPreview, getRawMetadata, getSceneTime, getSource, getStatistics, getStatisticsVariables, getVariable, getVariables, getVariablesForSystem, putStatistics, setDataProjection, setUnitsMap, updateNavigation
public static final double SWATH_POLY_SIZE
public TSHDFReader(java.lang.String file) throws java.io.IOException
file
- the file name to read.java.io.IOException
- if an error opening or reading the file
metadata.public java.lang.String getDataFormat()
getDataFormat
in class EarthDataReader
protected EarthDataInfo getGlobalInfo() throws hdf.hdflib.HDFException, java.io.IOException, java.awt.geom.NoninvertibleTransformException, java.lang.ClassNotFoundException
HDFReader
getGlobalInfo
in class HDFReader
hdf.hdflib.HDFException
- if an error occurred in an HDF routine.java.io.IOException
- if an error occurred reading the file metadata.java.awt.geom.NoninvertibleTransformException
- if the earth transform object
could not be initialized.java.lang.ClassNotFoundException
- if the HDF attribute type is unknown.public DataVariable getPreview(int index) throws java.io.IOException
EarthDataReader
getPreview
in class EarthDataReader
index
- the index of the variable to preview. Indexing
starts at 0.java.io.IOException
- if the data source had I/O errors.EarthDataReader.getVariable(int)