[1]:
!test -f syn_new.bufr || wget https://get.ecmwf.int/repository/test-data/pdbufr/test-data/syn_new.bufr
Generic: synop data
[2]:
import pdbufr
The input BUFR data contains three SYNOP observations.
In this notebook we read this data with the generic reader, which is the default reader.
Example 1
Extract all “2m” temperature and dewpoint observations together with the measurement height.
[3]:
df = pdbufr.read_bufr("syn_new.bufr",
columns=("WMO_station_id", "data_datetime", "latitude", "longitude", "heightOfSensorAboveLocalGroundOrDeckOfMarinePlatform", "airTemperature", "dewpointTemperature"))
df
[3]:
| latitude | longitude | heightOfSensorAboveLocalGroundOrDeckOfMarinePlatform | airTemperature | dewpointTemperature | data_datetime | WMO_station_id | |
|---|---|---|---|---|---|---|---|
| 0 | -23.13017 | -134.96533 | 1.5 | 300.45 | 295.15 | 2020-03-15 | 91948 |
| 1 | 49.77722 | 17.54194 | 2.0 | 269.25 | 263.55 | 2020-03-15 | 11766 |
| 2 | 30.00000 | 100.27000 | 1.5 | 276.35 | 263.05 | 2020-03-15 | 56257 |
Example 2
Getting low level cloud data from the message with a given “dataSubCategory”:
[4]:
df = pdbufr.read_bufr("syn_new.bufr",
columns=("data_datetime", "WMO_station_id", "cloudAmount", "heightOfBaseOfCloud", "cloudType"),
filters={"dataSubCategory": 172, "verticalSignificanceSurfaceObservations": 7})
df
[4]:
| cloudAmount | heightOfBaseOfCloud | cloudType | data_datetime | WMO_station_id | |
|---|---|---|---|---|---|
| 0 | 2 | 600.0 | 32 | 2020-03-15 | 91948 |
| 1 | 2 | 600.0 | 20 | 2020-03-15 | 91948 |
| 2 | 2 | 600.0 | 10 | 2020-03-15 | 91948 |