...
These examples show how to extract data as in a table format from BUFR files in CodesUI.
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. |
Extract Comments |
---|
For all the messages: extract the first non missing temperature value |
from all the message |
Code Block |
---|
extract_data: on
parameter_1: airTemperature |
| Image Modified
|
Extract | By default missing values are ignored in data extraction (see option MISSING DATA) |
For all the messages: extract the first (rank=1) temperature value ( |
ignore from all the messages |
Code Block |
---|
extract_data: on
parameter_1: airTemperature
parameter_rank_1: 1 |
| Image Modified
|
Extract
|
For all the messages: extract the first (rank=1) temperature value |
when if it is greater than 300 K |
from all the messages |
Code Block |
---|
extract_data: on
parameter_1: airTemperature
parameter_rank_1: 1
parameter_operator_1: >
parameter_value_1: 300 |
| Image Modified
|
Extract
|
For all the messages: extract the first temperature value which is greater than 300 K |
from all the messages |
Code Block |
---|
extract_data: on
parameter_1: airTemperature
parameter_operator_1: >
parameter_value_1: 300 |
| Image Modified
|
Using coordnates
...
|
|
For station 78016: extract all the temperature values
|
Code Block |
---|
extract_data: on
parameter_1: airTemperature
extract_mode: all |
| Image Added
|
|
From For all 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 Modified
|
From For all 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 Modified
|
From For all messages: extract the (first) 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 Modified
|
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 Modified
|
For station 78016: extract the temperature on the first |
size 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 |
| Image Modified
|
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 |
|
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 |
Accessing the header section is fast since the message data does not have to be expanded.
Filter only the first message 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 |
The date component can be omitted:
Code Block |
---|
data_mode: window
time: 13
window: 0 |
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 |
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 |
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 |
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
|
Select aircraft messages by identifier:
Code Block |
---|
identifier: aircraftFlightNumber
identifier_value: QGOBTRRA |
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
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 |
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 |
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 |
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 |
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:
...
| Image Added
|
Description | Filter | Results |
---|
For all the messages: extract the first wind speed and wind direction values |
Code Block |
---|
extract_data: on
parameter_1: windDirection
parameter_2: windSpeed |
| Image Added
|
For all the messages: extract the first wind speed and wind direction values and also extract their pressure |
Code Block |
---|
extract_data: on
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
|
Multiple (nested) coordinate conditions
Task | Filter | Results |
---|
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 |
| 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 |
| Image Added
|
...