Package noaa.coastwatch.io
Class CWCFNCReader
java.lang.Object
noaa.coastwatch.io.EarthDataReader
noaa.coastwatch.io.NCReader
noaa.coastwatch.io.CWCFNCReader
- All Implemented Interfaces:
GridSubsetReader,NCSD
The CWCFNCReader class reads Java NetCDF accessible
datasets and uses the CoastWatch HDF metadata conventions to parse
the attribute and variable data. Only map projected data is supported.
The presence of the following global attributes is used to recognize
the file as having CoastWatch-specific metadata (see the user's guide
metadata appendix for more details on each attribute):
cw:cwhdf_version(string, optional) - The CoastWatch HDF metadata version number, defaults to 2.3. This attribute is highly recommended so that thecw:et_affineattribute is interpreted correctly. If in doubt, use 3.4.cw:satellite(string, optional) - The satellite name, default is to use the CFsourceattribute.cw:sensor(string, optional) - The sensor name, default is to use the CFsourceattribute.cw:origin(string, optional) - The data origin, default is to use the CFinstitutionattribute.cw:pass_date(int, REQUIRED) - The single value or array of dates of data recording (days since Jan 1, 1970).cw:start_time(double, REQUIRED) - The single value or array of start times of data recording (seconds since 00:00:00 UTC).cw:temporal_extent(double, optional) - The single value or array of durations in seconds of data recording.cw:gctp_sys(int, REQUIRED) - The GCTP projection system code.cw:gctp_zone(int, REQUIRED) - The GCTP UTM projection zone code (can be zero).cw:gctp_parm(double array, REQUIRED) - The array of GCTP projection parameters (15).cw:gctp_datum(int, REQUIRED) - The GCTP datum code.cw:et_affine(double array, REQUIRED) - The map projection affine transform.
On a per-variable basis, the cw:fraction_digits and
cw:nav_affine attributes are also used if found, but are not
required. Note that if any required or optional attributes are found to
have an incorrect data type, the file will not be recognized.
- Since:
- 3.3.0
- Author:
- Xiaoming Liu
-
Field Summary
Fields inherited from class noaa.coastwatch.io.EarthDataReader
dataProjection, info, rawMetadataMap, variables -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DataVariablegetActualVariable(int index) Gets the actual variable with data.Gets the data format description.doubleGets the CoastWatch HDF metadata version for this dataset.protected DataVariablegetPreviewImpl(int index) Implementation for the subclass.protected voidPerforms reader initialization after the dataset has been opened.Methods inherited from class noaa.coastwatch.io.NCReader
close, convertAttributeValue, getAttribute, getAttribute, getAttribute, getAttributeAsArray, getAttributeAsArray, getAttributeAsArray, getCoordinateSystems, getDataset, getFilename, getGridSubset, getRawMetadata, getReferencedFile, getVariable, getVariablesForSystem, isNetworkMethods inherited from class noaa.coastwatch.io.EarthDataReader
canUpdateNavigation, containsVariable, finalize, findVariable, getAllGrids, getAllVariables, getChunkProducer, getIndex, getInfo, getName, getPreview, getPreview, getRawMetadata, getSceneTime, getSource, getStatistics, getStatisticsVariables, getVariable, getVariables, putStatistics, setDataProjection, setUnitsMap, updateNavigation
-
Constructor Details
-
CWCFNCReader
Creates a new reader from the specified file.- Parameters:
name- the file name or URL to read.- Throws:
IOException- if an error occurred reading the metadata.
-
-
Method Details
-
getDataFormat
Gets the data format description.- Specified by:
getDataFormatin classEarthDataReader
-
getMetaVersion
public double getMetaVersion()Gets the CoastWatch HDF metadata version for this dataset.- Returns:
- the metadata version. If no metadata attribute can be found, the metadata version is assumed to be 2.3.
-
initializeReader
Description copied from class:NCReaderPerforms reader initialization after the dataset has been opened.- Overrides:
initializeReaderin classNCReader- Throws:
IOException- if an error occurred on initialization.
-
getPreviewImpl
Description copied from class:EarthDataReaderImplementation for the subclass.- Specified by:
getPreviewImplin classEarthDataReader- Throws:
IOException- See Also:
-
getActualVariable
Description copied from class:NCReaderGets the actual variable with data. This method should be implemented in the child class and is only called if the variable is not already in the cache. SeeNCReader.getVariable(int)for the required behaviour.- Specified by:
getActualVariablein classNCReader- Throws:
IOException
-