Class TLcdGRIBBulletinModelDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable
,ILcdModelDecoder
ILcdModelDecoder
decodes GRIB bulletin files containing
multiple GRIB messages.
The GRIB messages in GRIB bulletins can optionally have headers, as defined by the WMO. A WMO header contains the following information about its corresponding message:
- a GRIB indicator (always 'H' for GRIB data),
- a component indicator (wind, temperature, humidity,...),
- an area indicator (octant of the world),
- a forecast indicator (number of hours in the future), and
- a pressure level indicator (between 850 and 100 hPa, corresponding to FL 50 and 530).
Individual GRIB messages can be filtered before being decoded, based on
their WMO headers, or after having been decoded, based on the decoded GRIB
model descriptors; see
setGRIBBulletinHeaderFilter(ILcdGRIBBulletinHeaderFilter)
and
setGRIBBulletinFilter(ILcdGRIBBulletinFilter)
.
The decoded model is a TLcd2DBoundsIndexedModelList
(or optionally
an ILcdModelTreeNode
) containing an ILcdModel
for each
GRIB message in the bulletin. The contained GRIB messages are decoded with
the
.
Each message is therefore represented by an TLcdGRIBModelDecoder
ILcdModel
with a
TLcdGRIBModelDescriptor
.
In the case of GRIB2 messages containing multiple datasets, this model will be
an ILcdModelContainer
that contains multiple models.
For messages containing a single dataset, the model will contain one ILcdRaster
with one ILcdTile
.
The ILcdModelDescriptor
of the decoded model is a
.TLcdGRIBBulletinModelDescriptor
- Since:
- 7.0.17
-
Constructor Summary
ConstructorDescriptionDeprecated.Creates a newTLcdGRIBBulletinModelDecoder
, with a globally shared buffer for caching tiles.TLcdGRIBBulletinModelDecoder
(ILcdBuffer aBuffer) Deprecated.Creates a newTLcdGRIBBulletinModelDecoder
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameterTable
(ILcdGRIBParameterTable aParameterTable) Deprecated.Adds a parameter table.void
addParameterTable
(ILcdGRIBParameterTable aParameterTable, boolean aMatchCenter) Deprecated.Adds a parameter table.boolean
canDecodeSource
(String aSourceName) Deprecated.Checks whether this model decoder can decode the specified data source.Deprecated.Creates a new model from the given data source.Deprecated.Returns the color model that is attached by default to the decoded rasters.Deprecated.Gets the default file extension of GRIB bulletins.Deprecated.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.Deprecated.Returns the filter that is used for filtering data based on the contents of the GRIB messages.Deprecated.Returns the filter that is used for for filtering based on the GRIB bulletin headers.Deprecated.Returns the input stream factory that is used for creating input streams given source names.int
Deprecated.Returns the sampling strategy that is used for displaying raster data.boolean
Deprecated.Returns whether anILcdModelTreeNode
or aTLcdModelList
is created when decoding a bulletin.boolean
Deprecated.This method has been deprecated.void
removeParameterTable
(ILcdGRIBParameterTable aParameterTable) Deprecated.Removes a parameter table.static void
setClassTraceOn
(boolean aClassTraceOn) Deprecated.This method has been deprecated.void
setColorModel
(ColorModel aColorModel) Deprecated.Sets the color model that is attached by default to the decoded rasters.void
setCreateModelTreeNodes
(boolean aCreateModelTreeNodes) Deprecated.Specifies whether anILcdModelTreeNode
or aTLcdModelList
should be created when decoding a bulletin.void
Deprecated.Sets the filter for filtering based on the contents of the GRIB messages.void
Deprecated.Sets the filter for filtering based on the GRIB bulletin headers.void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Deprecated.Sets the input stream factory that is used for creating input streams given source names.void
setSampleStrategy
(int aSampleStrategy) Deprecated.Sets the sampling strategy that is used for displaying raster data.void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Constructor Details
-
TLcdGRIBBulletinModelDecoder
public TLcdGRIBBulletinModelDecoder()Deprecated.Creates a newTLcdGRIBBulletinModelDecoder
, with a globally shared buffer for caching tiles.- See Also:
-
TLcdGRIBBulletinModelDecoder
Deprecated.Creates a newTLcdGRIBBulletinModelDecoder
.- Parameters:
aBuffer
- the shared buffer that decoded GRIB models will use.- See Also:
-
-
Method Details
-
setClassTraceOn
public static void setClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for all instances of this class. If the argument istrue
then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.- Parameters:
aClassTraceOn
- if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Parameters:
aTraceOn
- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
setInputStreamFactory
Deprecated.Sets the input stream factory that is used for creating input streams given source names.- Specified by:
setInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Parameters:
aInputStreamFactory
- The input stream factory to be used.- See Also:
-
getInputStreamFactory
Deprecated.Returns the input stream factory that is used for creating input streams given source names.- Specified by:
getInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Returns:
- The input stream factory to be used.
- See Also:
-
addParameterTable
Deprecated.Adds a parameter table. If a table with the same version, center ID, and subcenter ID already exists, it will be replaced.The decoder will first try to use the parameter table with a matching table version, center ID, and subcenter ID. If it can't find it, it it will fall back on the parameter table that only matches the table version.
- Parameters:
aParameterTable
- the parameter table to add.- See Also:
-
addParameterTable
Deprecated.Adds a parameter table. If a table with the same version, center ID, and subcenter ID already exists, it will be replaced.The decoder will first try to use the parameter table with a matching table version, center ID, and subcenter ID. If it can't find it, it it will fall back on the parameter table that only matches the table version, if non-exact matches are allowed.
- Parameters:
aParameterTable
- the parameter table to add.aMatchCenter
- a boolean flag that indicates if the center ID and subcenter ID have to match in order for this table to be used.- See Also:
-
removeParameterTable
Deprecated.Removes a parameter table.- Parameters:
aParameterTable
- the parameter table to remove.- See Also:
-
setColorModel
Deprecated.Sets the color model that is attached by default to the decoded rasters. The default isnull
.- Parameters:
aColorModel
- an 8-bit or 16-bit IndexColorModel that is compatible with the GRIB data to be decoded.- See Also:
-
getColorModel
Deprecated.Returns the color model that is attached by default to the decoded rasters.- Returns:
- The default color model used for decoded rasters.
- See Also:
-
setSampleStrategy
public void setSampleStrategy(int aSampleStrategy) Deprecated.Sets the sampling strategy that is used for displaying raster data.- Parameters:
aSampleStrategy
- one ofTLcdGRIBModelDecoder.NORTH_WEST_CORNER
,TLcdGRIBModelDecoder.SOUTH_WEST_CORNER
,TLcdGRIBModelDecoder.NORTH_EAST_CORNER
,TLcdGRIBModelDecoder.SOUTH_EAST_CORNER
,TLcdGRIBModelDecoder.MINIMUM
,TLcdGRIBModelDecoder.MAXIMUM
,TLcdGRIBModelDecoder.AVERAGE
, orTLcdGRIBModelDecoder.BILINEAR
.- See Also:
-
getSampleStrategy
public int getSampleStrategy()Deprecated.Returns the sampling strategy that is used for displaying raster data.- Returns:
- The sampling strategy that is used for displaying raster data.
- See Also:
-
setCreateModelTreeNodes
public void setCreateModelTreeNodes(boolean aCreateModelTreeNodes) Deprecated.Specifies whether anILcdModelTreeNode
or aTLcdModelList
should be created when decoding a bulletin.- Parameters:
aCreateModelTreeNodes
-true
if anILcdModelTreeNode
should be created,false
if aTLcdModelList
should be created.- See Also:
-
isCreateModelTreeNodes
public boolean isCreateModelTreeNodes()Deprecated.Returns whether anILcdModelTreeNode
or aTLcdModelList
is created when decoding a bulletin. The default isfalse
, for aTLcdModelList
.- Returns:
true
if anILcdModelTreeNode
is created when decoding a source,false
if aTLcdModelList
is be created.- See Also:
-
setGRIBBulletinHeaderFilter
Deprecated.Sets the filter for filtering based on the GRIB bulletin headers. Only GRIB messages that are accepted are added to the decoded model. The default isnull
- Parameters:
aFilter
- The filter for filtering based on the header of the GRIB messages.- See Also:
-
getGRIBBulletinHeaderFilter
Deprecated.Returns the filter that is used for for filtering based on the GRIB bulletin headers.- Returns:
- The filter for filtering based on the contents of the GRIB messages.
- See Also:
-
setGRIBBulletinFilter
Deprecated.Sets the filter for filtering based on the contents of the GRIB messages. Only GRIB messages that are accepted are added to the decoded model. The default isnull
.- Parameters:
aFilter
- The filter for filtering based on the contents of the GRIB messages.- See Also:
-
getGRIBBulletinFilter
Deprecated.Returns the filter that is used for filtering data based on the contents of the GRIB messages.- Returns:
- The filter for filtering based on the contents of the GRIB messages.
- See Also:
-
getDefaultExtension
Deprecated.Gets the default file extension of GRIB bulletins.- Returns:
- the default extension "grb".
-
getDisplayName
Deprecated.Description copied from interface:ILcdModelDecoder
Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Returns:
- "WMO GRIB bulletin".
-
canDecodeSource
Deprecated.Description copied from interface:ILcdModelDecoder
Checks whether this model decoder can decode the specified data source. It is acceptable for this method to returntrue
for a source name whiledecode
throws an exception for that same source name.For performance reasons, we strongly recommend that this will only be a simple test. For example: check the file extension of a file, but not that the file exists or contains expected content.
- Specified by:
canDecodeSource
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the data source to be verified; typically a file name or a URL.- Returns:
true
if the source name has extension "grb", "grib", "dat", "grb2" or "grib2" (possibly extended with ".gz" or ".zip").- See Also:
-
decode
Deprecated.Description copied from interface:ILcdModelDecoder
Creates a new model from the given data source.- Specified by:
decode
in interfaceILcdModelDecoder
- Parameters:
aSourceName
- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
null
is allowed, implementors are advised to throw an error instead. - Throws:
IOException
- for any exceptions caused by IO problems or invalid data. Since decoding invalid data almost always results in RunTimeExceptions (NullPointerException, IndexOutOfBoundsException, IllegalArgumentException, ...) on unexpected places, implementations are advised to catch RuntimeExceptions in their decode() method, and wrap them into an IOException, as illustrated in the code snippet below.public ILcdModel decode( String aSourceName ) throws IOException { try (InputStream input = fInputStreamFactory.createInputStream(aSourceName)) { // Perform decoding ... } catch (RuntimeException e) { throw new IOException(e); } }
- See Also:
-