install via
pip install --user pdbufr
or install the newest version
pip install --user git+https://github.com/ecmwf/pdbufr.git
it has eccodes as dependency
In [1]:
Copied!
import pdbufr
import pdbufr
In [2]:
Copied!
pdbufr.__version__
pdbufr.__version__
Out[2]:
'0.11.0'
In [3]:
Copied!
SYNOP_BUFR_FILE = '/data/boden/BUFR/2022/01/31/ISMD12_LOWM.311200'
SYNOP_BUFR_FILE = '/data/boden/BUFR/2022/01/31/ISMD12_LOWM.311200'
In [4]:
Copied!
keys = ['blockNumber',
'stationNumber',
'latitude',
'longitude',
'airTemperature',
'heightOfStationGroundAboveMeanSeaLevel',
'dewpointTemperature',
'windSpeed',
'windDirection',
'WMO_station_id',
'cloudType',
]
df_all = pdbufr.read_bufr(SYNOP_BUFR_FILE, columns=keys)
keys = ['blockNumber',
'stationNumber',
'latitude',
'longitude',
'airTemperature',
'heightOfStationGroundAboveMeanSeaLevel',
'dewpointTemperature',
'windSpeed',
'windDirection',
'WMO_station_id',
'cloudType',
]
df_all = pdbufr.read_bufr(SYNOP_BUFR_FILE, columns=keys)
In [5]:
Copied!
display(df_all)
display(df_all)
blockNumber | stationNumber | latitude | longitude | heightOfStationGroundAboveMeanSeaLevel | airTemperature | dewpointTemperature | cloudType | windDirection | windSpeed | WMO_station_id | |
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 11 | 8 | 48.56972 | 13.99417 | 597.0 | 273.35 | 272.95 | NaN | 260 | 5.0 | 11008 |
1 | 11 | 20 | 48.61778 | 15.20361 | 502.0 | 276.25 | 271.55 | NaN | 240 | 4.0 | 11020 |
2 | 11 | 21 | 48.95472 | 15.03833 | 558.0 | 274.45 | 272.05 | NaN | 270 | 1.0 | 11021 |
3 | 11 | 32 | 48.66917 | 16.63750 | 198.0 | 277.35 | 271.75 | NaN | 230 | 4.0 | 11032 |
4 | 11 | 72 | 47.94917 | 16.82889 | 117.0 | 276.25 | 270.45 | NaN | 190 | 2.0 | 11072 |
5 | 11 | 78 | 48.02806 | 15.58750 | 696.0 | 273.45 | 272.75 | NaN | 210 | 6.0 | 11078 |
6 | 11 | 119 | 47.32472 | 11.17556 | 1182.0 | 272.85 | 271.95 | NaN | 100 | 1.0 | 11119 |
7 | 11 | 129 | 47.00722 | 11.51083 | 1412.0 | 273.15 | 268.25 | NaN | 280 | 2.0 | 11129 |
8 | 11 | 138 | 47.13500 | 12.62583 | 2317.0 | 264.65 | 262.25 | NaN | 170 | 1.0 | 11138 |
9 | 11 | 140 | 47.58445 | 12.69528 | 622.0 | 273.55 | 272.65 | NaN | 330 | 1.0 | 11140 |
10 | 11 | 141 | 47.40667 | 13.22111 | 550.0 | 272.35 | 270.55 | NaN | 320 | 2.0 | 11141 |
11 | 11 | 161 | 47.52167 | 14.95417 | 1215.0 | 270.95 | 268.15 | NaN | 340 | 3.0 | 11161 |
12 | 11 | 170 | 47.85444 | 15.06750 | 612.0 | 274.15 | 272.65 | NaN | 30 | 1.0 | 11170 |
13 | 11 | 182 | 47.83222 | 16.23139 | 275.0 | 277.15 | 270.55 | 3.0 | 0 | 2.0 | 11182 |
14 | 11 | 192 | 47.20750 | 16.33556 | 265.0 | 274.45 | 270.15 | NaN | 230 | 1.0 | 11192 |
15 | 11 | 201 | 46.74639 | 12.42361 | 1081.0 | 276.05 | 261.85 | NaN | 130 | 1.0 | 11201 |
16 | 11 | 213 | 46.61806 | 13.87389 | 493.0 | 274.95 | 266.45 | NaN | 100 | 1.0 | 11213 |
17 | 11 | 214 | 46.93806 | 14.91500 | 1034.0 | 274.55 | 265.05 | NaN | 270 | 3.0 | 11214 |
18 | 11 | 225 | 46.84917 | 14.19083 | 704.0 | 275.05 | 264.85 | NaN | 130 | 1.0 | 11225 |
19 | 11 | 241 | 47.19861 | 15.46639 | 1443.0 | 270.85 | 263.55 | NaN | 320 | 5.0 | 11241 |
20 | 11 | 274 | 47.37833 | 15.08667 | 544.0 | 277.35 | 268.35 | NaN | 170 | 1.0 | 11274 |
Reading Radiosonde information¶
In [33]:
Copied!
df = pdbufr.read_bufr('/data/raso/BUFR/2022/01/31/IUSD04_LOWM.310300',
columns=('stationNumber', 'data_datetime', 'pressure', 'airTemperature', 'dewpointTemperature','windDirection', 'windSpeed',
'nonCoordinateGeopotentialHeight', 'timePeriod', 'longitude', 'latitude', 'height'),
)
df = pdbufr.read_bufr('/data/raso/BUFR/2022/01/31/IUSD04_LOWM.310300',
columns=('stationNumber', 'data_datetime', 'pressure', 'airTemperature', 'dewpointTemperature','windDirection', 'windSpeed',
'nonCoordinateGeopotentialHeight', 'timePeriod', 'longitude', 'latitude', 'height'),
)
In [34]:
Copied!
display(df)
display(df)
stationNumber | latitude | longitude | height | timePeriod | pressure | nonCoordinateGeopotentialHeight | airTemperature | dewpointTemperature | windDirection | windSpeed | data_datetime | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 240 | 46.99396 | 15.44706 | 338 | NaN | 100000.0 | 140 | NaN | NaN | NaN | NaN | 2022-01-31 03:15:11 |
1 | 240 | 46.99396 | 15.44706 | 338 | 0.0 | 97590.0 | 338 | 268.45 | 265.37 | 140.0 | 1.5 | 2022-01-31 03:15:11 |
2 | 240 | 46.99396 | 15.44706 | 338 | 1.0 | 97460.0 | 349 | 271.66 | 266.31 | 231.0 | 0.5 | 2022-01-31 03:15:11 |
3 | 240 | 46.99396 | 15.44706 | 338 | 2.0 | 97410.0 | 353 | 272.38 | 266.65 | 273.0 | 0.9 | 2022-01-31 03:15:11 |
4 | 240 | 46.99396 | 15.44706 | 338 | 3.0 | 97350.0 | 358 | 272.69 | 266.59 | 278.0 | 1.1 | 2022-01-31 03:15:11 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
3864 | 240 | 46.99396 | 15.44706 | 338 | 4442.0 | 3530.0 | 22376 | 210.84 | 183.63 | 258.0 | 18.0 | 2022-01-31 03:15:11 |
3865 | 240 | 46.99396 | 15.44706 | 338 | 4445.0 | 3520.0 | 22393 | 210.72 | 183.51 | 258.0 | 17.9 | 2022-01-31 03:15:11 |
3866 | 240 | 46.99396 | 15.44706 | 338 | 4448.0 | 3510.0 | 22411 | 210.58 | 183.39 | 258.0 | 17.8 | 2022-01-31 03:15:11 |
3867 | 240 | 46.99396 | 15.44706 | 338 | 4451.0 | 3500.0 | 22427 | 210.50 | 183.34 | 258.0 | 17.7 | 2022-01-31 03:15:11 |
3868 | 240 | 46.99396 | 15.44706 | 338 | 4624.0 | 3000.0 | 23386 | NaN | NaN | NaN | NaN | 2022-01-31 03:15:11 |
3869 rows × 12 columns
In [ ]:
Copied!
Last update:
February 29, 2024
Created: February 29, 2024
Created: February 29, 2024