RADOLAN binary data format

The RADOLAN binary data file format is described in the RADOLAN Kompositformat. The radolan composite files consists of an ascii header containing all needed information to decode the following binary data block. \(\omega radlib\) provides wradlib.io.read_RADOLAN_composite() to read the data.

The function wradlib.io.parse_DWD_quant_composite_header() takes care of correctly decoding the ascii header. All available header information is transferred into the metadata dictionary.

In [2]:
import wradlib as wrl
import matplotlib.pyplot as pl
import warnings
warnings.filterwarnings('ignore')
try:
    get_ipython().magic("matplotlib inline")
except:
    pl.ion()
import numpy as np
In [3]:
# load radolan files
rw_filename = wrl.util.get_wradlib_data_file('radolan/misc/raa01-rw_10000-1408102050-dwd---bin.gz')
filehandle = wrl.io.get_radolan_filehandle(rw_filename)
header = wrl.io.read_radolan_header(filehandle)
print(header)
RW102050100000814BY1620134VS 3SW   2.13.1PR E-01INT  60GP 900x 900MS 62<boo,ros,emd,hnr,umd,pro,ess,asd,neu,nhb,oft,tur,isn,fbg,mem>
In [4]:
attrs = wrl.io.parse_DWD_quant_composite_header(header)
print(attrs)
{'maxrange': '150 km', 'producttype': 'RW', 'nrow': 900, 'intervalseconds': 3600, 'precision': 0.1, 'datetime': datetime.datetime(2014, 8, 10, 20, 50), 'ncol': 900, 'radolanversion': '2.13.1', 'radarlocations': ['boo', 'ros', 'emd', 'hnr', 'umd', 'pro', 'ess', 'asd', 'neu', 'nhb', 'oft', 'tur', 'isn', 'fbg', 'mem'], 'datasize': 1620000, 'radarid': '10000'}

In the following example, the header information of four different composites is extracted.

In [5]:
# load radolan file
filename = 'radolan/showcase/raa01-rx_10000-1408102050-dwd---bin.gz'
rx_filename = wrl.util.get_wradlib_data_file(filename)
filename = 'radolan/showcase/raa01-ex_10000-1408102050-dwd---bin.gz'
ex_filename = wrl.util.get_wradlib_data_file(filename)
filename = 'radolan/showcase/raa01-rw_10000-1408102050-dwd---bin.gz'
rw_filename = wrl.util.get_wradlib_data_file(filename)
filename = 'radolan/showcase/raa01-sf_10000-1408102050-dwd---bin.gz'
sf_filename = wrl.util.get_wradlib_data_file(filename)

rxdata, rxattrs = wrl.io.read_RADOLAN_composite(rx_filename)
exdata, exattrs = wrl.io.read_RADOLAN_composite(ex_filename)
rwdata, rwattrs = wrl.io.read_RADOLAN_composite(rw_filename)
sfdata, sfattrs = wrl.io.read_RADOLAN_composite(sf_filename)

# print the available attributes
print("RX Attributes:")
for key, value in rxattrs.items():
    print(key + ':', value)
print("----------------------------------------------------------------")
# print the available attributes
print("EX Attributes:")
for key, value in exattrs.items():
    print(key + ':', value)
print("----------------------------------------------------------------")

# print the available attributes
print("RW Attributes:")
for key, value in rwattrs.items():
    print(key + ':', value)
print("----------------------------------------------------------------")

# print the available attributes
print("SF Attributes:")
for key, value in sfattrs.items():
    print(key + ':', value)
print("----------------------------------------------------------------")
RX Attributes:
('maxrange:', '150 km')
('producttype:', 'RX')
('nrow:', 900)
('intervalseconds:', 300)
('cluttermask:', array([], dtype=int64))
('precision:', 1.0)
('datetime:', datetime.datetime(2014, 8, 10, 20, 50))
('ncol:', 900)
('radolanversion:', '2.13.1')
('radarlocations:', ['boo', 'ros', 'emd', 'hnr', 'umd', 'pro', 'ess', 'asd', 'neu', 'nhb', 'oft', 'tur', 'isn', 'fbg', 'mem', 'bdy'])
('nodataflag:', -9999)
('datasize:', 810000)
('radarid:', '10000')
----------------------------------------------------------------
EX Attributes:
('maxrange:', '128 km')
('producttype:', 'EX')
('nrow:', 1500)
('intervalseconds:', 300)
('cluttermask:', array([], dtype=int64))
('precision:', 1.0)
('datetime:', datetime.datetime(2014, 8, 10, 20, 50))
('ncol:', 1400)
('radolanversion:', '2.13.1')
('radarlocations:', ['sin', 'rom', 'vir', 'bor', 'nld', 'zav', 'wid', 'sui', 'abv', 'ave', 'tra', 'arc', 'ncy', 'bgs', 'bla', 'sly', 'sem', 'boo', 'ros', 'emd', 'hnr', 'umd', 'pro', 'ess', 'asd', 'neu', 'nhb', 'oft', 'tur', 'isn', 'fbg', 'mem', 'bdy', 'ska'])
('nodataflag:', -9999)
('datasize:', 2100000)
('radarid:', '10000')
----------------------------------------------------------------
RW Attributes:
('maxrange:', '150 km')
('producttype:', 'RW')
('nrow:', 900)
('intervalseconds:', 3600)
('cluttermask:', array([], dtype=int64))
('precision:', 0.1)
('datetime:', datetime.datetime(2014, 8, 10, 20, 50))
('ncol:', 900)
('radolanversion:', '2.13.1')
('radarlocations:', ['boo', 'ros', 'emd', 'hnr', 'umd', 'pro', 'ess', 'asd', 'neu', 'nhb', 'oft', 'tur', 'isn', 'fbg', 'mem'])
('nodataflag:', -9999)
('datasize:', 1620000)
('radarid:', '10000')
('secondary:', array([   799,    800,    801, ..., 806263, 806264, 807163]))
----------------------------------------------------------------
SF Attributes:
('maxrange:', '150 km')
('producttype:', 'SF')
('nrow:', 900)
('intervalseconds:', 86400)
('radardays:', ['asd 24', 'boo 24', 'emd 24', 'ess 24', 'fbg 24', 'hnr 24', 'isn 24', 'mem 24', 'neu 24', 'nhb 24', 'oft 24', 'pro 24', 'ros 24', 'tur 24', 'umd 24'])
('cluttermask:', array([], dtype=int64))
('precision:', 0.1)
('datetime:', datetime.datetime(2014, 8, 10, 20, 50))
('ncol:', 900)
('radolanversion:', '2.13.1')
('radarlocations:', ['boo', 'ros', 'emd', 'hnr', 'umd', 'pro', 'ess', 'asd', 'neu', 'nhb', 'oft', 'tur', 'isn', 'fbg', 'mem'])
('nodataflag:', -9999)
('datasize:', 1620000)
('radarid:', '10000')
('secondary:', array([   188,    189,    190, ..., 809566, 809567, 809568]))
----------------------------------------------------------------