Package noaa.coastwatch.io
Class CWHDFReader
java.lang.Object
noaa.coastwatch.io.EarthDataReader
noaa.coastwatch.io.HDFReader
noaa.coastwatch.io.CWHDFReader
- All Implemented Interfaces:
HDFSD
A CWHDF reader is an earth data reader that reads CoastWatch
HDF format files using the HDF library class.
- Since:
- 3.1.0
- Author:
- Peter Hollemans
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
Swath maximum polynomial size in kilometers.Fields inherited from class noaa.coastwatch.io.EarthDataReader
dataProjection, info, rawMetadataMap, variables
-
Constructor Summary
ConstructorDescriptionCWHDFReader
(String file) Constructs a CWHDF reader from the specified file.CWHDFReader
(CWHDFWriter writer) Constructs a CWHDF reader from the specified writer. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines the ability of the file format to have its navigation updated.Gets the data format description.protected EarthDataInfo
Reads the earth data info metadata.static double
getMetaVersion
(int sdid) Gets the CoastWatch HDF metadata version.protected boolean
Returns true so that the parent is instructed to read all global and variable attributes.void
updateNavigation
(List variableNames, AffineTransform affine) Updates the navigation transform for the specified list of variables.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
Methods inherited from class noaa.coastwatch.io.EarthDataReader
containsVariable, finalize, getAllGrids, getAllVariables, getCoordinateSystems, getIndex, getInfo, getName, getPreview, getPreview, getRawMetadata, getRawMetadata, getSceneTime, getSource, getStatistics, getStatisticsVariables, getVariable, getVariables, getVariablesForSystem, putStatistics, setDataProjection, setUnitsMap
-
Field Details
-
SWATH_POLY_SIZE
public static final double SWATH_POLY_SIZESwath maximum polynomial size in kilometers.- See Also:
-
-
Constructor Details
-
CWHDFReader
public CWHDFReader(CWHDFWriter writer) throws hdf.hdflib.HDFException, IOException, NoninvertibleTransformException, ClassNotFoundException Constructs a CWHDF reader from the specified writer.- Parameters:
writer
- the writer to use for reading.- 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.
-
CWHDFReader
public CWHDFReader(String file) throws hdf.hdflib.HDFException, IOException, NoninvertibleTransformException, ClassNotFoundException Constructs a CWHDF reader from the specified file.- Parameters:
file
- the file name to read.- 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.
-
-
Method Details
-
getDataFormat
Gets the data format description.- Specified by:
getDataFormat
in classEarthDataReader
-
getMetaVersion
public static double getMetaVersion(int sdid) Gets the CoastWatch HDF metadata version.- Parameters:
sdid
- the HDF scientific dataset ID.- Returns:
- the metadata version. If no metadata attribute can be found, the metadata version is assumed to be 2.3.
-
readAllMetadata
protected boolean readAllMetadata()Returns true so that the parent is instructed to read all global and variable attributes.- Overrides:
readAllMetadata
in classHDFReader
- Returns:
- true if full metadata should be read, or false if not.
-
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.
-