Recipe #2: Reading and visualizing an ODIM_H5 polar volume#
This recipe shows how extract the polar volume data from an ODIM_H5 hdf5 file (KNMI example file from OPERA), contruct a 3-dimensional Cartesian volume and produce a diagnostic plot. The challenge for this file is that for each elevation angle, the scan strategy is different.
[2]:
import datetime as dt
from osgeo import osr
# read the data (sample file in WRADLIB_DATA)
filename = wrl.util.get_wradlib_data_file("hdf5/knmi_polar_volume.h5")
raw_dt = xd.io.open_odim_datatree(filename)
display(raw_dt)
<xarray.DatasetView> Dimensions: () Data variables: volume_number int64 0 platform_type <U5 'fixed' instrument_type <U5 'radar' time_coverage_start <U20 '2011-06-10T11:40:02Z' time_coverage_end <U20 '2011-06-10T11:43:54Z' longitude float32 4.79 altitude float32 50.0 latitude float32 52.95 Attributes: Conventions: ODIM_H5/V2_0 version: None title: None institution: None references: None source: None history: None comment: im/exported using xradar instrument_name: None
datatree.DataTree
- azimuth: 360
- range: 320
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:40:17.361118208 .....
- standard_name :
- time
array(['2011-06-10T11:40:17.361118208', '2011-06-10T11:40:17.416673792', '2011-06-10T11:40:17.472229376', ..., '2011-06-10T11:40:17.194451456', '2011-06-10T11:40:17.250007040', '2011-06-10T11:40:17.305562624'], dtype='datetime64[ns]')
- range(range)float32500.0 1.5e+03 ... 3.195e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 1000.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 500.0
array([ 500., 1500., 2500., ..., 317500., 318500., 319500.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[115200 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 320) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:40:17.361118208... * range (range) float32 500.0 1.5e+03 ... 3.185e+05 3.195e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_0- azimuth: 360
- range: 240
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:40:36.805558272 .....
- standard_name :
- time
array(['2011-06-10T11:40:36.805558272', '2011-06-10T11:40:36.861113856', '2011-06-10T11:40:36.916669440', ..., '2011-06-10T11:40:36.638891520', '2011-06-10T11:40:36.694447104', '2011-06-10T11:40:36.750002688'], dtype='datetime64[ns]')
- range(range)float32500.0 1.5e+03 ... 2.395e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 1000.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 500.0
array([ 500., 1500., 2500., ..., 237500., 238500., 239500.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[86400 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 240) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:40:36.805558272... * range (range) float32 500.0 1.5e+03 ... 2.385e+05 2.395e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_1- azimuth: 360
- range: 240
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:40:56.305557504 .....
- standard_name :
- time
array(['2011-06-10T11:40:56.305557504', '2011-06-10T11:40:56.361113088', '2011-06-10T11:40:56.416668672', ..., '2011-06-10T11:40:56.138890752', '2011-06-10T11:40:56.194446336', '2011-06-10T11:40:56.250001920'], dtype='datetime64[ns]')
- range(range)float32500.0 1.5e+03 ... 2.395e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 1000.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 500.0
array([ 500., 1500., 2500., ..., 237500., 238500., 239500.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[86400 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 240) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:40:56.305557504... * range (range) float32 500.0 1.5e+03 ... 2.385e+05 2.395e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_2- azimuth: 360
- range: 240
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:41:15.805556736 .....
- standard_name :
- time
array(['2011-06-10T11:41:15.805556736', '2011-06-10T11:41:15.861112320', '2011-06-10T11:41:15.916667904', ..., '2011-06-10T11:41:15.638889984', '2011-06-10T11:41:15.694445568', '2011-06-10T11:41:15.750001152'], dtype='datetime64[ns]')
- range(range)float32500.0 1.5e+03 ... 2.395e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 1000.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 500.0
array([ 500., 1500., 2500., ..., 237500., 238500., 239500.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[86400 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 240) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:41:15.805556736... * range (range) float32 500.0 1.5e+03 ... 2.385e+05 2.395e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_3- azimuth: 360
- range: 240
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:41:36.305555968 .....
- standard_name :
- time
array(['2011-06-10T11:41:36.305555968', '2011-06-10T11:41:36.361111552', '2011-06-10T11:41:36.416667136', ..., '2011-06-10T11:41:36.138889216', '2011-06-10T11:41:36.194444800', '2011-06-10T11:41:36.250000384'], dtype='datetime64[ns]')
- range(range)float32500.0 1.5e+03 ... 2.395e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 1000.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 500.0
array([ 500., 1500., 2500., ..., 237500., 238500., 239500.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[86400 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 240) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:41:36.305555968... * range (range) float32 500.0 1.5e+03 ... 2.385e+05 2.395e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_4- azimuth: 360
- range: 340
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:42:10.479194112 .....
- standard_name :
- time
array(['2011-06-10T11:42:10.479194112', '2011-06-10T11:42:10.520860928', '2011-06-10T11:42:10.562527744', ..., '2011-06-10T11:42:10.354193920', '2011-06-10T11:42:10.395860736', '2011-06-10T11:42:10.437527296'], dtype='datetime64[ns]')
- range(range)float32250.0 750.0 ... 1.692e+05 1.698e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 500.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 250.0
array([ 250., 750., 1250., ..., 168750., 169250., 169750.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[122400 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 340) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:42:10.479194112... * range (range) float32 250.0 750.0 ... 1.692e+05 1.698e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_5- azimuth: 360
- range: 340
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:42:24.770857472 .....
- standard_name :
- time
array(['2011-06-10T11:42:24.770857472', '2011-06-10T11:42:24.812524288', '2011-06-10T11:42:24.854191104', ..., '2011-06-10T11:42:24.645857280', '2011-06-10T11:42:24.687524096', '2011-06-10T11:42:24.729190912'], dtype='datetime64[ns]')
- range(range)float32250.0 750.0 ... 1.692e+05 1.698e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 500.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 250.0
array([ 250., 750., 1250., ..., 168750., 169250., 169750.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[122400 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 340) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:42:24.770857472... * range (range) float32 250.0 750.0 ... 1.692e+05 1.698e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_6- azimuth: 360
- range: 300
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:42:37.716658432 .....
- standard_name :
- time
array(['2011-06-10T11:42:37.716658432', '2011-06-10T11:42:37.749991680', '2011-06-10T11:42:37.783324928', ..., '2011-06-10T11:42:37.616658432', '2011-06-10T11:42:37.649991680', '2011-06-10T11:42:37.683324928'], dtype='datetime64[ns]')
- range(range)float32250.0 750.0 ... 1.492e+05 1.498e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 500.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 250.0
array([ 250., 750., 1250., ..., 148750., 149250., 149750.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[108000 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 300) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:42:37.716658432... * range (range) float32 250.0 750.0 ... 1.492e+05 1.498e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_7- azimuth: 360
- range: 300
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:42:49.016659968 .....
- standard_name :
- time
array(['2011-06-10T11:42:49.016659968', '2011-06-10T11:42:49.049993216', '2011-06-10T11:42:49.083326464', ..., '2011-06-10T11:42:48.916659968', '2011-06-10T11:42:48.949993472', '2011-06-10T11:42:48.983326720'], dtype='datetime64[ns]')
- range(range)float32250.0 750.0 ... 1.492e+05 1.498e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 500.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 250.0
array([ 250., 750., 1250., ..., 148750., 149250., 149750.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[108000 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 300) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:42:49.016659968... * range (range) float32 250.0 750.0 ... 1.492e+05 1.498e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_8- azimuth: 360
- range: 240
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:42:59.791652096 .....
- standard_name :
- time
array(['2011-06-10T11:42:59.791652096', '2011-06-10T11:42:59.819429888', '2011-06-10T11:42:59.847207424', ..., '2011-06-10T11:42:59.708319232', '2011-06-10T11:42:59.736096768', '2011-06-10T11:42:59.763874560'], dtype='datetime64[ns]')
- range(range)float32250.0 750.0 ... 1.192e+05 1.198e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 500.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 250.0
array([ 250., 750., 1250., ..., 118750., 119250., 119750.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[86400 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 240) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:42:59.791652096... * range (range) float32 250.0 750.0 ... 1.192e+05 1.198e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_9- azimuth: 360
- range: 240
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:43:09.541660672 .....
- standard_name :
- time
array(['2011-06-10T11:43:09.541660672', '2011-06-10T11:43:09.569438464', '2011-06-10T11:43:09.597216256', ..., '2011-06-10T11:43:09.458327808', '2011-06-10T11:43:09.486105344', '2011-06-10T11:43:09.513883136'], dtype='datetime64[ns]')
- range(range)float32250.0 750.0 ... 1.192e+05 1.198e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 500.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 250.0
array([ 250., 750., 1250., ..., 118750., 119250., 119750.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[86400 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 240) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:43:09.541660672... * range (range) float32 250.0 750.0 ... 1.192e+05 1.198e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_10- azimuth: 360
- range: 240
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:43:29.874966272 .....
- standard_name :
- time
array(['2011-06-10T11:43:29.874966272', '2011-06-10T11:43:29.902743808', '2011-06-10T11:43:29.930521600', ..., '2011-06-10T11:43:29.791633152', '2011-06-10T11:43:29.819410688', '2011-06-10T11:43:29.847188480'], dtype='datetime64[ns]')
- range(range)float32250.0 750.0 ... 1.192e+05 1.198e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 500.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 250.0
array([ 250., 750., 1250., ..., 118750., 119250., 119750.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[86400 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 240) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:43:29.874966272... * range (range) float32 250.0 750.0 ... 1.192e+05 1.198e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_11- azimuth: 360
- range: 240
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:43:39.236087296 .....
- standard_name :
- time
array(['2011-06-10T11:43:39.236087296', '2011-06-10T11:43:39.263865088', '2011-06-10T11:43:39.291642624', ..., '2011-06-10T11:43:39.152754432', '2011-06-10T11:43:39.180531968', '2011-06-10T11:43:39.208309760'], dtype='datetime64[ns]')
- range(range)float32250.0 750.0 ... 1.192e+05 1.198e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 500.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 250.0
array([ 250., 750., 1250., ..., 118750., 119250., 119750.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[86400 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 240) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:43:39.236087296... * range (range) float32 250.0 750.0 ... 1.192e+05 1.198e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_12- azimuth: 360
- range: 240
- azimuth(azimuth)float320.5 1.5 2.5 ... 357.5 358.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5], dtype=float32)
- elevation(azimuth)float32...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
[360 values with dtype=float32]
- time(azimuth)datetime64[ns]2011-06-10T11:43:48.763874560 .....
- standard_name :
- time
array(['2011-06-10T11:43:48.763874560', '2011-06-10T11:43:48.791652096', '2011-06-10T11:43:48.819429888', ..., '2011-06-10T11:43:48.680541440', '2011-06-10T11:43:48.708319232', '2011-06-10T11:43:48.736096768'], dtype='datetime64[ns]')
- range(range)float32250.0 750.0 ... 1.192e+05 1.198e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 500.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 250.0
array([ 250., 750., 1250., ..., 118750., 119250., 119750.], dtype=float32)
- longitude()float32...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
[1 values with dtype=float32]
- latitude()float32...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
[1 values with dtype=float32]
- altitude()float32...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
[1 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
[86400 values with dtype=float32]
- sweep_mode()<U20...
[1 values with dtype=<U20]
- sweep_number()int64...
[1 values with dtype=int64]
- prt_mode()<U7...
[1 values with dtype=<U7]
- follow_mode()<U7...
[1 values with dtype=<U7]
- sweep_fixed_angle()float32...
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 240) Coordinates: * azimuth (azimuth) float32 0.5 1.5 2.5 3.5 ... 357.5 358.5 359.5 elevation (azimuth) float32 ... time (azimuth) datetime64[ns] 2011-06-10T11:43:48.763874560... * range (range) float32 250.0 750.0 ... 1.192e+05 1.198e+05 longitude float32 ... latitude float32 ... altitude float32 ... Data variables: DBZH (azimuth, range) float32 ... sweep_mode <U20 ... sweep_number int64 ... prt_mode <U7 ... follow_mode <U7 ... sweep_fixed_angle float32 ...
sweep_13- volume_number()int640
array(0)
- platform_type()<U5'fixed'
array('fixed', dtype='<U5')
- instrument_type()<U5'radar'
array('radar', dtype='<U5')
- time_coverage_start()<U20'2011-06-10T11:40:02Z'
array('2011-06-10T11:40:02Z', dtype='<U20')
- time_coverage_end()<U20'2011-06-10T11:43:54Z'
array('2011-06-10T11:43:54Z', dtype='<U20')
- longitude()float324.79
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
array(4.78997, dtype=float32)
- altitude()float3250.0
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
array(50., dtype=float32)
- latitude()float3252.95
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
array(52.95334, dtype=float32)
- Conventions :
- ODIM_H5/V2_0
- version :
- None
- title :
- None
- institution :
- None
- references :
- None
- source :
- None
- history :
- None
- comment :
- im/exported using xradar
- instrument_name :
- None
[3]:
proj = osr.SpatialReference()
proj.ImportFromEPSG(32632)
for key in list(raw_dt.children):
if "sweep" in key:
raw_dt[key].ds = raw_dt[key].ds.wrl.georef.georeference(crs=proj)
[4]:
swp_list = []
for key in list(raw_dt.children):
if "sweep" in key:
ds = raw_dt[key].ds
xyz = (
xr.concat(
[
ds.coords["x"].reset_coords(drop=True),
ds.coords["y"].reset_coords(drop=True),
ds.coords["z"].reset_coords(drop=True),
],
"xyz",
)
.stack(npoints=("azimuth", "range"))
.transpose(..., "xyz")
)
swp_list.append(xyz)
xyz = xr.concat(swp_list, "npoints")
[5]:
swp_list[0]
[5]:
<xarray.DataArray 'x' (npoints: 115200, xyz: 3)> array([[2.17262259e+05, 5.87587733e+06, 5.30000000e+01], [2.17329665e+05, 5.87687562e+06, 5.80000000e+01], [2.17397078e+05, 5.87787390e+06, 6.40000000e+01], ..., [2.33423523e+05, 6.19241547e+06, 7.64800000e+03], [2.33475527e+05, 6.19341275e+06, 7.69100000e+03], [2.33527539e+05, 6.19441006e+06, 7.73400000e+03]]) Coordinates: * npoints (npoints) object MultiIndex * azimuth (npoints) float32 0.5 0.5 0.5 0.5 0.5 ... 359.5 359.5 359.5 359.5 * range (npoints) float32 500.0 1.5e+03 2.5e+03 ... 3.185e+05 3.195e+05 Dimensions without coordinates: xyz
xarray.DataArray
'x'
- npoints: 115200
- xyz: 3
- 2.173e+05 5.876e+06 53.0 2.173e+05 ... 2.335e+05 6.194e+06 7.734e+03
array([[2.17262259e+05, 5.87587733e+06, 5.30000000e+01], [2.17329665e+05, 5.87687562e+06, 5.80000000e+01], [2.17397078e+05, 5.87787390e+06, 6.40000000e+01], ..., [2.33423523e+05, 6.19241547e+06, 7.64800000e+03], [2.33475527e+05, 6.19341275e+06, 7.69100000e+03], [2.33527539e+05, 6.19441006e+06, 7.73400000e+03]])
- npoints(npoints)objectMultiIndex
array([(0.5, 500.0), (0.5, 1500.0), (0.5, 2500.0), ..., (359.5, 317500.0), (359.5, 318500.0), (359.5, 319500.0)], dtype=object)
- azimuth(npoints)float320.5 0.5 0.5 ... 359.5 359.5 359.5
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
array([ 0.5, 0.5, 0.5, ..., 359.5, 359.5, 359.5], dtype=float32)
- range(npoints)float32500.0 1.5e+03 ... 3.195e+05
- units :
- meters
- standard_name :
- projection_range_coordinate
- long_name :
- range_to_measurement_volume
- axis :
- radial_range_coordinate
- meters_between_gates :
- 1000.0
- spacing_is_constant :
- true
- meters_to_center_of_first_gate :
- 500.0
array([ 500., 1500., 2500., ..., 317500., 318500., 319500.], dtype=float32)
- npoints
azimuth
rangePandasMultiIndexPandasIndex(MultiIndex([( 0.5, 500.0), ( 0.5, 1500.0), ( 0.5, 2500.0), ( 0.5, 3500.0), ( 0.5, 4500.0), ( 0.5, 5500.0), ( 0.5, 6500.0), ( 0.5, 7500.0), ( 0.5, 8500.0), ( 0.5, 9500.0), ... (359.5, 310500.0), (359.5, 311500.0), (359.5, 312500.0), (359.5, 313500.0), (359.5, 314500.0), (359.5, 315500.0), (359.5, 316500.0), (359.5, 317500.0), (359.5, 318500.0), (359.5, 319500.0)], name='npoints', length=115200))
[6]:
data_list = []
for key in list(raw_dt.children):
if "sweep" in key:
ds = raw_dt[key].ds
data = ds.DBZH.stack(npoints=("azimuth", "range"))
data_list.append(data)
data = xr.concat(data_list, "npoints")
[7]:
# generate 3-D Cartesian target grid coordinates
sitecoords = (raw_dt.longitude.values, raw_dt.latitude.values, raw_dt.altitude.values)
maxrange = 200000.0
minelev = 0.1
maxelev = 25.0
maxalt = 5000.0
horiz_res = 2000.0
vert_res = 250.0
trgxyz, trgshape = wrl.vpr.make_3d_grid(
sitecoords, proj, maxrange, maxalt, horiz_res, vert_res
)
[8]:
# interpolate to Cartesian 3-D volume grid
tstart = dt.datetime.now()
gridder = wrl.vpr.CAPPI(
xyz.values,
trgxyz,
# gridshape=trgshape,
maxrange=maxrange,
minelev=minelev,
maxelev=maxelev,
)
vol = np.ma.masked_invalid(gridder(data.values).reshape(trgshape))
print("3-D interpolation took:", dt.datetime.now() - tstart)
3-D interpolation took: 0:00:01.350824
[9]:
# diagnostic plot
trgx = trgxyz[:, 0].reshape(trgshape)[0, 0, :]
trgy = trgxyz[:, 1].reshape(trgshape)[0, :, 0]
trgz = trgxyz[:, 2].reshape(trgshape)[:, 0, 0]
wrl.vis.plot_max_plan_and_vert(
trgx,
trgy,
trgz,
vol,
unit="dBZH",
levels=range(-32, 60),
cmap="turbo",
)

Note
In order to run the recipe code, you need to extract the sample data into a directory pointed to by environment variable WRADLIB_DATA
.