Versions Compared

Key

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


...

Tip

These examples show how to extract data

...

Tip

These conditions are combined together by the logical AND operator. So a row of data is only added to the results when all the conditions match.

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 from the file (message indexing starts at 1):

Code Block
message_index: 1

Filter by message index list

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
time: 13
window: 0

Filter by time window

Here we set a 1 minute time window of either side of the specified date and time:

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

Filter by period

Here we select 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: 5
north: 60 
south: 50

Filter by identifier

Filter by WMO station

Select messages/subsets by WMO identifier:

Code Block
identifier: WMO station
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 wind speed values on various pressure levels:

Image Removed

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 is 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:

in a tabular format using the BUFR filter interface.

Table of Contents

Sample data for the examples

This is the list of the BUFR files used in the examples below:

Anchor
bufr_files
bufr_files

FileStructureDescription

Image Added

Classic radiosonde data. A message contains a vertical profile for a given station with various parameters (e.g. temperature, wind etc.) on a set of pressure levels.

tropical_cyclone.bufr

Anchor
#tropical_bufr_file
#tropical_bufr_file

Image Added

Tropical cyclone data. A message contains a full ensemble forecast with minimum mean sea level pressure and maximum wind speed values along the forecast tracks. Each ensemble member is encoded as a compressed subset within the message.


Extract a single parameter

This set of examples is based on file temp.bufr (click here for details).

ExampleFilterResultsComments

For all the messages: extract the first non missing temperature value


Code Block
extract_data: on
parameter_1: airTemperature


Image Added

By default missing values are ignored in data extraction (see option MISSING DATA)
For all the messages: extract the first (rank=1) temperature value (if missing it is ignored)


Code Block
extract_data: on
parameter_1: airTemperature
parameter_rank_1: 1


Image Added

Here we explicitly asked for the first temperature value. It is a missing value in many of the messages so we have less resulting rows that in the previous example.
For all the messages: extract the first (rank=1) temperature value if it is greater than 300 K


Code Block
extract_data: on
parameter_1: airTemperature
parameter_rank_1: 1
parameter_operator_1: >
parameter_value_1: 300


Image Added


For all the messages: extract the first temperature value which is greater than 300 K


Code Block
extract_data: on
parameter_1: airTemperature
parameter_operator_1: >
parameter_value_1: 300


Image Added


For station 78016: extract all the temperature values



Code Block
identifier_value: 78016
extract_data: on
parameter_1: airTemperature
extract_mode: all


Image Added



Extract with a single coordinate condition

This set of examples is based on file temp.bufr (click here for details).

ExampleFilterResultsComments

For all the messages: extract the first temperature value which is greater than 300 K and also extract the pressure on which it occurs


Code Block
extract_data: on
parameter_1: airTemperature
parameter_operator_1: >
parameter_value_1: 300
coordinate_condition_count: 1
coordinate_1: pressure


Image Added

Here we explicitly say that we only want the matching temperature values which appear inside a pressure block (for these messages this is always the case). By using the coordinate condition pressure will also be extracted because the EXTRACT_COORDINATE option is On by default.
For all the messages: extract the first temperature value which is greater than 300 K and the pressure is less than 950 hPa


Code Block
extract_data: on
parameter_1: airTemperature
parameter_operator_1: >
parameter_value_1: 300
coordinate_condition_count: 1
coordinate_1: pressure
coordinate_operator_1: <
coordinate_value_1: 95000


Image Added

Here we further refined the coordinate condition.
For all the messages: extract the temperature value on the 500 hPa pressure level


Code Block
extract_data: on
parameter_1: airTemperature
coordinate_condition_count: 1
coordinate_1: pressure
coordinate_operator_1: =
coordinate_value_1: 50000


Image Added


For station 78016: extract the temperature on the second pressure level



Code Block
identifier_value: 78016
extract_data: on
parameter_1: airTemperature
coordinate_condition_count: 1
coordinate_1: pressure
coordinate_rank_1: 2


