Load ODIM_H5 Volume data from German Weather Service

In this example, we obtain and read the latest available volumetric radar data from German Weather Service available at opendata.dwd.de. Finally we do some plotting.

This retrieves the 10 sweeps (moments DBZH and VRADH) of the DWD volume scan of a distinct radar. This amounts to 20 data files which are combined into one volumetric Cf/Radial2 like xarray powered structure.

Exports to singel file Odim_H5 and Cf/Radial2 format are shown at the end of this tutorial.

[1]:
import wradlib as wrl
import warnings
warnings.filterwarnings('ignore')
import matplotlib.pyplot as pl
import numpy as np
import xarray as xr
try:
    get_ipython().magic("matplotlib inline")
except:
    pl.ion()
from wradlib.io.xarray import CfRadial, OdimH5
[2]:
import urllib3
import os
import io
import glob
import shutil

Download Current Filelist from server

Import it into pandas DataFrame, export to list and sort it descending in time.

Helper Class to parse response

[3]:
from html.parser import HTMLParser

class DWDHTMLParser(HTMLParser):
    def handle_starttag(self, tag, attrs):
        if tag != 'a':
            return
        self.links.append(attrs[0][1])

parser = DWDHTMLParser()
[4]:
radar = 'ESS'
DBZH = 'sweep_vol_z'
VRADH = 'sweep_vol_v'

import certifi
opendata_url1 = (f"https://opendata.dwd.de/weather/radar/sites/{DBZH}/{radar.lower()}/hdf5/")

http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED', ca_certs=certifi.where())
response = http.request('GET', opendata_url1).data.decode("utf-8")

parser.links = []
parser.feed(response)
filelist1 = parser.links[1:]

filelist1.sort(key=lambda x: x.split('-')[2])
filelist1.reverse()

opendata_url2 = (f"https://opendata.dwd.de/weather/radar/sites/{VRADH}/{radar.lower()}/hdf5/")

http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED', ca_certs=certifi.where())
response = http.request('GET', opendata_url2).data.decode("utf-8")

parser.links = []
parser.feed(response)
filelist2 = parser.links[1:]

filelist2.sort(key=lambda x: x.split('-')[2])
filelist2.reverse()
[5]:
for f in filelist1[:10]:
    print(f)
ras07-vol5minng01_sweeph5onem_dbzh_09-2020070517590200-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_dbzh_08-2020070517584900-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_dbzh_07-2020070517583600-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_dbzh_06-2020070517582200-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_dbzh_05-2020070517580100-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_dbzh_04-2020070517573000-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_dbzh_03-2020070517570700-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_dbzh_02-2020070517564400-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_dbzh_01-2020070517562100-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_dbzh_00-2020070517555800-ess-10410-hd5
[6]:
for f in filelist2[:10]:
    print(f)
ras07-vol5minng01_sweeph5onem_vradh_09-2020070517590200-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_vradh_08-2020070517584900-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_vradh_07-2020070517583600-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_vradh_06-2020070517582200-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_vradh_05-2020070517580100-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_vradh_04-2020070517573000-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_vradh_03-2020070517570700-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_vradh_02-2020070517564400-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_vradh_01-2020070517562100-ess-10410-hd5
ras07-vol5minng01_sweeph5onem_vradh_00-2020070517555800-ess-10410-hd5

Clean up local folder

[7]:
flist = glob.glob('ras07*')
for f in flist:
    os.remove(f)

Download latest volume to current directory

[8]:
for f in filelist1[:10]:
    with http.request('GET', os.path.join(opendata_url1, f), preload_content=False) as r, open(f, 'wb') as out:
        shutil.copyfileobj(r, out)

for f in filelist2[:10]:
    with http.request('GET', os.path.join(opendata_url2, f), preload_content=False) as r, open(f, 'wb') as out:
        shutil.copyfileobj(r, out)

Read the files into xarray powered structure

[9]:
flist = glob.glob('ras07*')
vol = wrl.io.OdimH5(flist, standard='cf', georef=True)

Inspect structure

Root Group

