along the example of cluttermap creation
See question on openradar discourse.
We will make use of the following Open Source Software Packages:
import xarray as xr
import datatree
import xradar
import wradlib as wrl
import matplotlib.pyplot as plt
fname = "BHP210601110223.nc"
def extract_clutter(da, refl, cmap, wsize=3, thrsnorain=0, tr1=6.0, n_p=6, tr2=1.3, rm_nans=False):
if refl in da.variables:
da = da.assign({cmap: xr.apply_ufunc(
wrl.clutter.filter_gabella,
da[refl],
input_core_dims=[["azimuth", "range"]],
output_core_dims=[["azimuth", "range"]],
dask="parallelized",
kwargs=dict(
wsize=wsize,
thrsnorain=thrsnorain,
tr1=tr1,
n_p=n_p,
tr2=tr2,
rm_nans=rm_nans,
),
)})
return da
We make use of our new openradar community package xradar
which builds on xarray
and xarray-datatree
.
vol = xradar.io.open_cfradial1_datatree(fname)
display(vol)
<xarray.DatasetView> Dimensions: (sweep: 10) Dimensions without coordinates: sweep Data variables: sweep_group_name (sweep) <U7 'sweep_0' 'sweep_1' ... 'sweep_8' 'sweep_9' sweep_fixed_angle (sweep) float32 ... latitude float64 ... longitude float64 ... altitude float64 ... time_coverage_start |S32 ... time_coverage_end |S32 ... volume_number int32 ... platform_type |S32 ... instrument_type |S32 ... primary_axis |S32 ... Attributes: Conventions: CF/Radial instrument_parameters version: 1.3 title: institution: references: source: comment: instrument_name: BHOPAL-RADAR history:
<xarray.DatasetView> Dimensions: () Data variables: radar_beam_width_v float32 ... radar_beam_width_h float32 ...
[1 values with dtype=float32]
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: () Data variables: *empty*
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 500) Coordinates: time (azimuth) datetime64[ns] 2021-06-01T11:02:49 ... 2021-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 * azimuth (azimuth) float32 0.9778 2.0 2.999 ... 358.0 359.0 360.0 elevation (azimuth) float32 ... latitude float64 ... longitude float64 ... altitude float64 ... Data variables: (12/13) reflectivity (azimuth, range) float32 ... velocity (azimuth, range) float32 ... spectrum_width (azimuth, range) float32 ... R (azimuth, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... ... ... pulse_width (azimuth) timedelta64[ns] ... prt_mode |S32 ... prt (azimuth) timedelta64[ns] ... prt_ratio (azimuth) float32 ... nyquist_velocity (azimuth) float32 ... unambiguous_range (azimuth) float32 ...
array(['2021-06-01T11:02:49.000000000', '2021-06-01T11:02:49.000000000', '2021-06-01T11:02:49.000000000', ..., '2021-06-01T11:02:49.000000000', '2021-06-01T11:02:49.000000000', '2021-06-01T11:02:49.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
array([ 0.977783, 1.999511, 2.999268, ..., 358.03345 , 358.9975 , 359.98077 ], dtype=float32)
[360 values with dtype=float32]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=float64]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[360 values with dtype=float32]
[360 values with dtype=float32]
[360 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 500) Coordinates: time (azimuth) datetime64[ns] 2021-06-01T11:03:19 ... 2021-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 * azimuth (azimuth) float32 0.9998 2.013 3.035 ... 359.0 360.0 elevation (azimuth) float32 ... latitude float64 ... longitude float64 ... altitude float64 ... Data variables: (12/13) reflectivity (azimuth, range) float32 ... velocity (azimuth, range) float32 ... spectrum_width (azimuth, range) float32 ... R (azimuth, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... ... ... pulse_width (azimuth) timedelta64[ns] ... prt_mode |S32 ... prt (azimuth) timedelta64[ns] ... prt_ratio (azimuth) float32 ... nyquist_velocity (azimuth) float32 ... unambiguous_range (azimuth) float32 ...
array(['2021-06-01T11:03:19.000000000', '2021-06-01T11:03:19.000000000', '2021-06-01T11:03:19.000000000', ..., '2021-06-01T11:03:19.000000000', '2021-06-01T11:03:19.000000000', '2021-06-01T11:03:19.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
array([ 0.999756, 2.013244, 3.034973, ..., 358.00873 , 359.00574 , 359.98627 ], dtype=float32)
[360 values with dtype=float32]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=float64]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[360 values with dtype=float32]
[360 values with dtype=float32]
[360 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 500) Coordinates: time (azimuth) datetime64[ns] 2021-06-01T11:03:49 ... 2021-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 * azimuth (azimuth) float32 0.9888 2.013 3.021 ... 359.0 360.0 elevation (azimuth) float32 ... latitude float64 ... longitude float64 ... altitude float64 ... Data variables: (12/13) reflectivity (azimuth, range) float32 ... velocity (azimuth, range) float32 ... spectrum_width (azimuth, range) float32 ... R (azimuth, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... ... ... pulse_width (azimuth) timedelta64[ns] ... prt_mode |S32 ... prt (azimuth) timedelta64[ns] ... prt_ratio (azimuth) float32 ... nyquist_velocity (azimuth) float32 ... unambiguous_range (azimuth) float32 ...
array(['2021-06-01T11:03:49.000000000', '2021-06-01T11:03:49.000000000', '2021-06-01T11:03:49.000000000', ..., '2021-06-01T11:03:48.000000000', '2021-06-01T11:03:48.000000000', '2021-06-01T11:03:48.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
array([ 0.98877 , 2.013244, 3.02124 , ..., 358.01422 , 359.01398 , 359.99176 ], dtype=float32)
[360 values with dtype=float32]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=float64]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[360 values with dtype=float32]
[360 values with dtype=float32]
[360 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 500) Coordinates: time (azimuth) datetime64[ns] 2021-06-01T11:04:48 ... 2021-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 * azimuth (azimuth) float32 0.9998 1.991 2.991 ... 359.0 360.0 elevation (azimuth) float32 ... latitude float64 ... longitude float64 ... altitude float64 ... Data variables: (12/13) reflectivity (azimuth, range) float32 ... velocity (azimuth, range) float32 ... spectrum_width (azimuth, range) float32 ... R (azimuth, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... ... ... pulse_width (azimuth) timedelta64[ns] ... prt_mode |S32 ... prt (azimuth) timedelta64[ns] ... prt_ratio (azimuth) float32 ... nyquist_velocity (azimuth) float32 ... unambiguous_range (azimuth) float32 ...
array(['2021-06-01T11:04:48.000000000', '2021-06-01T11:04:48.000000000', '2021-06-01T11:04:48.000000000', ..., '2021-06-01T11:04:47.000000000', '2021-06-01T11:04:47.000000000', '2021-06-01T11:04:47.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
array([ 0.999756, 1.991272, 2.991028, ..., 357.9895 , 359.00024 , 359.99176 ], dtype=float32)
[360 values with dtype=float32]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=float64]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[360 values with dtype=float32]
[360 values with dtype=float32]
[360 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 500) Coordinates: time (azimuth) datetime64[ns] 2021-06-01T11:05:17 ... 2021-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 * azimuth (azimuth) float32 0.005487 0.9998 2.01 ... 358.0 359.0 elevation (azimuth) float32 ... latitude float64 ... longitude float64 ... altitude float64 ... Data variables: (12/13) reflectivity (azimuth, range) float32 ... velocity (azimuth, range) float32 ... spectrum_width (azimuth, range) float32 ... R (azimuth, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... ... ... pulse_width (azimuth) timedelta64[ns] ... prt_mode |S32 ... prt (azimuth) timedelta64[ns] ... prt_ratio (azimuth) float32 ... nyquist_velocity (azimuth) float32 ... unambiguous_range (azimuth) float32 ...
array(['2021-06-01T11:05:17.000000000', '2021-06-01T11:05:17.000000000', '2021-06-01T11:05:17.000000000', ..., '2021-06-01T11:05:17.000000000', '2021-06-01T11:05:17.000000000', '2021-06-01T11:05:17.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
array([5.487279e-03, 9.997557e-01, 2.010498e+00, ..., 3.570007e+02, 3.580115e+02, 3.590112e+02], dtype=float32)
[360 values with dtype=float32]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=float64]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[360 values with dtype=float32]
[360 values with dtype=float32]
[360 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 500) Coordinates: time (azimuth) datetime64[ns] 2021-06-01T11:06:16 ... 2021-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 * azimuth (azimuth) float32 0.005489 1.022 1.994 ... 358.0 359.0 elevation (azimuth) float32 ... latitude float64 ... longitude float64 ... altitude float64 ... Data variables: (12/13) reflectivity (azimuth, range) float32 ... velocity (azimuth, range) float32 ... spectrum_width (azimuth, range) float32 ... R (azimuth, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... ... ... pulse_width (azimuth) timedelta64[ns] ... prt_mode |S32 ... prt (azimuth) timedelta64[ns] ... prt_ratio (azimuth) float32 ... nyquist_velocity (azimuth) float32 ... unambiguous_range (azimuth) float32 ...
array(['2021-06-01T11:06:16.000000000', '2021-06-01T11:06:16.000000000', '2021-06-01T11:05:47.000000000', ..., '2021-06-01T11:06:16.000000000', '2021-06-01T11:06:16.000000000', '2021-06-01T11:06:16.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
array([5.488968e-03, 1.021729e+00, 1.994018e+00, ..., 3.570090e+02, 3.580060e+02, 3.590085e+02], dtype=float32)
[360 values with dtype=float32]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=float64]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[360 values with dtype=float32]
[360 values with dtype=float32]
[360 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 500) Coordinates: time (azimuth) datetime64[ns] 2021-06-01T11:06:45 ... 2021-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 * azimuth (azimuth) float32 0.9998 2.008 3.013 ... 359.0 360.0 elevation (azimuth) float32 ... latitude float64 ... longitude float64 ... altitude float64 ... Data variables: (12/13) reflectivity (azimuth, range) float32 ... velocity (azimuth, range) float32 ... spectrum_width (azimuth, range) float32 ... R (azimuth, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... ... ... pulse_width (azimuth) timedelta64[ns] ... prt_mode |S32 ... prt (azimuth) timedelta64[ns] ... prt_ratio (azimuth) float32 ... nyquist_velocity (azimuth) float32 ... unambiguous_range (azimuth) float32 ...
array(['2021-06-01T11:06:45.000000000', '2021-06-01T11:06:45.000000000', '2021-06-01T11:06:45.000000000', ..., '2021-06-01T11:06:45.000000000', '2021-06-01T11:06:45.000000000', '2021-06-01T11:06:45.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
array([ 0.999756, 2.007751, 3.013 , ..., 358.01697 , 359.00024 , 359.9945 ], dtype=float32)
[360 values with dtype=float32]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=float64]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[360 values with dtype=float32]
[360 values with dtype=float32]
[360 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 500) Coordinates: time (azimuth) datetime64[ns] 2021-06-01T11:07:45 ... 2021-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 * azimuth (azimuth) float32 0.986 2.008 3.018 ... 358.0 359.0 360.0 elevation (azimuth) float32 ... latitude float64 ... longitude float64 ... altitude float64 ... Data variables: (12/13) reflectivity (azimuth, range) float32 ... velocity (azimuth, range) float32 ... spectrum_width (azimuth, range) float32 ... R (azimuth, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... ... ... pulse_width (azimuth) timedelta64[ns] ... prt_mode |S32 ... prt (azimuth) timedelta64[ns] ... prt_ratio (azimuth) float32 ... nyquist_velocity (azimuth) float32 ... unambiguous_range (azimuth) float32 ...
array(['2021-06-01T11:07:45.000000000', '2021-06-01T11:07:45.000000000', '2021-06-01T11:07:45.000000000', ..., '2021-06-01T11:07:44.000000000', '2021-06-01T11:07:45.000000000', '2021-06-01T11:07:45.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
array([ 0.986023, 2.007751, 3.018493, ..., 358.00598 , 359.003 , 359.989 ], dtype=float32)
[360 values with dtype=float32]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=float64]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[360 values with dtype=float32]
[360 values with dtype=float32]
[360 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 500) Coordinates: time (azimuth) datetime64[ns] 2021-06-01T11:08:43 ... 2021-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 * azimuth (azimuth) float32 0.9915 2.0 3.005 ... 358.0 359.0 360.0 elevation (azimuth) float32 ... latitude float64 ... longitude float64 ... altitude float64 ... Data variables: (12/13) reflectivity (azimuth, range) float32 ... velocity (azimuth, range) float32 ... spectrum_width (azimuth, range) float32 ... R (azimuth, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... ... ... pulse_width (azimuth) timedelta64[ns] ... prt_mode |S32 ... prt (azimuth) timedelta64[ns] ... prt_ratio (azimuth) float32 ... nyquist_velocity (azimuth) float32 ... unambiguous_range (azimuth) float32 ...
array(['2021-06-01T11:08:43.000000000', '2021-06-01T11:08:43.000000000', '2021-06-01T11:08:44.000000000', ..., '2021-06-01T11:08:43.000000000', '2021-06-01T11:08:43.000000000', '2021-06-01T11:08:43.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
array([ 0.991516, 1.999511, 3.004761, ..., 358.00323 , 359.00848 , 359.9945 ], dtype=float32)
[360 values with dtype=float32]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=float64]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[360 values with dtype=float32]
[360 values with dtype=float32]
[360 values with dtype=float32]
<xarray.DatasetView> Dimensions: (azimuth: 360, range: 500) Coordinates: time (azimuth) datetime64[ns] 2021-06-01T11:09:42 ... 2021-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 * azimuth (azimuth) float32 0.9998 1.997 3.013 ... 359.0 360.0 elevation (azimuth) float32 ... latitude float64 ... longitude float64 ... altitude float64 ... Data variables: (12/13) reflectivity (azimuth, range) float32 ... velocity (azimuth, range) float32 ... spectrum_width (azimuth, range) float32 ... R (azimuth, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... ... ... pulse_width (azimuth) timedelta64[ns] ... prt_mode |S32 ... prt (azimuth) timedelta64[ns] ... prt_ratio (azimuth) float32 ... nyquist_velocity (azimuth) float32 ... unambiguous_range (azimuth) float32 ...
array(['2021-06-01T11:09:42.000000000', '2021-06-01T11:09:42.000000000', '2021-06-01T11:09:43.000000000', ..., '2021-06-01T11:09:42.000000000', '2021-06-01T11:09:42.000000000', '2021-06-01T11:09:42.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
array([ 0.999756, 1.996765, 3.013 , ..., 358.00323 , 359.00574 , 359.9945 ], dtype=float32)
[360 values with dtype=float32]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=float64]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[1 values with dtype=|S32]
[360 values with dtype=timedelta64[ns]]
[360 values with dtype=float32]
[360 values with dtype=float32]
[360 values with dtype=float32]
array(['sweep_0', 'sweep_1', 'sweep_2', 'sweep_3', 'sweep_4', 'sweep_5', 'sweep_6', 'sweep_7', 'sweep_8', 'sweep_9'], dtype='<U7')
[10 values with dtype=float32]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[1 values with dtype=int32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
This uses xarray-datatree
functionality as well as xarray
and wradlib
.
vol = vol.map_over_subtree(extract_clutter, "reflectivity", "CMAP", wsize=3, thrsnorain=0.0, tr1=14, n_p=2, tr2=1.5, rm_nans=False)
Uses xradar
.
new_name = "new_cfradial2_volume.nc"
xradar.io.export.to_cfradial2(vol, new_name)
Uses xarray-datatree
.
nvol = datatree.open_datatree(new_name)
display(nvol)
<xarray.DatasetView> Dimensions: (sweep: 10) Dimensions without coordinates: sweep Data variables: sweep_group_name (sweep) object ... sweep_fixed_angle (sweep) float32 ... latitude float64 ... longitude float64 ... altitude float64 ... time_coverage_start |S32 ... time_coverage_end |S32 ... volume_number int32 ... platform_type |S32 ... instrument_type |S32 ... primary_axis |S32 ... Attributes: Conventions: Cf/Radial version: 2.0 title: institution: references: source: comment: instrument_name: BHOPAL-RADAR history: : xradar v0.0.0 CfRadial2 export
<xarray.DatasetView> Dimensions: () Data variables: radar_beam_width_v float32 ... radar_beam_width_h float32 ...
[1 values with dtype=float32]
[1 values with dtype=float32]
<xarray.DatasetView> Dimensions: () Data variables: *empty*
<xarray.DatasetView> Dimensions: (time: 360, range: 500) Coordinates: * time (time) datetime64[ns] 2021-06-01T11:02:23 ... 2021-06-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 azimuth (time) float32 ... elevation (time) float32 ... Data variables: reflectivity (time, range) float32 ... velocity (time, range) float32 ... spectrum_width (time, range) float32 ... R (time, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... sweep_mode |S32 ... prt_mode |S32 ... CMAP (time, range) bool ...
array(['2021-06-01T11:02:23.000000000', '2021-06-01T11:02:24.000000000', '2021-06-01T11:02:24.000000000', ..., '2021-06-01T11:02:53.000000000', '2021-06-01T11:02:53.000000000', '2021-06-01T11:02:53.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
[360 values with dtype=float32]
[360 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[180000 values with dtype=bool]
<xarray.DatasetView> Dimensions: (time: 360, range: 500) Coordinates: * time (time) datetime64[ns] 2021-06-01T11:02:56 ... 2021-06-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 azimuth (time) float32 ... elevation (time) float32 ... Data variables: reflectivity (time, range) float32 ... velocity (time, range) float32 ... spectrum_width (time, range) float32 ... R (time, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... sweep_mode |S32 ... prt_mode |S32 ... CMAP (time, range) bool ...
array(['2021-06-01T11:02:56.000000000', '2021-06-01T11:02:56.000000000', '2021-06-01T11:02:56.000000000', ..., '2021-06-01T11:03:25.000000000', '2021-06-01T11:03:25.000000000', '2021-06-01T11:03:25.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
[360 values with dtype=float32]
[360 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[180000 values with dtype=bool]
<xarray.DatasetView> Dimensions: (time: 360, range: 500) Coordinates: * time (time) datetime64[ns] 2021-06-01T11:03:28 ... 2021-06-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 azimuth (time) float32 ... elevation (time) float32 ... Data variables: reflectivity (time, range) float32 ... velocity (time, range) float32 ... spectrum_width (time, range) float32 ... R (time, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... sweep_mode |S32 ... prt_mode |S32 ... CMAP (time, range) bool ...
array(['2021-06-01T11:03:28.000000000', '2021-06-01T11:03:29.000000000', '2021-06-01T11:03:29.000000000', ..., '2021-06-01T11:03:58.000000000', '2021-06-01T11:03:58.000000000', '2021-06-01T11:03:58.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
[360 values with dtype=float32]
[360 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[180000 values with dtype=bool]
<xarray.DatasetView> Dimensions: (time: 360, range: 500) Coordinates: * time (time) datetime64[ns] 2021-06-01T11:04:19 ... 2021-06-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 azimuth (time) float32 ... elevation (time) float32 ... Data variables: reflectivity (time, range) float32 ... velocity (time, range) float32 ... spectrum_width (time, range) float32 ... R (time, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... sweep_mode |S32 ... prt_mode |S32 ... CMAP (time, range) bool ...
array(['2021-06-01T11:04:19.000000000', '2021-06-01T11:04:19.000000000', '2021-06-01T11:04:19.000000000', ..., '2021-06-01T11:04:48.000000000', '2021-06-01T11:04:48.000000000', '2021-06-01T11:04:48.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
[360 values with dtype=float32]
[360 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[180000 values with dtype=bool]
<xarray.DatasetView> Dimensions: (time: 360, range: 500) Coordinates: * time (time) datetime64[ns] 2021-06-01T11:05:03 ... 2021-06-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 azimuth (time) float32 ... elevation (time) float32 ... Data variables: reflectivity (time, range) float32 ... velocity (time, range) float32 ... spectrum_width (time, range) float32 ... R (time, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... sweep_mode |S32 ... prt_mode |S32 ... CMAP (time, range) bool ...
array(['2021-06-01T11:05:03.000000000', '2021-06-01T11:05:03.000000000', '2021-06-01T11:05:03.000000000', ..., '2021-06-01T11:05:32.000000000', '2021-06-01T11:05:32.000000000', '2021-06-01T11:05:32.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
[360 values with dtype=float32]
[360 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[180000 values with dtype=bool]
<xarray.DatasetView> Dimensions: (time: 360, range: 500) Coordinates: * time (time) datetime64[ns] 2021-06-01T11:05:47 ... 2021-06-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 azimuth (time) float32 ... elevation (time) float32 ... Data variables: reflectivity (time, range) float32 ... velocity (time, range) float32 ... spectrum_width (time, range) float32 ... R (time, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... sweep_mode |S32 ... prt_mode |S32 ... CMAP (time, range) bool ...
array(['2021-06-01T11:05:47.000000000', '2021-06-01T11:05:47.000000000', '2021-06-01T11:05:47.000000000', ..., '2021-06-01T11:06:16.000000000', '2021-06-01T11:06:16.000000000', '2021-06-01T11:06:16.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
[360 values with dtype=float32]
[360 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[180000 values with dtype=bool]
<xarray.DatasetView> Dimensions: (time: 360, range: 500) Coordinates: * time (time) datetime64[ns] 2021-06-01T11:06:38 ... 2021-06-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 azimuth (time) float32 ... elevation (time) float32 ... Data variables: reflectivity (time, range) float32 ... velocity (time, range) float32 ... spectrum_width (time, range) float32 ... R (time, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... sweep_mode |S32 ... prt_mode |S32 ... CMAP (time, range) bool ...
array(['2021-06-01T11:06:38.000000000', '2021-06-01T11:06:38.000000000', '2021-06-01T11:06:38.000000000', ..., '2021-06-01T11:07:07.000000000', '2021-06-01T11:07:07.000000000', '2021-06-01T11:07:07.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
[360 values with dtype=float32]
[360 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[180000 values with dtype=bool]
<xarray.DatasetView> Dimensions: (time: 360, range: 500) Coordinates: * time (time) datetime64[ns] 2021-06-01T11:07:30 ... 2021-06-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 azimuth (time) float32 ... elevation (time) float32 ... Data variables: reflectivity (time, range) float32 ... velocity (time, range) float32 ... spectrum_width (time, range) float32 ... R (time, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... sweep_mode |S32 ... prt_mode |S32 ... CMAP (time, range) bool ...
array(['2021-06-01T11:07:30.000000000', '2021-06-01T11:07:30.000000000', '2021-06-01T11:07:30.000000000', ..., '2021-06-01T11:07:59.000000000', '2021-06-01T11:07:59.000000000', '2021-06-01T11:07:59.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
[360 values with dtype=float32]
[360 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[180000 values with dtype=bool]
<xarray.DatasetView> Dimensions: (time: 360, range: 500) Coordinates: * time (time) datetime64[ns] 2021-06-01T11:08:26 ... 2021-06-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 azimuth (time) float32 ... elevation (time) float32 ... Data variables: reflectivity (time, range) float32 ... velocity (time, range) float32 ... spectrum_width (time, range) float32 ... R (time, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... sweep_mode |S32 ... prt_mode |S32 ... CMAP (time, range) bool ...
array(['2021-06-01T11:08:26.000000000', '2021-06-01T11:08:26.000000000', '2021-06-01T11:08:26.000000000', ..., '2021-06-01T11:08:55.000000000', '2021-06-01T11:08:55.000000000', '2021-06-01T11:08:55.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
[360 values with dtype=float32]
[360 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[180000 values with dtype=bool]
<xarray.DatasetView> Dimensions: (time: 360, range: 500) Coordinates: * time (time) datetime64[ns] 2021-06-01T11:09:27 ... 2021-06-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 azimuth (time) float32 ... elevation (time) float32 ... Data variables: reflectivity (time, range) float32 ... velocity (time, range) float32 ... spectrum_width (time, range) float32 ... R (time, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... sweep_mode |S32 ... prt_mode |S32 ... CMAP (time, range) bool ...
array(['2021-06-01T11:09:27.000000000', '2021-06-01T11:09:27.000000000', '2021-06-01T11:09:27.000000000', ..., '2021-06-01T11:09:56.000000000', '2021-06-01T11:09:56.000000000', '2021-06-01T11:09:56.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
[360 values with dtype=float32]
[360 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[180000 values with dtype=bool]
[10 values with dtype=object]
[10 values with dtype=float32]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=float64]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[1 values with dtype=int32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
We use xradar
-Accessor here. The sweeps are georeferenced with azimuthal equidistant projection.
nvol = nvol.xradar.georeference()
Uses xarray
provided plotting using matplotlib
.
swpx = nvol["sweep_0"].ds
display(swpx)
<xarray.DatasetView> Dimensions: (time: 360, range: 500) Coordinates: * time (time) datetime64[ns] 2021-06-01T11:02:23 ... 2021-06-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 azimuth (time) float32 50.01 51.03 52.0 ... 47.01 48.02 49.0 elevation (time) float32 0.1978 0.1895 0.1785 ... 0.1099 0.1099 x (time, range) float32 0.0 383.1 ... 1.879e+05 1.882e+05 y (time, range) float32 0.0 321.3 ... 1.633e+05 1.636e+05 z (time, range) float32 0.0 2.0 3.0 ... 4.125e+03 4.141e+03 Data variables: reflectivity (time, range) float32 ... velocity (time, range) float32 ... spectrum_width (time, range) float32 ... R (time, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... sweep_mode |S32 ... prt_mode |S32 ... CMAP (time, range) bool ...
array(['2021-06-01T11:02:23.000000000', '2021-06-01T11:02:24.000000000', '2021-06-01T11:02:24.000000000', ..., '2021-06-01T11:02:53.000000000', '2021-06-01T11:02:53.000000000', '2021-06-01T11:02:53.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
array([50.00702 , 51.025997, 52.001034, ..., 47.010498, 48.02124 , 49.00177 ], dtype=float32)
array([0.197754, 0.189514, 0.178528, ..., 0.109863, 0.109863, 0.109863], dtype=float32)
array([[ 0. , 383.0592 , 766.1183 , ..., 190306.98 , 190689.66 , 191072.31 ], [ 0. , 388.71353, 777.4269 , ..., 193116.9 , 193505.22 , 193893.5 ], [ 0. , 394.00897, 788.01776, ..., 195748.81 , 196142.45 , 196536.03 ], ..., [ 0. , 365.7386 , 731.4771 , ..., 181710.11 , 182075.48 , 182440.86 ], [ 0. , 371.69568, 743.3913 , ..., 184669.77 , 185041.11 , 185412.42 ], [ 0. , 377.3642 , 754.7283 , ..., 187486.06 , 187863.05 , 188240.05 ]], dtype=float32)
array([[ 0. , 321.34488, 642.6897 , ..., 159646.8 , 159967.83 , 160288.81 ], [ 0. , 314.4821 , 628.964 , ..., 156237.95 , 156552.11 , 156866.25 ], [ 0. , 307.8221 , 615.64404, ..., 152930.05 , 153237.58 , 153545.08 ], ..., [ 0. , 340.9315 , 681.8629 , ..., 169385.17 , 169725.78 , 170066.38 ], [ 0. , 334.42688, 668.8537 , ..., 166153.48 , 166487.6 , 166821.69 ], [ 0. , 328.0172 , 656.03436, ..., 162968.97 , 163296.67 , 163624.36 ]], dtype=float32)
array([[0.000e+00, 2.000e+00, 3.000e+00, ..., 4.491e+03, 4.507e+03, 4.524e+03], [0.000e+00, 1.000e+00, 3.000e+00, ..., 4.455e+03, 4.471e+03, 4.488e+03], [0.000e+00, 1.000e+00, 3.000e+00, ..., 4.408e+03, 4.423e+03, 4.440e+03], ..., [0.000e+00, 1.000e+00, 2.000e+00, ..., 4.110e+03, 4.125e+03, 4.141e+03], [0.000e+00, 1.000e+00, 2.000e+00, ..., 4.110e+03, 4.125e+03, 4.141e+03], [0.000e+00, 1.000e+00, 2.000e+00, ..., 4.110e+03, 4.125e+03, 4.141e+03]], dtype=float32)
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[180000 values with dtype=bool]
PandasIndex(DatetimeIndex(['2021-06-01 11:02:23', '2021-06-01 11:02:24', '2021-06-01 11:02:24', '2021-06-01 11:02:24', '2021-06-01 11:02:24', '2021-06-01 11:02:24', '2021-06-01 11:02:24', '2021-06-01 11:02:24', '2021-06-01 11:02:24', '2021-06-01 11:02:24', ... '2021-06-01 11:02:52', '2021-06-01 11:02:52', '2021-06-01 11:02:52', '2021-06-01 11:02:52', '2021-06-01 11:02:53', '2021-06-01 11:02:53', '2021-06-01 11:02:53', '2021-06-01 11:02:53', '2021-06-01 11:02:53', '2021-06-01 11:02:53'], dtype='datetime64[ns]', name='time', length=360, freq=None))
PandasIndex(Float64Index([ 0.0, 500.0, 1000.0, 1500.0, 2000.0, 2500.0, 3000.0, 3500.0, 4000.0, 4500.0, ... 245000.0, 245500.0, 246000.0, 246500.0, 247000.0, 247500.0, 248000.0, 248500.0, 249000.0, 249500.0], dtype='float64', name='range', length=500))
fig = plt.figure(figsize=(15, 12))
ax1 = fig.add_subplot(221)
swpx.reflectivity.plot(x="x", y="y", ax=ax1, vmin=0, vmax=60)
ax1.set_title("Reflectivity raw")
ax2 = fig.add_subplot(222)
swpx.CMAP.plot(x="x", y="y", ax=ax2)
ax2.set_title("Cluttermap")
ax3 = fig.add_subplot(223)
swpx.reflectivity.where(swpx.CMAP == 1).plot(
x="x", y="y", ax=ax3, vmin=0, vmax=60
)
ax3.set_title("Clutter")
ax4 = fig.add_subplot(224)
swpx.reflectivity.where(swpx.CMAP < 1).plot(
x="x", y="y", ax=ax4, vmin=0, vmax=60
)
ax4.set_title("Reflectivity clutter removed")
Text(0.5, 1.0, 'Reflectivity clutter removed')
swpx = nvol["sweep_1"].ds
display(swpx)
<xarray.DatasetView> Dimensions: (time: 360, range: 500) Coordinates: * time (time) datetime64[ns] 2021-06-01T11:02:56 ... 2021-06-... * range (range) float32 0.0 500.0 1e+03 ... 2.49e+05 2.495e+05 azimuth (time) float32 77.01 77.98 78.99 ... 73.98 75.01 76.02 elevation (time) float32 0.6592 0.6592 0.6592 ... 0.6592 0.6592 x (time, range) float32 0.0 487.2 ... 2.415e+05 2.419e+05 y (time, range) float32 0.0 112.4 ... 6.01e+04 6.022e+04 z (time, range) float32 0.0 5.0 ... 6.511e+03 6.531e+03 Data variables: reflectivity (time, range) float32 ... velocity (time, range) float32 ... spectrum_width (time, range) float32 ... R (time, range) float32 ... sweep_number int32 ... sweep_fixed_angle float32 ... sweep_mode |S32 ... prt_mode |S32 ... CMAP (time, range) bool ...
array(['2021-06-01T11:02:56.000000000', '2021-06-01T11:02:56.000000000', '2021-06-01T11:02:56.000000000', ..., '2021-06-01T11:03:25.000000000', '2021-06-01T11:03:25.000000000', '2021-06-01T11:03:25.000000000'], dtype='datetime64[ns]')
array([ 0., 500., 1000., ..., 248500., 249000., 249500.], dtype=float32)
array([77.01141 , 77.9837 , 78.988945, ..., 73.97918 , 75.00915 , 76.02264 ], dtype=float32)
array([0.65918, 0.65918, 0.65918, ..., 0.65918, 0.65918, 0.65918], dtype=float32)
array([[ 0. , 487.17493, 974.3491 , ..., 241975.67 , 242462.12 , 242948.56 ], [ 0. , 489.0116 , 978.0224 , ..., 242887.92 , 243376.2 , 243864.48 ], [ 0. , 490.76242, 981.52405, ..., 243757.55 , 244247.58 , 244737.6 ], ..., [ 0. , 480.54865, 961.09656, ..., 238684.45 , 239164.28 , 239644.11 ], [ 0. , 482.95132, 965.9019 , ..., 239877.84 , 240360.08 , 240842.3 ], [ 0. , 485.16324, 970.3257 , ..., 240976.48 , 241460.92 , 241945.36 ]], dtype=float32)
array([[ 0. , 112.37097, 224.74178, ..., 55813.71 , 55925.914 , 56038.117 ], [ 0. , 104.08798, 208.17581, ..., 51699.62 , 51803.555 , 51907.49 ], [ 0. , 95.49282, 190.9855 , ..., 47430.477 , 47525.83 , 47621.18 ], ..., [ 0. , 137.98413, 275.96805, ..., 68535.55 , 68673.33 , 68811.11 ], [ 0. , 129.32382, 258.64743, ..., 64234.05 , 64363.18 , 64492.312 ], [ 0. , 120.76122, 241.52225, ..., 59981.08 , 60101.656 , 60222.24 ]], dtype=float32)
array([[0.000e+00, 5.000e+00, 1.100e+01, ..., 6.491e+03, 6.511e+03, 6.531e+03], [0.000e+00, 5.000e+00, 1.100e+01, ..., 6.491e+03, 6.511e+03, 6.531e+03], [0.000e+00, 5.000e+00, 1.100e+01, ..., 6.491e+03, 6.511e+03, 6.531e+03], ..., [0.000e+00, 5.000e+00, 1.100e+01, ..., 6.491e+03, 6.511e+03, 6.531e+03], [0.000e+00, 5.000e+00, 1.100e+01, ..., 6.491e+03, 6.511e+03, 6.531e+03], [0.000e+00, 5.000e+00, 1.100e+01, ..., 6.491e+03, 6.511e+03, 6.531e+03]], dtype=float32)
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[180000 values with dtype=float32]
[1 values with dtype=int32]
[1 values with dtype=float32]
[1 values with dtype=|S32]
[1 values with dtype=|S32]
[180000 values with dtype=bool]
PandasIndex(DatetimeIndex(['2021-06-01 11:02:56', '2021-06-01 11:02:56', '2021-06-01 11:02:56', '2021-06-01 11:02:56', '2021-06-01 11:02:56', '2021-06-01 11:02:56', '2021-06-01 11:02:56', '2021-06-01 11:02:56', '2021-06-01 11:02:56', '2021-06-01 11:02:56', ... '2021-06-01 11:03:24', '2021-06-01 11:03:24', '2021-06-01 11:03:25', '2021-06-01 11:03:25', '2021-06-01 11:03:25', '2021-06-01 11:03:25', '2021-06-01 11:03:25', '2021-06-01 11:03:25', '2021-06-01 11:03:25', '2021-06-01 11:03:25'], dtype='datetime64[ns]', name='time', length=360, freq=None))
PandasIndex(Float64Index([ 0.0, 500.0, 1000.0, 1500.0, 2000.0, 2500.0, 3000.0, 3500.0, 4000.0, 4500.0, ... 245000.0, 245500.0, 246000.0, 246500.0, 247000.0, 247500.0, 248000.0, 248500.0, 249000.0, 249500.0], dtype='float64', name='range', length=500))
fig = plt.figure(figsize=(15, 12))
ax1 = fig.add_subplot(221)
swpx.reflectivity.plot(x="x", y="y", ax=ax1, vmin=0, vmax=60)
ax1.set_title("Reflectivity raw")
ax2 = fig.add_subplot(222)
swpx.CMAP.plot(x="x", y="y", ax=ax2)
ax2.set_title("Cluttermap")
ax3 = fig.add_subplot(223)
swpx.reflectivity.where(swpx.CMAP == 1).plot(
x="x", y="y", ax=ax3, vmin=0, vmax=60
)
ax3.set_title("Clutter")
ax4 = fig.add_subplot(224)
swpx.reflectivity.where(swpx.CMAP < 1).plot(
x="x", y="y", ax=ax4, vmin=0, vmax=60
)
ax4.set_title("Reflectivity clutter removed")
Text(0.5, 1.0, 'Reflectivity clutter removed')