Class TLcdBUFRModelDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable,ILcdModelDecoder,ILcdStatusSource
- SIGWX
SIGWX
SIGWX BUFR files contain forecast information that are used for flight planning. The BUFR messages in a BUFR file with SIGWX weather features should be structured according to one of the following SWH or SWM SIGWX formats:- JETS - Jet-streams
- M-JETS - SWM jet-streams
- CAT - Clear Air Turbulence (C.A.T.)
- M-CAT - SWM Clear Air Turbulence (C.A.T.)
- CLOUD - Embedded Cumulonimbus
- M-CLOUD - SWM cloud, in-cloud icing and turbulence
- TROP - Tropopause height
- M-TROP - SWM Tropopause height
- V_T_S - Tropical cyclone, Sandstorms, Volcanoes, Radiation incidents
| Headers | Weather Features |
|---|---|
| JUWE96 EGRR, JUWE96 KKCI, JUTE00 EGRR, JUTE00 KKCI | Jet-streams |
| JUCE00 EGRR, JUCE00 KKCI, JUME00 EGRR, JUME00 KKCI | Clear Air Turbulence |
| JUBE99 EGRR, JUBE99 KKCI, JUNE00 EGRR, JUNE00 KKCI | Clouds |
| JUTE97 EGRR, JUTE97 KKCI, JUOE00 EGRR, JUOE00 KKCI | Tropopause heights |
| JUVE00 EGRR, JUVE00 KKCI | Storms, volcanic clouds, radiation incidents |
| JUFE00 EGRR, JUFE00 KKCI, JUJE00 EGRR, JUJE00 KKCI | No weather features |
Input
| File | Required | Entry point | Description |
|---|---|---|---|
| *.bufr, *.bin, no extension | x | x |
The BUFR file |
Supported file transfer protocols
- This model decoder decodes data from a file system.
Model structure
- This model decoder creates a model for every BUFR subset.
- If the input BUFR file has more than one message or subset, the resulting model is an
ILcdModelTreeNode. - All models returned by this model decoder implement
ILcd2DBoundsIndexedModel.
Model descriptor
- If SIGWX weather features are decoded, the model descriptor will be
TLcdSIGWXModelDescriptor. This descriptor will include the SIGWX header information like forecast data and height level boundaries. - The type name of the model descriptor is the display name of this decoder.
Model reference
- All models returned by this model decoder have a
TLcdGeodeticReference. This cannot be changed.
Model elements
- Each decoded leaf model contains elements that implement
ILcdDataObject.
For BUFR files containing SIGWX data, see
TLcdSIGWXDataTypes for the possible weather features and their properties.
Sample code
ILcdModelDecoder decoder = new TLcdBUFRModelDecoder();
ILcdModel model = decoder.decode("file.bufr");
Thread safety
- The decoded models are thread-safe for read access when taking a
read lock.
Supported versions and specifications
The BUFR file has to adhere to the following requirements:
- The edition of the BUFR file should be 2, 3 or 4.
- The BUFR file should use the Meteorology master table defined by the WMO.
- SIGWX data in the BUFR files should follow the requirements laid out in edition 19 of the ICAO Annex 3.
Known limitations
- This model decoder assumes that all coordinates in a BUFR file use the WSG84 reference. It is not possible to change this.
- Since:
- 2020.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStatusListener(ILcdStatusListener aListener) Registers the given listener so it will receive status events from this source.booleancanDecodeSource(String aSourceName) Checks whether this model decoder can decode the specified data source.Creates a new model from the given data source.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder.Returns the input stream factory that is used.voidremoveStatusListener(ILcdStatusListener aListener) Removes the specified listener so it is no longer notified.voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory to be used.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Field Details
-
BUFR_TYPE_NAME
The type name for BUFR data. The model descriptor of models decoded by this decoder will have the type name set to this value.
This constant can be used to check if a model has BUFR data. Note that an instanceof check on the model descriptor can be used to determine the specific data type (e.g. SIGWX data will have a
TLcdSIGWXModelDescriptoras the model descriptor).- See Also:
-
-
Constructor Details
-
TLcdBUFRModelDecoder
public TLcdBUFRModelDecoder()Create a new decoder instance.
-
-
Method Details
-
getDisplayName
Description copied from interface:ILcdModelDecoderReturns a short, displayable name for the format that is decoded by thisILcdModelDecoder.- Specified by:
getDisplayNamein interfaceILcdModelDecoder- Returns:
- the displayable name of this
ILcdModelDecoder.
-
canDecodeSource
Description copied from interface:ILcdModelDecoderChecks whether this model decoder can decode the specified data source. It is acceptable for this method to returntruefor a source name whiledecodethrows 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:
canDecodeSourcein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be verified; typically a file name or a URL.- Returns:
trueif this decoder can likely decode the data specified by the source name,falseotherwise.- See Also:
-
decode
Description copied from interface:ILcdModelDecoderCreates a new model from the given data source.- Specified by:
decodein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
nullis 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:
-
addStatusListener
Description copied from interface:ILcdStatusSourceRegisters the given listener so it will receive status events from this source.
In case you need to register a listener which keeps a reference to an object with a shorter life-time than this status source, you can use a
ALcdWeakStatusListenerinstance as status listener.- Specified by:
addStatusListenerin interfaceILcdStatusSource- Parameters:
aListener- The listener to be notified when the status has changed.
-
removeStatusListener
Description copied from interface:ILcdStatusSourceRemoves the specified listener so it is no longer notified.- Specified by:
removeStatusListenerin interfaceILcdStatusSource- Parameters:
aListener- The listener to remove.
-
setInputStreamFactory
Sets the input stream factory to be used. When the input stream factory is set,- This model decoder reads all the data from the created stream and stores it in a temporary file. The temporary
file is created by
File.createTempFile(String, String)in the OS temporary files directory. - The temporary file is used as the BUFR source file.
- The temporary file is deleted either when the root NetCDF model is disposed or JVM terminates normally.
- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aInputStreamFactory- the input stream factory to be used.- See Also:
- This model decoder reads all the data from the created stream and stores it in a temporary file. The temporary
file is created by
-
getInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapableReturns the input stream factory that is used.- Specified by:
getInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Returns:
- the input stream factory that is used.
-