MeteoIODoc 20261003.b9219c1f
Environmental timeseries pre-processing
Loading...
Searching...
No Matches
BUFRIO

Format

BUFR is a binary data format, that was introduced by the World Meteorological Organization (WMO) to universally store meteorological observation data. It is very flexible and powerful, but can be quite complex to handle. You can read this introduction to get an idea of what it is.

In short, a BUFR file can contain multiple messages, each of which can contain multiple subsets where the data is stored with its metadata and can be read by its respective key. Here we use keys from the WMO element table 40 to read the data. To inspect your BUFR files we recommend using either bufr tools or the metview software. These are provided by ECMWF and therefore rely on the same BUFR reading library (ecCodes) as MeteoIO.

Prior to reading the data a scan of the file is done, to find all stations in the file together with their metadata and to check if it is valid (we require a position (lat,lon,alt) and a station ID). If no station ID but a station Name is found, we use this as station ID. Additionally we require unique timepoints per station. So far only reading parameters known to MeteoIO is supported (if you need to read additional parameters, please contact the developers, as this is an option that could be supported).

Note
This plugin requires the ecCodes library in version 2.27.0 or greater to be installed. It is available at ecCodes

Writing Bufr files

It is also possible to write BUFR files. However, only writing known parameters is supported. However, it is possible to write profiles (of heights) of some parameters, i.e. air temperature, pressure and relative humidity. To do that, the parameters at different heights need to be named as {parameter name}measurement height}, for example like "TA@2" and "TA@10" for air temperatures at 2 and 10m respectively (this naming scheme has to be applied when reading the data in the [Input] section). The profile will then be written with a repetition of the parameter together with its associated heights.

The filenames are generated on the fly, as meteoio_{timestamp}.bufr, where the timestamp is the current date and time. Each datapoint is its own message as it is not possible to create subsets with eccodes.

Keywords

This plugin uses the following keywords: [Input]:

  • METEOPATH: Path to the BUFR files
  • BUFREXT: Extension of the BUFR files (default: .bufr)
  • STATION#: File name per station
  • ADDITIONAL_PARAMS: Additional parameters to read from the BUFR file, as a comma separated list of WMO element Table B keys (currently WMO Table B v40)
  • FALLBACKTZ: Fallback timezone in hours, if no timezone information is found in the BUFR file (default: GMT+0)
  • VERBOSE: Print additional information during reading (default: false) [Output]:
  • METEOPATH: Path to the BUFR files to be written
  • SEPARATESTATIONS: Write each station to a separate file (default: false)
  • SNOWDEPTHMETHOD: Method of snow depth measurement, eg 1: Ultrasonic method, 15: Missing value [default]; see Code Table 2177

Example

[INPUT]
METEO = BUFR
METEOPATH = path/to/bufr/files
BUFREXT = .bfr
ADDITIONAL_PARAMS = airTemperature, dewPointTemperature
STATION1 = example.bfr
VERBOSE = TRUE
[OUTPUT]
METEO = BUFR
METEOPATH = path/to/output
SEPARATESTATIONS = TRUE

Cryo Station

The Cryo Station is a specific BUFR Template for Cryospheric Stations containing snow/ice.. profiles. It is possible to write those, by setting CRYOSTATION = TRUE in the output section. The following additional keywords are required in the [Output] section:

  • WIGOSIDSERIES: WIGOS ID Series (0-15)
  • WIGOSISSUER: WIGOS Issuer
  • WIGOSISSUENO: WIGOS Issue Number
  • WIGOSLOCALID: WIGOS Local ID
  • STATIONTYPE: Station Type (default: 3)
  • SURFACETYPE: Surface Type (default: 255) The station type and surface type are WMO codes, and can be found in the Flag Tables

Supported Parameters

The Cryo Station follows a specific template, where some parameters are not MeteoIO standard parameters. Additionally, some MeteoIO parameters are not supported by the Cryo Station (e.g. VW, ISWR...). Therefore we list the parameters that can be written, with their representation in MeteoIO (which should be the parameter name in the input file).

Note
Be careful when using TSS and TSURFACE simultaneously, as this will lead to undefined behaviour!
Single parametersParameters suitable for profiles
Parameter nameDescriptionReferenceParameter nameDescriptionReference
ICE_THICKNESSIce Thickness in mSENSORTYPESensor TypeFlag table
GROUNDSTATEGround StateBufr table TAAir Temperaturemeteoio
HSSnow Depth in mmeteoio TSNOWSnow Temperature
SURFACEQUALIFIERSurface Qualifier for Temperature DataBufr table TSOILSoil Temperature in Kmeteoio
TSSSkin/Surface Temperature in Kmeteoio TWATERWater Temperature in K
TICEIce Temperature in K

Surface Type

Available surface types are summarized in the table below.

Surface type codeDescriptionSurface type codeDescription
0open ocean or semi-enclosed sea 12lake
1enclosed sea or lake 13sea
2continental ice 14glacier
3land 15urban land
4low inland (below sea level) 16rural land
5mix of land and water 17suburban land
6mix of land and low inland 18sea ice
11river 255missing value

Station Type

Available station types are:

  • 0: Automatic
  • 1: Manned
  • 2: Hybrid
  • 3: Missing Value

Snow Depth Method

Available snow depth methods can be found at https://confluence.ecmwf.int/display/ECC/WMO%3D40+code-flag+table#WMO=40codeflagtable-CF_002177

Note
the given flags in these sub section might be outdated, as this is not regularly updated

Developer Notes

If additional parameters need to be written to BUFR:

  • Add the parameter to the constant maps in libcodes.cc
  • Make Sure to handle specifics of parametrs in setMeteoData or setCryoData
  • Add the parameter to the POSSIBLE_MULTIPLE_PARAMETERS vector if needed The descriptor can be complete BUFR sequences, however, as soon as a parameter appears twice in two different sequences, it will silentyly fail, and only the first descriptor is used. So be careful that each parameter only appears once.
  • We might need the flexibility to add parameters outside of the cryo template, a way to flexibly add standard parameters
    Todo:
    The Cryo parameters which will be added to the WMO table need to be changed when available ( look for TODO in libcodes.cc)

For now Wigos id... metadata has to be set by ini, maybe make it available as StationData Additionally, some parameters from the Cryo Station are not standard parameters, so they wont be handled-> needs a solution

Note
If writing arbitrary parameters is required, we need descriptors and parameter keys, which are not hardcoded
Todo:
map precip type from code to...