Image Added

Here we restricted the filter for one station (message) only and  used a rank condition for the coordinate.
For station 78016: extract the temperature on the first 6 pressure levels


Code Block
identifier_value: 78016
extract_data: on
parameter_1: airTemperature
coordinate_condition_count: 1
coordinate_1: pressure
coordinate_rank_1: 1/2/3/4/5/6
extract_mode: all


Image Added

For coordinate rank a list of values can be specified.
For station 78016: extract the temperature on the 925, 850 and 700 hPa pressure levels


Code Block
identifier_value: 78016
extract_data: on
parameter_1: airTemperature
coordinate_condition_count: 1
coordinate_1: pressure
coordinate_operator_1: =
coordinate_value_1: 92500/85000/70000
extract_mode: all


Image Added


Extract multiple parameters

This set of examples is based on file temp.bufr (click here for details).

ExampleFilterResultsComments

For all the messages: extract the first wind speed and wind direction values


Code Block
extract_data: on
parameter_count: 2 parameter_1: windDirection
parameter_2: windSpeed


Image Added


Note

The order of the parameters in extraction must match their order of appearance in the message. Otherwise the data alignment does not work properly. In our BUFR messages windDirection precedes windSpeed, so we have to use the same ordering in the filter definition.


For all the messages: extract the first wind speed and wind direction values and also extract their pressure


Code Block
extract_data: on
parameter_count: 2 parameter_1: windDirection
parameter_2: windSpeed
coordinate_condition_count: 1
coordinate_1: pressure


Image Added


For all the messages: extract wind speed and wind direction values on the 500 hPa pressure level


Code Block
extract_data: on
parameter_1: windDirection
parameter_2: windSpeed
coordinate_condition_count: 1
coordinate_1: pressure
coordinate_operator_1: =
coordinate_value_1: 50000


Image Added


Extract with multiple (nested) coordinate conditions

This set of examples is based on file temp.bufr (click here for details).

Note

When we use multiple coordinate conditions these are regarded as nested, i.e. the first coordinate specified is the outer coordinate, the next inner coordinate is nested in it and so on. This puts a constraint on the order the coordinate conditions: the outer coordinate has to be specified first then the other coordinates must follow in the nesting order.

In the examples below we will work with two coordinates to extract radiosonde data on certain levels: pressure will be the outer coordinate and verticalSoundingSignificance, which defines the type of the pressure levels, the inner coordinate. It reflects how a pressure block is built up in our radiosonde BUFR file:

Image Added

TaskFilterResultsComments

For station 78016: extract all the temperature values on standard pressure levels


Code Block
identifier_value: 78016
extract_data: on
parameter_1: airTemperature
coordinate_condition_count: 2
coordinate_1: pressure
coordinate_2: verticalSoundingSignificance
coordinate_operator_2: =
coordinate_value_2: 32
extract_mode: all


Image Added

verticalSoundingSignificance is a FLAG TABLE (bit-vector) and its value is 32 for standard pressure levels:


Image Added
For station 78016: extract all the temperature values on temperature significant levels where the pressure is less than 500 hPa


Code Block
identifier_value: 78016
extract_data: on
parameter_count: 1
parameter_1: airTemperature 
coordinate_condition_count: 2
coordinate_1: pressure
coordinate_operator_1: <
coordinate_value_1: 50000
coordinate_2: verticalSoundingSignificance
coordinate_operator_2: =
coordinate_value_2: 4/68
extract_mode: all


Image Added


Extract tropical cyclone tracks

This set of examples is based on file tropical_cyclone.bufr (click here for details).

ExampleFilterResults

For the first message (storm IN-FA) extract the storm centre pressure values along the track for ensemble number =2


Code Block
message_index: 1
custom_condition_count: 1
custom_value_1: ensembleMemberNumber
custom_operator_1: =
custom_value_1: 2
extract_data: on
parameter_count: 1
parameter_1: pressureReducedToMeanSeaLevel
extract_mode: all


Image Added

...