Class TSHDFReader
- All Implemented Interfaces:
HDFSD
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:
- Sensor scan data with pre-computed double precision latitude and longitude variables in degrees.
- Mapped projection data in 'mercator', 'emercator', 'polarstereo', and 'rectangular' projections. The spheroid used is detected automatically from the TeraScan spheroid parameters.
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.
- Since:
- 3.1.0
- Author:
- Peter Hollemans
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
Swath polynomial size in kilometers.Fields inherited from class noaa.coastwatch.io.EarthDataReader
dataProjection, info, rawMetadataMap, variables
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the data format description.protected EarthDataInfo
Reads the earth data info metadata.getPreview
(int index) Creates a data variable preview.Methods inherited from class noaa.coastwatch.io.HDFReader
close, getAttribute, getAttribute, getAttributeAsArray, getAttributeAsArray, getAttributes, getAttributes, getChunkLengths, getChunkProducer, getClass, getFilename, getPreviewImpl, getSDID, getUnsigned, getVariable, getVariableDimensions, getVariableNames, readAllMetadata
Methods inherited from class noaa.coastwatch.io.EarthDataReader
canUpdateNavigation, containsVariable, finalize, getAllGrids, getAllVariables, getCoordinateSystems, getIndex, getInfo, getName, getPreview, getRawMetadata, getRawMetadata, getSceneTime, getSource, getStatistics, getStatisticsVariables, getVariable, getVariables, getVariablesForSystem, putStatistics, setDataProjection, setUnitsMap, updateNavigation
-
Field Details
-
SWATH_POLY_SIZE
public static final double SWATH_POLY_SIZESwath polynomial size in kilometers.- See Also:
-
-
Constructor Details
-
TSHDFReader
Constructs a TSHDF reader from the specified file.- Parameters:
file
- the file name to read.- Throws:
IOException
- if an error opening or reading the file metadata.
-
-
Method Details
-
getDataFormat
Gets the data format description.- Specified by:
getDataFormat
in classEarthDataReader
-
getGlobalInfo
protected EarthDataInfo getGlobalInfo() throws hdf.hdflib.HDFException, IOException, NoninvertibleTransformException, ClassNotFoundExceptionDescription copied from class:HDFReader
Reads the earth data info metadata.- Specified by:
getGlobalInfo
in classHDFReader
- Returns:
- the earth data info object.
- Throws:
hdf.hdflib.HDFException
- if an error occurred in an HDF routine.IOException
- if an error occurred reading the file metadata.NoninvertibleTransformException
- if the earth transform object could not be initialized.ClassNotFoundException
- if the HDF attribute type is unknown.
-
getPreview
Description copied from class:EarthDataReader
Creates a data variable preview. A preview contains all metadata but no data value array. The preview can be used in a filtering loop to determine if the reading of the variable data is desired, as I/O can be a time-intensive operation.- Overrides:
getPreview
in classEarthDataReader
- Parameters:
index
- the index of the variable to preview. Indexing starts at 0.- Returns:
- a data variable object with data value array of length 1.
- Throws:
IOException
- if the data source had I/O errors.- See Also:
-