[10]:
vol.root
[10]:
Show/Hide data repr Show/Hide attributes
xarray.Dataset
    • sweep: 10
      • volume_number
        ()
        int64
        0
        array(0)
      • platform_type
        ()
        <U5
        'fixed'
        array('fixed', dtype='<U5')
      • instrument_type
        ()
        <U5
        'radar'
        array('radar', dtype='<U5')
      • primary_axis
        ()
        <U6
        'axis_z'
        array('axis_z', dtype='<U6')
      • time_coverage_start
        ()
        <U20
        '2020-07-05T17:55:35Z'
        array('2020-07-05T17:55:35Z', dtype='<U20')
      • time_coverage_end
        ()
        <U20
        '2020-07-05T17:59:02Z'
        array('2020-07-05T17:59:02Z', dtype='<U20')
      • latitude
        ()
        float64
        51.41
        array(51.40564)
      • longitude
        ()
        float64
        6.967
        array(6.96711)
      • altitude
        ()
        float64
        185.0
        array(185.)
      • altitude_agl
        ()
        float64
        nan
        array(nan)
      • sweep_group_name
        (sweep)
        <U8
        'sweep_1' 'sweep_2' ... 'sweep_10'
        array(['sweep_1', 'sweep_2', 'sweep_3', 'sweep_4', 'sweep_5', 'sweep_6',
               'sweep_7', 'sweep_8', 'sweep_9', 'sweep_10'], dtype='<U8')
      • sweep_fixed_angle
        (sweep)
        float64
        12.0 5.499 17.0 ... 0.4999 7.998
        array([12.00256348,  5.49865723, 17.00134277,  3.49914551, 24.99938965,
                1.49963379,  2.49938965,  4.49890137,  0.49987793,  7.99804688])
      • frequency
        ()
        float64
        nan
        array(nan)
      • status_xml
        ()
        <U4
        'None'
        array('None', dtype='<U4')
    • Conventions :
      Cf/Radial
      version :
      H5rad 2.2
      title :
      None
      institution :
      WMO:10410,NOD:deess
      references :
      None
      source :
      None
      history :
      None
      comment :
      im/exported using wradlib
      instrument_name :
      None
      site_name :
      name of site where data were gathered
      scan_name :
      name of scan strategy used, if applicable
      scan_id :
      scan strategy id, if applicable. assumed 0 if missing
      platform_is_mobile :
      "true" or "false", assumed "false" if missing
      ray_times_increase :
      "true" or "false", assumed "true" if missing. This is set to true if ray times increase monotonically thoughout all of the sweeps in the volume
      field_names :
      array of strings of field names present in this file.
      time_coverage_start :
      copy of time_coverage_start global variable
      time_coverage_end :
      copy of time_coverage_end global variable
      simulated data :
      "true" or "false", assumed "false" if missing. data in this file are simulated
      instrument :
      WMO:10410,NOD:deess
    [11]:
    
    vol.root.sweep_fixed_angle
    
    [11]:
    
    Show/Hide data repr Show/Hide attributes
    xarray.DataArray
    'sweep_fixed_angle'
    • sweep: 10
    • 12.0 5.499 17.0 3.499 25.0 1.5 2.499 4.499 0.4999 7.998
      array([12.00256348,  5.49865723, 17.00134277,  3.49914551, 24.99938965,
              1.49963379,  2.49938965,  4.49890137,  0.49987793,  7.99804688])

      Sweep Groups

      [12]:
      
      list(vol)
      
      [12]:
      
      ['sweep_1',
       'sweep_2',
       'sweep_3',
       'sweep_4',
       'sweep_5',
       'sweep_6',
       'sweep_7',
       'sweep_8',
       'sweep_9',
       'sweep_10']
      
      [13]:
      
      vol['sweep_1']
      
      [13]:
      
      Show/Hide data repr Show/Hide attributes
      xarray.Dataset
        • range: 60
        • time: 360
        • sweep_mode
          ()
          <U20
          'azimuth_surveillance'
          array('azimuth_surveillance', dtype='<U20')
        • latitude
          ()
          float64
          51.41
          array(51.40564)
        • altitude
          ()
          float64
          185.0
          array(185.)
        • longitude
          ()
          float64
          6.967
          array(6.96711)
        • elevation
          (time)
          float64
          12.03 12.03 12.03 ... 12.03 12.03
          standard_name :
          ray_elevation_angle
          long_name :
          elevation_angle_from_horizontal_plane
          units :
          degrees
          axis :
          radial_elevation_coordinate
          array([12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 11.98608398,
                 11.98608398, 11.99157715, 12.00256348, 12.01904297, 12.03552246,
                 12.04101562, 12.04101562, 12.04101562, 12.04101562, 12.03552246,
                 12.02453613, 12.01904297, 12.01904297, 12.01904297, 12.01904297,
                 12.01904297, 12.01904297, 12.01904297, 12.02453613, 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ,
                 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 , 12.0300293 ])
        • azimuth
          (time)
          float64
          0.5054 1.522 2.516 ... 358.5 359.5
          standard_name :
          ray_azimuth_angle
          long_name :
          azimuth_angle_from_true_north
          units :
          degrees
          axis :
          radial_azimuth_coordinate
          array([  0.50537109,   1.52160645,   2.51586914,   3.52111816,
                   4.52087402,   5.50964355,   6.52038574,   7.52563477,
                   8.51989746,   9.51416016,  10.51391602,  11.51367188,
                  12.51342773,  13.51867676,  14.51293945,  15.51269531,
                  16.51245117,  17.51220703,  18.51196289,  19.51171875,
                  20.51147461,  21.51123047,  22.51098633,  23.51074219,
                  24.51049805,  25.51574707,  26.51000977,  27.50976562,
                  28.51501465,  29.51477051,  30.51452637,  31.51977539,
                  32.50854492,  33.50830078,  34.50805664,  35.5078125 ,
                  36.50756836,  37.50732422,  38.51806641,  39.5123291 ,
                  40.5065918 ,  41.51184082,  42.50610352,  43.50585938,
                  44.50561523,  45.51635742,  46.52160645,  47.51586914,
                  48.51013184,  49.51538086,  50.52612305,  51.51489258,
                  52.51464844,  53.5144043 ,  54.51965332,  55.51391602,
                  56.51367188,  57.5189209 ,  58.51318359,  59.51293945,
                  60.51269531,  61.51245117,  62.51220703,  63.51196289,
                  64.51171875,  65.51147461,  66.51123047,  67.51098633,
                  68.51623535,  69.51599121,  70.52124023,  71.51550293,
                  72.52075195,  73.51501465,  74.50927734,  75.5090332 ,
                  76.50878906,  77.50854492,  78.50830078,  79.50805664,
                  80.5078125 ,  81.50756836,  82.50732422,  83.50708008,
                  84.50683594,  85.5065918 ,  86.50634766,  87.50610352,
                  88.50585938,  89.50561523,  90.51086426,  91.51611328,
                  92.51586914,  93.515625  ,  94.51538086,  95.51513672,
                  96.51489258,  97.51464844,  98.5144043 ,  99.51416016,
                 100.51391602, 101.51916504, 102.5189209 , 103.51318359,
                 104.51293945, 105.51269531, 106.51245117, 107.5177002 ,
                 108.51196289, 109.51171875, 110.51147461, 111.51123047,
                 112.51647949, 113.51623535, 114.51049805, 115.51025391,
                 116.51000977, 117.50976562, 118.51501465, 119.50927734,
                 120.5090332 , 121.50878906, 122.50854492, 123.50830078,
                 124.50805664, 125.5078125 , 126.51306152, 127.50732422,
                 128.50708008, 129.50683594, 130.5065918 , 131.51184082,
                 132.50610352, 133.51135254, 134.50561523, 135.51086426,
                 136.51062012, 137.51586914, 138.515625  , 139.51538086,
                 140.51513672, 141.51489258, 142.51464844, 143.5144043 ,
                 144.50866699, 145.51391602, 146.50817871, 147.5189209 ,
                 148.51318359, 149.51293945, 150.51269531, 151.51245117,
                 152.51220703, 153.51745605, 154.51171875, 155.51696777,
                 156.51672363, 157.51098633, 158.51074219, 159.51049805,
                 160.51025391, 161.51000977, 162.50976562, 163.50952148,
                 164.50927734, 165.5090332 , 166.51428223, 167.50854492,
                 168.51379395, 169.5135498 , 170.5078125 , 171.50756836,
                 172.51281738, 173.50708008, 174.50683594, 175.5065918 ,
                 176.50634766, 177.50610352, 178.50585938, 179.50561523,
                 180.51086426, 181.51611328, 182.51586914, 183.515625  ,
                 184.51538086, 185.51513672, 186.51489258, 187.51464844,
                 188.5144043 , 189.50866699, 190.51391602, 191.51916504,
                 192.5189209 , 193.52416992, 194.51843262, 195.51269531,
                 196.51245117, 197.51220703, 198.51196289, 199.50622559,
                 200.51147461, 201.5222168 , 202.51647949, 203.51623535,
                 204.51049805, 205.51025391, 206.51000977, 207.52075195,
                 208.51501465, 209.51477051, 210.51452637, 211.51428223,
                 212.50854492, 213.51928711, 214.51904297, 215.51330566,
                 216.50756836, 217.50732422, 218.50708008, 219.50683594,
                 220.5065918 , 221.51184082, 222.50610352, 223.51135254,
                 224.5111084 , 225.51635742, 226.52160645, 227.5213623 ,
                 228.515625  , 229.51538086, 230.52062988, 231.52038574,
                 232.51464844, 233.5144043 , 234.51416016, 235.51940918,
                 236.51367188, 237.5189209 , 238.51867676, 239.51843262,
                 240.51269531, 241.51245117, 242.51220703, 243.51196289,
                 244.51721191, 245.51696777, 246.51672363, 247.51647949,
                 248.51074219, 249.51049805, 250.51025391, 251.51000977,
                 252.50976562, 253.51501465, 254.51477051, 255.51452637,
                 256.50604248, 257.50579834, 258.5055542 , 259.50531006,
                 260.51055908, 261.51031494, 262.5100708 , 263.5043335 ,
                 264.50958252, 265.50933838, 266.50360107, 267.50335693,
                 268.50860596, 269.50836182, 270.50811768, 271.5133667 ,
                 272.51861572, 273.51287842, 274.52362061, 275.5178833 ,
                 276.51763916, 277.51190186, 278.51165771, 279.51690674,
                 280.51116943, 281.51092529, 282.51068115, 283.51043701,
                 284.51568604, 285.51544189, 286.51519775, 287.51495361,
                 288.50921631, 289.50897217, 290.50872803, 291.50848389,
                 292.50823975, 293.50799561, 294.50775146, 295.51300049,
                 296.50726318, 297.50701904, 298.5067749 , 299.50653076,
                 300.50628662, 301.50604248, 302.50579834, 303.5055542 ,
                 304.50531006, 305.50506592, 306.50482178, 307.49908447,
                 308.5043335 , 309.50408936, 310.50384521, 311.50360107,
                 312.5088501 , 313.50860596, 314.50286865, 315.50811768,
                 316.51885986, 317.51861572, 318.51287842, 319.51263428,
                 320.51239014, 321.512146  , 322.51190186, 323.51715088,
                 324.51690674, 325.51116943, 326.51092529, 327.51068115,
                 328.51043701, 329.51019287, 330.50994873, 331.50970459,
                 332.50946045, 333.50921631, 334.50897217, 335.50872803,
                 336.50848389, 337.51373291, 338.50799561, 339.50775146,
                 340.50750732, 341.50726318, 342.50701904, 343.5067749 ,
                 344.50653076, 345.50628662, 346.51153564, 347.50579834,
                 348.5055542 , 349.51080322, 350.50506592, 351.50482178,
                 352.50457764, 353.5043335 , 354.50408936, 355.50384521,
                 356.50360107, 357.5088501 , 358.50860596, 359.50286865])
        • range
          (range)
          float32
          500.0 1500.0 ... 58500.0 59500.0
          units :
          meters
          standard_name :
          projection_range_coordinate
          long_name :
          range_to_measurement_volume
          spacing_is_constant :
          true
          axis :
          radial_range_coordinate
          meters_to_center_of_first_gate :
          500.0
          meters_between_gates :
          1000.0
          array([  500.,  1500.,  2500.,  3500.,  4500.,  5500.,  6500.,  7500.,  8500.,
                  9500., 10500., 11500., 12500., 13500., 14500., 15500., 16500., 17500.,
                 18500., 19500., 20500., 21500., 22500., 23500., 24500., 25500., 26500.,
                 27500., 28500., 29500., 30500., 31500., 32500., 33500., 34500., 35500.,
                 36500., 37500., 38500., 39500., 40500., 41500., 42500., 43500., 44500.,
                 45500., 46500., 47500., 48500., 49500., 50500., 51500., 52500., 53500.,
                 54500., 55500., 56500., 57500., 58500., 59500.], dtype=float32)
        • y
          (time, range)
          float64
          489.0 1.467e+03 ... 5.81e+04
          array([[  488.98356604,  1466.91468138,  2444.7976473 , ...,
                  56153.68636844, 57128.84144344, 58103.94796887],
                 [  488.83015706,  1466.45446573,  2444.03064009, ...,
                  56136.06925301, 57110.91839228, 58085.7189972 ],
                 [  488.53123935,  1465.55773463,  2442.53612502, ...,
                  56101.74226875, 57075.99529163, 58050.19980983],
                 ...,
                 [  488.5404547 ,  1465.58538001,  2442.58219952, ...,
                  56102.80053764, 57077.07193823, 58051.29483322],
                 [  488.83693613,  1466.47480245,  2444.06453378, ...,
                  56136.84774531, 57111.71040374, 58086.52452714],
                 [  488.98418126,  1466.91652699,  2444.80072324, ...,
                  56153.75701868, 57128.91332058, 58104.02107284]])
        • z
          (time, range)
          float64
          289.2 497.6 ... 1.257e+04 1.279e+04
          array([[  289.16166904,   497.58086591,   706.48913005, ...,
                  12355.3386882 , 12570.3708522 , 12785.39757609],
                 [  289.16166904,   497.58086591,   706.48913005, ...,
                  12355.3386882 , 12570.3708522 , 12785.39757609],
                 [  289.16166904,   497.58086591,   706.48913005, ...,
                  12355.3386882 , 12570.3708522 , 12785.39757609],
                 ...,
                 [  289.16166904,   497.58086591,   706.48913005, ...,
                  12355.3386882 , 12570.3708522 , 12785.39757609],
                 [  289.16166904,   497.58086591,   706.48913005, ...,
                  12355.3386882 , 12570.3708522 , 12785.39757609],
                 [  289.16166904,   497.58086591,   706.48913005, ...,
                  12355.3386882 , 12570.3708522 , 12785.39757609]])
        • gr
          (time, range)
          float64
          489.0 1.467e+03 ... 5.811e+04
          array([[  489.00258794,  1466.97174568,  2444.89275212, ...,
                  56155.87079719, 57131.06380661, 58106.20826455],
                 [  489.00258794,  1466.97174568,  2444.89275212, ...,
                  56155.87079719, 57131.06380661, 58106.20826455],
                 [  489.00258794,  1466.97174568,  2444.89275212, ...,
                  56155.87079719, 57131.06380661, 58106.20826455],
                 ...,
                 [  489.00258794,  1466.97174568,  2444.89275212, ...,
                  56155.87079719, 57131.06380661, 58106.20826455],
                 [  489.00258794,  1466.97174568,  2444.89275212, ...,
                  56155.87079719, 57131.06380661, 58106.20826455],
                 [  489.00258794,  1466.97174568,  2444.89275212, ...,
                  56155.87079719, 57131.06380661, 58106.20826455]])
        • rays
          (time, range)
          float64
          0.5054 0.5054 ... 359.5 359.5
          array([[  0.50537109,   0.50537109,   0.50537109, ...,   0.50537109,
                    0.50537109,   0.50537109],
                 [  1.52160645,   1.52160645,   1.52160645, ...,   1.52160645,
                    1.52160645,   1.52160645],
                 [  2.51586914,   2.51586914,   2.51586914, ...,   2.51586914,
                    2.51586914,   2.51586914],
                 ...,
                 [357.5088501 , 357.5088501 , 357.5088501 , ..., 357.5088501 ,
                  357.5088501 , 357.5088501 ],
                 [358.50860596, 358.50860596, 358.50860596, ..., 358.50860596,
                  358.50860596, 358.50860596],
                 [359.50286865, 359.50286865, 359.50286865, ..., 359.50286865,
                  359.50286865, 359.50286865]])
        • bins
          (time, range)
          float32
          500.0 1500.0 ... 58500.0 59500.0
          array([[  500.,  1500.,  2500., ..., 57500., 58500., 59500.],
                 [  500.,  1500.,  2500., ..., 57500., 58500., 59500.],
                 [  500.,  1500.,  2500., ..., 57500., 58500., 59500.],
                 ...,
                 [  500.,  1500.,  2500., ..., 57500., 58500., 59500.],
                 [  500.,  1500.,  2500., ..., 57500., 58500., 59500.],
                 [  500.,  1500.,  2500., ..., 57500., 58500., 59500.]],
                dtype=float32)
        • x
          (time, range)
          float64
          4.313 12.94 21.56 ... -495.7 -504.2
          array([[    4.31313738,    12.93909445,    21.56462681, ...,
                    495.31023233,   503.911703  ,   512.51274544],
                 [   12.984936  ,    38.95385159,    64.92148856, ...,
                   1491.15854695,  1517.05374491,  1542.94765364],
                 [   21.46530202,    64.39432499,   107.32123431, ...,
                   2465.02320511,  2507.83036603,  2550.63539572],
                 ...,
                 [  -21.25453197,   -63.76203037,  -106.26743588, ...,
                  -2440.81888416, -2483.20571708, -2525.59043971],
                 [  -12.72717119,   -38.18057612,   -63.63272783, ...,
                  -1461.55746073, -1486.93861141, -1512.31849846],
                 [   -4.24281627,   -12.72813629,   -21.21303853, ...,
                   -487.23472635,  -495.69595921,  -504.15677081]])
        • time
          (time)
          datetime64[ns]
          2020-07-05T17:58:30.844999936 ... 2020-07-05T17:58:30.810499840
          standard_name :
          time
          array(['2020-07-05T17:58:30.844999936', '2020-07-05T17:58:30.878500096',
                 '2020-07-05T17:58:30.911500032', ..., '2020-07-05T17:58:30.744499968',
                 '2020-07-05T17:58:30.777499904', '2020-07-05T17:58:30.810499840'],
                dtype='datetime64[ns]')
        • DBZH
          (time, range)
          float32
          ...
          standard_name :
          radar_equivalent_reflectivity_factor_h
          long_name :
          Equivalent reflectivity factor H
          units :
          dBZ
          array([[-64.00293, -64.00293, -64.00293, ..., -64.00293, -64.00293, -64.00293],
                 [-64.00293, -64.00293, -64.00293, ..., -64.00293, -64.00293, -64.00293],
                 [-64.00293, -64.00293, -64.00293, ..., -64.00293, -64.00293, -64.00293],
                 ...,
                 [-64.00293, -64.00293, -64.00293, ..., -64.00293, -64.00293, -64.00293],
                 [-64.00293, -64.00293, -64.00293, ..., -64.00293, -64.00293, -64.00293],
                 [-64.00293, -64.00293, -64.00293, ..., -64.00293, -64.00293, -64.00293]],
                dtype=float32)
        • sweep_number
          ()
          int64
          0
          array(0)
        • follow_mode
          ()
          <U4
          'none'
          array('none', dtype='<U4')
        • prt_mode
          ()
          <U5
          'fixed'
          array('fixed', dtype='<U5')
        • fixed_angle
          ()
          float64
          12.0
          array(12.00256348)
        • VRADH
          (time, range)
          float32
          ...
          standard_name :
          radial_velocity_of_scatterers_away_from_instrument_h
          long_name :
          Radial velocity of scatterers away from instrument H
          units :
          meters per seconds
          array([[-32.269188, -32.269188, -32.269188, ..., -32.269188, -32.269188,
                  -32.269188],
                 [-32.269188, -32.269188,   3.163647, ..., -32.269188, -32.269188,
                  -32.269188],
                 [-32.269188, -32.269188, -32.269188, ..., -32.269188, -32.269188,
                  -32.269188],
                 ...,
                 [-32.269188, -32.269188,  11.515671, ..., -32.269188, -32.269188,
                  -32.269188],
                 [-32.269188, -32.269188, -32.269188, ..., -32.269188, -32.269188,
                  -32.269188],
                 [-32.269188, -32.269188, -32.269188, ..., -32.269188, -32.269188,
                  -32.269188]], dtype=float32)

      plot sweeps

      DBZH

      [14]:
      
      fig = pl.figure(figsize=(20, 30))
      import matplotlib.gridspec as gridspec
      gs = gridspec.GridSpec(4, 3, wspace=0.4, hspace=0.4)
      for i, swp in enumerate(vol.values()):
          swp.DBZH.wradlib.plot(ax=gs[i], fig=fig)
          ax = pl.gca()
          ax.set_title(vol.root.sweep_fixed_angle[i])
      
      ../../_images/notebooks_fileio_wradlib_load_DWD_opendata_volumes_23_0.png

      VRADH

      [15]:
      
      fig = pl.figure(figsize=(20, 30))
      import matplotlib.gridspec as gridspec
      gs = gridspec.GridSpec(4, 3, wspace=0.4, hspace=0.4)
      for i, swp in enumerate(vol.values()):
          swp.VRADH.wradlib.plot(ax=gs[i], fig=fig)
          ax = pl.gca()
          ax.set_title(vol.root.sweep_fixed_angle[i])
      
      ../../_images/notebooks_fileio_wradlib_load_DWD_opendata_volumes_25_0.png

      Plot single sweep using cartopy

      [16]:
      
      import cartopy
      import cartopy.crs as ccrs
      import cartopy.feature as cfeature
      
      map_trans = ccrs.AzimuthalEquidistant(central_latitude=vol['sweep_10'].latitude.values,
                                            central_longitude=vol['sweep_10'].longitude.values)
      
      [17]:
      
      map_proj = ccrs.AzimuthalEquidistant(central_latitude=vol['sweep_10'].latitude.values,
                                            central_longitude=vol['sweep_10'].longitude.values)
      pm = vol['sweep_10'].DBZH.wradlib.plot_ppi(proj=map_proj)
      ax = pl.gca()
      ax.gridlines(crs=map_proj)
      print(ax)
      
      < GeoAxes: <cartopy.crs.AzimuthalEquidistant object at 0x7f61bb423400> >
      
      ../../_images/notebooks_fileio_wradlib_load_DWD_opendata_volumes_28_1.png
      [18]:
      
      map_proj = ccrs.Mercator(central_longitude=vol['sweep_10'].longitude.values)
      fig = pl.figure(figsize=(10,8))
      ax = fig.add_subplot(111, projection=map_proj)
      pm = vol['sweep_10'].DBZH.wradlib.plot_ppi(ax=ax)
      ax.gridlines(draw_labels=True)
      
      [18]:
      
      <cartopy.mpl.gridliner.Gridliner at 0x7f61bb3aa130>
      
      ../../_images/notebooks_fileio_wradlib_load_DWD_opendata_volumes_29_1.png
      [19]:
      
      fig = pl.figure(figsize=(10, 8))
      proj=ccrs.AzimuthalEquidistant(central_latitude=vol['sweep_10'].latitude.values,
                                     central_longitude=vol['sweep_10'].longitude.values)
      ax = fig.add_subplot(111, projection=proj)
      pm = vol['sweep_10'].DBZH.wradlib.plot_ppi(ax=ax)
      ax.gridlines()
      
      [19]:
      
      <cartopy.mpl.gridliner.Gridliner at 0x7f61bb41cd90>
      
      ../../_images/notebooks_fileio_wradlib_load_DWD_opendata_volumes_30_1.png

      Inspect radar moments

      The dataarrays can be accessed by key or by attribute. Each dataarray has the datasets dimensions and coordinates of it’s parent dataset. There are attributes connected which are defined by Cf/Radial and/or ODIM_H5 standard.

      [20]:
      
      vol['sweep_10'].DBZH
      
      [20]:
      
      Show/Hide data repr Show/Hide attributes
      xarray.DataArray
      'DBZH'
      • time: 360
      • range: 124
      • ...
        array([[-64.00293, -64.00293, -64.00293, ..., -64.00293, -64.00293, -64.00293],
               [-64.00293, -64.00293, -64.00293, ..., -64.00293, -64.00293, -64.00293],
               [-64.00293, -64.00293, -64.00293, ..., -64.00293, -64.00293, -64.00293],
               ...,
               [-64.00293, -64.00293, -64.00293, ..., -64.00293, -64.00293, -64.00293],
               [-64.00293, -64.00293, -64.00293, ..., -64.00293, -64.00293, -64.00293],
               [-64.00293, -64.00293, -64.00293, ..., -64.00293, -64.00293, -64.00293]],
              dtype=float32)
        • sweep_mode
          ()
          <U20
          'azimuth_surveillance'
          array('azimuth_surveillance', dtype='<U20')
        • latitude
          ()
          float64
          51.41
          array(51.40564)
        • altitude
          ()
          float64
          185.0
          array(185.)
        • longitude
          ()
          float64
          6.967
          array(6.96711)
        • elevation
          (time)
          float64
          8.02 8.02 8.02 ... 8.02 8.02 8.02
          standard_name :
          ray_elevation_angle
          long_name :
          elevation_angle_from_horizontal_plane
          units :
          degrees
          axis :
          radial_elevation_coordinate
          array([8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 7.93762207, 7.99804688,
                 8.03100586, 8.04199219, 8.03649902, 8.02001953, 8.0090332 ,
                 8.0090332 , 8.0090332 , 8.0090332 , 8.0090332 , 8.0090332 ,
                 8.0090332 , 8.0090332 , 8.01452637, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953,
                 8.02001953, 8.02001953, 8.02001953, 8.02001953, 8.02001953])
        • azimuth
          (time)
          float64
          0.5219 1.524 2.521 ... 358.5 359.5
          standard_name :
          ray_azimuth_angle
          long_name :
          azimuth_angle_from_true_north
          units :
          degrees
          axis :
          radial_azimuth_coordinate
          array([  0.52185059,   1.52435303,   2.5213623 ,   3.52111816,
                   4.51538086,   5.52612305,   6.52038574,   7.52563477,
                   8.51989746,   9.51965332,  10.51391602,  11.51916504,
                  12.5189209 ,  13.52416992,  14.51293945,  15.51818848,
                  16.51245117,  17.5177002 ,  18.51745605,  19.53369141,
                  20.51696777,  21.51672363,  22.51647949,  23.52172852,
                  24.51049805,  25.52124023,  26.51550293,  27.51525879,
                  28.50952148,  29.52026367,  30.52001953,  31.52526855,
                  32.51953125,  33.51928711,  34.50805664,  35.51879883,
                  36.51306152,  37.51831055,  38.51257324,  39.5123291 ,
                  40.51208496,  41.51184082,  42.50610352,  43.5168457 ,
                  44.51660156,  45.52185059,  46.51611328,  47.5213623 ,
                  48.52111816,  49.52636719,  50.52062988,  51.52587891,
                  52.5201416 ,  53.52539062,  54.51965332,  55.51940918,
                  56.51916504,  57.5189209 ,  58.52416992,  59.52941895,
                  60.51818848,  61.51245117,  62.51220703,  63.51745605,
                  64.51721191,  65.52246094,  66.51672363,  67.52197266,
                  68.51623535,  69.52148438,  70.51574707,  71.51550293,
                  72.51525879,  73.52050781,  74.51477051,  75.53100586,
                  76.51977539,  77.51953125,  78.51379395,  79.51904297,
                  80.5078125 ,  81.51306152,  82.50732422,  83.51257324,
                  84.51782227,  85.52307129,  86.51733398,  87.51708984,
                  88.51135254,  89.51660156,  90.51635742,  91.52709961,
                  92.51586914,  93.52111816,  94.51538086,  95.52612305,
                  96.52587891,  97.52563477,  98.51989746,  99.53063965,
                 100.51940918, 101.51916504, 102.51342773, 103.51867676,
                 104.51843262, 105.51818848, 106.51245117, 107.5177002 ,
                 108.51745605, 109.52270508, 110.51147461, 111.51672363,
                 112.52746582, 113.52722168, 114.51599121, 115.52124023,
                 116.51000977, 117.52075195, 118.52050781, 119.52026367,
                 120.51452637, 121.51428223, 122.50854492, 123.51379395,
                 124.50805664, 125.51879883, 126.51306152, 127.51831055,
                 128.51806641, 129.51782227, 130.5065918 , 131.51184082,
                 132.51159668, 133.5168457 , 134.5111084 , 135.52185059,
                 136.52709961, 137.53234863, 138.52111816, 139.52087402,
                 140.52062988, 141.53137207, 142.5201416 , 143.51989746,
                 144.52514648, 145.52490234, 146.5246582 , 147.52990723,
                 148.52416992, 149.52941895, 150.51269531, 151.51794434,
                 152.5177002 , 153.51745605, 154.52270508, 155.52246094,
                 156.51672363, 157.52746582, 158.51623535, 159.52148438,
                 160.52124023, 161.51550293, 162.52075195, 163.52050781,
                 164.51477051, 165.52001953, 166.51428223, 167.51953125,
                 168.51379395, 169.51904297, 170.51330566, 171.51306152,
                 172.51831055, 173.52355957, 174.51782227, 175.51757812,
                 176.51184082, 177.51159668, 178.50585938, 179.5111084 ,
                 180.51086426, 181.52160645, 182.51586914, 183.52111816,
                 184.52087402, 185.52612305, 186.52038574, 187.52563477,
                 188.51989746, 189.51965332, 190.51391602, 191.51916504,
                 192.51342773, 193.52416992, 194.51843262, 195.51818848,
                 196.5234375 , 197.52868652, 198.51745605, 199.51721191,
                 200.51696777, 201.52770996, 202.51647949, 203.51623535,
                 204.51599121, 205.52124023, 206.52099609, 207.52624512,
                 208.52050781, 209.52026367, 210.5090332 , 211.51428223,
                 212.51403809, 213.51928711, 214.51904297, 215.51879883,
                 216.51306152, 217.52380371, 218.51257324, 219.5123291 ,
                 220.51208496, 221.51184082, 222.51159668, 223.5168457 ,
                 224.51660156, 225.52185059, 226.52160645, 227.52685547,
                 228.52111816, 229.52087402, 230.52062988, 231.52587891,
                 232.52563477, 233.52539062, 234.52514648, 235.53039551,
                 236.5246582 , 237.52441406, 238.51318359, 239.51843262,
                 240.51818848, 241.5234375 , 242.51220703, 243.52294922,
                 244.52819824, 245.53344727, 246.51672363, 247.52197266,
                 248.51623535, 249.51599121, 250.51025391, 251.51550293,
                 252.50976562, 253.51501465, 254.51477051, 255.5255127 ,
                 256.51702881, 257.51678467, 258.51104736, 259.51629639,
                 260.51055908, 261.51580811, 262.51556396, 263.52081299,
                 264.51507568, 265.51483154, 266.5145874 , 267.51434326,
                 268.50311279, 269.50836182, 270.52459717, 271.52984619,
                 272.51312256, 273.51837158, 274.52362061, 275.52337646,
                 276.512146  , 277.51739502, 278.51715088, 279.53338623,
                 280.5166626 , 281.51641846, 282.52166748, 283.52142334,
                 284.51568604, 285.51544189, 286.51519775, 287.52044678,
                 288.51470947, 289.52545166, 290.51422119, 291.51947021,
                 292.51922607, 293.5244751 , 294.51873779, 295.52398682,
                 296.51275635, 297.51251221, 298.5067749 , 299.51751709,
                 300.51177979, 301.51153564, 302.50579834, 303.51104736,
                 304.51080322, 305.51605225, 306.51031494, 307.51556396,
                 308.50982666, 309.51507568, 310.50384521, 311.50909424,
                 312.50335693, 313.51409912, 314.50836182, 315.51361084,
                 316.52435303, 317.52960205, 318.51837158, 319.51812744,
                 320.5178833 , 321.52862549, 322.51739502, 323.51715088,
                 324.51690674, 325.5166626 , 326.51641846, 327.52716064,
                 328.52142334, 329.5211792 , 330.50994873, 331.51519775,
                 332.51495361, 333.51470947, 334.5199585 , 335.51971436,
                 336.51397705, 337.51922607, 338.51348877, 339.50775146,
                 340.51300049, 341.51824951, 342.51251221, 343.51226807,
                 344.51751709, 345.52276611, 346.51702881, 347.52227783,
                 348.51104736, 349.51080322, 350.51055908, 351.51580811,
                 352.51556396, 353.52081299, 354.51507568, 355.51483154,
                 356.5145874 , 357.51434326, 358.50311279, 359.51385498])
        • range
          (range)
          float32
          500.0 1500.0 ... 122500.0 123500.0
          units :
          meters
          standard_name :
          projection_range_coordinate
          long_name :
          range_to_measurement_volume
          spacing_is_constant :
          true
          axis :
          radial_range_coordinate
          meters_to_center_of_first_gate :
          500.0
          meters_between_gates :
          1000.0
          array([   500.,   1500.,   2500.,   3500.,   4500.,   5500.,   6500.,   7500.,
                   8500.,   9500.,  10500.,  11500.,  12500.,  13500.,  14500.,  15500.,
                  16500.,  17500.,  18500.,  19500.,  20500.,  21500.,  22500.,  23500.,
                  24500.,  25500.,  26500.,  27500.,  28500.,  29500.,  30500.,  31500.,
                  32500.,  33500.,  34500.,  35500.,  36500.,  37500.,  38500.,  39500.,
                  40500.,  41500.,  42500.,  43500.,  44500.,  45500.,  46500.,  47500.,
                  48500.,  49500.,  50500.,  51500.,  52500.,  53500.,  54500.,  55500.,
                  56500.,  57500.,  58500.,  59500.,  60500.,  61500.,  62500.,  63500.,
                  64500.,  65500.,  66500.,  67500.,  68500.,  69500.,  70500.,  71500.,
                  72500.,  73500.,  74500.,  75500.,  76500.,  77500.,  78500.,  79500.,
                  80500.,  81500.,  82500.,  83500.,  84500.,  85500.,  86500.,  87500.,
                  88500.,  89500.,  90500.,  91500.,  92500.,  93500.,  94500.,  95500.,
                  96500.,  97500.,  98500.,  99500., 100500., 101500., 102500., 103500.,
                 104500., 105500., 106500., 107500., 108500., 109500., 110500., 111500.,
                 112500., 113500., 114500., 115500., 116500., 117500., 118500., 119500.,
                 120500., 121500., 122500., 123500.], dtype=float32)
        • y
          (time, range)
          float64
          495.1 1.485e+03 ... 1.22e+05
          array([[   495.0742961 ,   1485.19848024,   2475.28998943, ...,
                  120056.22069653, 121042.21928584, 122028.18396726],
                 [   494.91962157,   1484.73446428,   2474.51664226, ...,
                  120018.71190364, 121004.40244047, 121990.05908   ],
                 [   494.6155247 ,   1483.82218867,   2472.99620797, ...,
                  119944.9679809 , 120930.05287311, 121915.10388885],
                 ...,
                 [   494.6290016 ,   1483.86261872,   2473.06359027, ...,
                  119948.23614896, 120933.34788201, 121918.42573766],
                 [   494.9258782 ,   1484.75323387,   2474.54792439, ...,
                  120020.22914592, 121005.93214356, 121991.60124348],
                 [   495.07701005,   1485.20662196,   2475.30355875, ...,
                  120056.87883364, 121042.88282811, 122028.85291449]])
        • z
          (time, range)
          float64
          254.7 394.2 ... 1.814e+04 1.829e+04
          array([[  254.70941051,   394.22621303,   534.23491321, ...,
                  17987.64612857, 18141.17427268, 18294.69857035],
                 [  254.70941051,   394.22621303,   534.23491321, ...,
                  17987.64612857, 18141.17427268, 18294.69857035],
                 [  254.70941051,   394.22621303,   534.23491321, ...,
                  17987.64612857, 18141.17427268, 18294.69857035],
                 ...,
                 [  254.70941051,   394.22621303,   534.23491321, ...,
                  17987.64612857, 18141.17427268, 18294.69857035],
                 [  254.70941051,   394.22621303,   534.23491321, ...,
                  17987.64612857, 18141.17427268, 18294.69857035],
                 [  254.70941051,   394.22621303,   534.23491321, ...,
                  17987.64612857, 18141.17427268, 18294.69857035]])
        • gr
          (time, range)
          float64
          495.1 1.485e+03 ... 1.22e+05
          array([[   495.09483146,   1485.26008533,   2475.39266289, ...,
                  120061.20055236, 121047.24004027, 122033.24561887],
                 [   495.09483146,   1485.26008533,   2475.39266289, ...,
                  120061.20055236, 121047.24004027, 122033.24561887],
                 [   495.09483146,   1485.26008533,   2475.39266289, ...,
                  120061.20055236, 121047.24004027, 122033.24561887],
                 ...,
                 [   495.09483146,   1485.26008533,   2475.39266289, ...,
                  120061.20055236, 121047.24004027, 122033.24561887],
                 [   495.09483146,   1485.26008533,   2475.39266289, ...,
                  120061.20055236, 121047.24004027, 122033.24561887],
                 [   495.09483146,   1485.26008533,   2475.39266289, ...,
                  120061.20055236, 121047.24004027, 122033.24561887]])
        • rays
          (time, range)
          float64
          0.5219 0.5219 ... 359.5 359.5
          array([[  0.52185059,   0.52185059,   0.52185059, ...,   0.52185059,
                    0.52185059,   0.52185059],
                 [  1.52435303,   1.52435303,   1.52435303, ...,   1.52435303,
                    1.52435303,   1.52435303],
                 [  2.5213623 ,   2.5213623 ,   2.5213623 , ...,   2.5213623 ,
                    2.5213623 ,   2.5213623 ],
                 ...,
                 [357.51434326, 357.51434326, 357.51434326, ..., 357.51434326,
                  357.51434326, 357.51434326],
                 [358.50311279, 358.50311279, 358.50311279, ..., 358.50311279,
                  358.50311279, 358.50311279],
                 [359.51385498, 359.51385498, 359.51385498, ..., 359.51385498,
                  359.51385498, 359.51385498]])
        • bins
          (time, range)
          float32
          500.0 1500.0 ... 122500.0 123500.0
          array([[   500.,   1500.,   2500., ..., 121500., 122500., 123500.],
                 [   500.,   1500.,   2500., ..., 121500., 122500., 123500.],
                 [   500.,   1500.,   2500., ..., 121500., 122500., 123500.],
                 ...,
                 [   500.,   1500.,   2500., ..., 121500., 122500., 123500.],
                 [   500.,   1500.,   2500., ..., 121500., 122500., 123500.],
                 [   500.,   1500.,   2500., ..., 121500., 122500., 123500.]],
                dtype=float32)
        • x
          (time, range)
          float64
          4.509 13.53 ... -1.035e+03
          array([[ 4.50926679e+00,  1.35275781e+01,  2.25455917e+01, ...,
                   1.09350361e+03,  1.10248434e+03,  1.11146477e+03],
                 [ 1.31704339e+01,  3.95106523e+01,  6.58500015e+01, ...,
                   3.19384894e+03,  3.22007941e+03,  3.24630897e+03],
                 [ 2.17801485e+01,  6.53393716e+01,  1.08897157e+02, ...,
                   5.28171697e+03,  5.32509469e+03,  5.36847092e+03],
                 ...,
                 [-2.14719099e+01, -6.44146711e+01, -1.07356015e+02, ...,
                  -5.20696868e+03, -5.24973251e+03, -5.29249487e+03],
                 [-1.29331833e+01, -3.87989121e+01, -6.46637874e+01, ...,
                  -3.13631533e+03, -3.16207328e+03, -3.18783035e+03],
                 [-4.20074569e+00, -1.26020300e+01, -2.10030370e+01, ...,
                  -1.01868680e+03, -1.02705308e+03, -1.03541907e+03]])
        • time
          (time)
          datetime64[ns]
          2020-07-05T17:58:15.752499968 ... 2020-07-05T17:58:15.696499712
          standard_name :
          time
          array(['2020-07-05T17:58:15.752499968', '2020-07-05T17:58:15.808499968',
                 '2020-07-05T17:58:15.863500032', ..., '2020-07-05T17:58:15.584499968',
                 '2020-07-05T17:58:15.639500032', '2020-07-05T17:58:15.696499712'],
                dtype='datetime64[ns]')
      • standard_name :
        radar_equivalent_reflectivity_factor_h
        long_name :
        Equivalent reflectivity factor H
        units :
        dBZ
      [21]:
      
      vol['sweep_10'].sweep_mode
      
      [21]:
      
      Show/Hide data repr Show/Hide attributes
      xarray.DataArray
      'sweep_mode'
      • 'azimuth_surveillance'
        array('azimuth_surveillance', dtype='<U20')
        • sweep_mode
          ()
          <U20
          'azimuth_surveillance'
          array('azimuth_surveillance', dtype='<U20')
        • latitude
          ()
          float64
          51.41
          array(51.40564)
        • altitude
          ()
          float64
          185.0
          array(185.)
        • longitude
          ()
          float64
          6.967
          array(6.96711)
      [22]:
      
      vol.root
      
      [22]:
      
      Show/Hide data repr Show/Hide attributes
      xarray.Dataset
        • sweep: 10
          • volume_number
            ()
            int64
            0
            array(0)
          • platform_type
            ()
            <U5
            'fixed'
            array('fixed', dtype='<U5')
          • instrument_type
            ()
            <U5
            'radar'
            array('radar', dtype='<U5')
          • primary_axis
            ()
            <U6
            'axis_z'
            array('axis_z', dtype='<U6')
          • time_coverage_start
            ()
            <U20
            '2020-07-05T17:55:35Z'
            array('2020-07-05T17:55:35Z', dtype='<U20')
          • time_coverage_end
            ()
            <U20
            '2020-07-05T17:59:02Z'
            array('2020-07-05T17:59:02Z', dtype='<U20')
          • latitude
            ()
            float64
            51.41
            array(51.40564)
          • longitude
            ()
            float64
            6.967
            array(6.96711)
          • altitude
            ()
            float64
            185.0
            array(185.)
          • altitude_agl
            ()
            float64
            nan
            array(nan)
          • sweep_group_name
            (sweep)
            <U8
            'sweep_1' 'sweep_2' ... 'sweep_10'
            array(['sweep_1', 'sweep_2', 'sweep_3', 'sweep_4', 'sweep_5', 'sweep_6',
                   'sweep_7', 'sweep_8', 'sweep_9', 'sweep_10'], dtype='<U8')
          • sweep_fixed_angle
            (sweep)
            float64
            12.0 5.499 17.0 ... 0.4999 7.998
            array([12.00256348,  5.49865723, 17.00134277,  3.49914551, 24.99938965,
                    1.49963379,  2.49938965,  4.49890137,  0.49987793,  7.99804688])
          • frequency
            ()
            float64
            nan
            array(nan)
          • status_xml
            ()
            <U4
            'None'
            array('None', dtype='<U4')
        • Conventions :
          Cf/Radial
          version :
          H5rad 2.2
          title :
          None
          institution :
          WMO:10410,NOD:deess
          references :
          None
          source :
          None
          history :
          None
          comment :
          im/exported using wradlib
          instrument_name :
          None
          site_name :
          name of site where data were gathered
          scan_name :
          name of scan strategy used, if applicable
          scan_id :
          scan strategy id, if applicable. assumed 0 if missing
          platform_is_mobile :
          "true" or "false", assumed "false" if missing
          ray_times_increase :
          "true" or "false", assumed "true" if missing. This is set to true if ray times increase monotonically thoughout all of the sweeps in the volume
          field_names :
          array of strings of field names present in this file.
          time_coverage_start :
          copy of time_coverage_start global variable
          time_coverage_end :
          copy of time_coverage_end global variable
          simulated data :
          "true" or "false", assumed "false" if missing. data in this file are simulated
          instrument :
          WMO:10410,NOD:deess
        [23]:
        
        #vol.root = vol.root.assign(longitude=vol.root.longitude[0])
        #vol.root = vol.root.assign(latitude=vol.root.latitude[0])
        #vol.root = vol.root.assign(altitude=vol.root.altitude[0])
        

        Export to OdimH5

        This exports the radar volume including all moments into one ODIM_H5 compliant data file.

        [24]:
        
        vol.to_odim('dwd_odim.h5')
        

        Export to Cf/Radial2

        This exports the radar volume including all moments into one Cf/Radial2 compliant data file.

        [25]:
        
        vol.to_cfradial2('dwd_cfradial2.nc')
        

        Import again and check equality

        Small time differences are possible so drop times before comparison

        [26]:
        
        try:
            vol1 = OdimH5('dwd_odim.h5', standard='cf', georef=True)
            vol2 = CfRadial('dwd_cfradial2.nc', dim0='azimuth', georef=True)
            xr.testing.assert_equal(vol1.root, vol2.root)
            xr.testing.assert_equal(vol1['sweep_1'].drop('time'), vol2['sweep_1'].drop('time'))
        except:
            pass