Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
Download the files

These examples show how to define a message/subset filter for BUFR files in CodesUI.

Tip

These conditions are combined together by logical AND operator. So a message/subset is only filtered when all the conditions are matched.

Filter by keys from header section

Accessing the header section is fast since the message data does not have to be expanded.

Filter by message index

Filter only the first message No 1 from the file .(message indexing starts at 1):

Code Block
message_index: 1

...

Filter only message No 1, 2 and 10 from the file.:

Code Block
message_index: 1/2/10

Filter by date and time

Note

Please note that temporal filtering is based on the first date and time values present in the data section of the BUFR message/subset.

Filter by single date and time

Here we select only messages/subsets with a given date and time:

Code Block
data_mode: window
date: 20090123
time: 13
window: 0

Filter by time only

The date component can be omitted:

Code Block
data_mode: window
date: ANY
time: 13
window: 0

Filter by time window

...

Code Block
data_mode: window
date: 20090123
time: 13
window: 1

Filter by period

Here we set a 1 minute time window of either side of the specified date and timeselect the messages/subsets within the given time period:

Code Block
data_mode: period
date_1: 20090123
time_1: 1258
date_2: 20090123
time_2: 1301

Filter by area

Note

Please note that location filtering is based on the first location values present in the data section of the BUFR message/subset.

This is how to select messages in a given area:

Code Block
west: -10
east: -405
north: 60 
south: 4950

Filter by identifier

Filter by WMO station

Select messages/subsets by WMO identifier:

Code Block
identifier: WMO Stationstation
identifier_value: 12843/12845


Note

Please note that WMO station is not a valid BUFR key but a compound one defined for your convenience. It is defined as follows:

WMO station = blockNumber * 1000 + stationNumber

Filter by other identifiers

Select aircraft messages by identifier:

Code Block
identifier: aircraftFlightNumber
identifier_value: QGOBTRRA

Filter by custom conditions

A custom condition means that we can use any BUFR key from the message/subset to pose a filter condition. The examples below are all valid for classic radiosonde observation data which has multiple temperature, humidity and wins speed values on various pressure levels:

Image Added

Filter by custom condition with value

This is how to select the messages where there is any temperature value less than 280 K:

Code Block
custom_condition_count: 1
custom_key_1: airTemperature
custom_operator_1: <
custom_value_1: 280

Filter by custom condition with rank

This is how to select the messages where the first (rank=1) temperature value less than 280 K:

Code Block
custom_condition_count: 1
custom_key_1: airTemperature
custom_rank_1: 1
custom_operator_1: <
custom_value_1: 280

Filter by custom condition with range

This is how to select the messages where the first (rank=1) temperature value is between 280-300K:

Code Block
custom_condition_count: 1
custom_key_1: airTemperature
custom_rank_1: 1
custom_operator_1: in_range
custom_value_1: 280/300

Filter by custom condition with excluded range

This is how to select the messages where the first (rank=1) temperature value is outside the 280-300K range:

Code Block
custom_condition_count: 1
custom_key_1: airTemperature
custom_rank_1: 1
custom_operator_1: not_in_range
custom_value_1: 280/300

Filter by multiple custom conditions

This is how to select the messages where the first (rank=1) temperature value is less than 280K and the first windspeed value is greater than 10 m/s:

Code Block
custom_condition_count: 2
custom_key_1: airTemperature
custom_rank_1: 1
custom_operator_1: <
custom_value_1: 280
custom_key_2: windSpeed
custom_rank_2: 1
custom_operator_2: >
custom_value_2: 10