Read clutter map
Before we can use the fuzzy_echo_classification we have to prepare a clutter map (cmap). The clutter map is processed by summing up the reflectivities over a period of 3 months for each elevation angle. Here we plot a clutter map, which was generated with the clutter_chain. You can read a clutter map for selected time period and elevation angle with the function get_cmap. We have to import the following packages:
import wrainfo as wrf
[1]:
import wradlib as wrl
import datetime as dt
import warnings
warnings.filterwarnings('ignore')
[2]:
path_to_config_file="/tests/data/test_settings_wrainfo.json"
cmap_static=wrf.reader.get_cmap(starttime=dt.datetime(2022,11,6),
endtime=dt.datetime(2022,1,13),
path=path_to_config_file,
elev="0.5",
timestr='%Y%m%d')
display(cmap_static)
<xarray.Dataset>
Dimensions: (azimuth: 720, range: 936)
Coordinates:
* azimuth (azimuth) float64 0.25 0.75 1.25 1.75 ... 358.8 359.2 359.8
* range (range) float32 37.5 112.5 187.5 ... 7.009e+04 7.016e+04
elevation (azimuth) float64 0.5 0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5
sweep_mode <U20 'azimuth_surveillance'
longitude float64 13.24
latitude float64 53.55
altitude float64 38.0
rtime (azimuth) datetime64[ns] 2022-01-17T07:20:28.980652544 ....
Data variables:
DBZH_sum_bool (azimuth, range) bool ...
DBZH_sum_values (azimuth, range) float32 ...- azimuth: 720
- range: 936
- azimuth(azimuth)float640.25 0.75 1.25 ... 359.2 359.8
array([2.5000e-01, 7.5000e-01, 1.2500e+00, ..., 3.5875e+02, 3.5925e+02, 3.5975e+02]) - range(range)float3237.5 112.5 ... 7.009e+04 7.016e+04
array([3.75000e+01, 1.12500e+02, 1.87500e+02, ..., 7.00125e+04, 7.00875e+04, 7.01625e+04], dtype=float32) - elevation(azimuth)float64...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
array([0.5, 0.5, 0.5, ..., 0.5, 0.5, 0.5])
- sweep_mode()object...
array('azimuth_surveillance', dtype='<U20') - longitude()float64...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
array(13.24397)
- latitude()float64...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
array(53.55478)
- altitude()float64...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
array(38.)
- rtime(azimuth)datetime64[ns]...
- standard_name :
- time
array(['2022-01-17T07:20:28.980652544', '2022-01-17T07:20:01.019417600', '2022-01-17T07:20:01.058252544', ..., '2022-01-17T07:20:28.864147456', '2022-01-17T07:20:28.902982400', '2022-01-17T07:20:28.941817600'], dtype='datetime64[ns]')
- DBZH_sum_bool(azimuth, range)bool...
[673920 values with dtype=bool]
- DBZH_sum_values(azimuth, range)float32...
[673920 values with dtype=float32]
Seealso
Get more information about the clutter_chain in the library reference section or in the process chain module.
The clutter map has two data variables. The first is a boolean data array and the second is a data array of absolute summarised values. We plot the boolean data array of the clutter map.
[3]:
# georeferenced cmap for the plot
cmap_static_georef = cmap_static.pipe(wrl.georef.georeference_dataset)
# plot cmap
cmap_static_georef.DBZH_sum_bool.plot(x="x", y="y")
[3]:
<matplotlib.collections.QuadMesh at 0x1454f82ec8e0>
Fuzzy echo classification
The fuzzy echo classification and clutter identification are based on polarimetric moments and on a processed clutter map. The basic function is from \(\omega radlib\). The function contains a weights of all polarimetric moments and of the clutter map. For the weights the default values are used. If we use the function, then the dataset includes a new variable called “FUZZ”.
Seealso
You can find a detailed description of the function here.
At first, we have to read raw data.
[4]:
file_path="/tests/data/raw/2022/02/16/2006_20220216_134500.h5"
file_hdf5=xr.open_dataset(file_path,
engine="odim",
group="dataset1",
backend_kwargs=dict(reindex_angle=1.0))
display(file_hdf5)
<xarray.Dataset>
Dimensions: (azimuth: 720, range: 936)
Coordinates:
* azimuth (azimuth) float64 0.25 0.75 1.25 1.75 ... 358.8 359.2 359.8
elevation (azimuth) float64 0.5 0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5 0.5
rtime (azimuth) datetime64[ns] 2022-02-16T13:45:28.941817600 ... 20...
* range (range) float32 37.5 112.5 187.5 ... 7.009e+04 7.016e+04
time datetime64[ns] 2022-02-16T13:45:01
sweep_mode <U20 'azimuth_surveillance'
longitude float64 13.24
latitude float64 53.55
altitude float64 38.0
Data variables:
RATE (azimuth, range) float32 ...
DBZH (azimuth, range) float32 ...
VRAD (azimuth, range) float32 ...
ZDR (azimuth, range) float32 ...
KDP (azimuth, range) float32 ...
PHIDP (azimuth, range) float32 ...
RHOHV (azimuth, range) float32 ...
WRAD (azimuth, range) float32 ...
QC_INFO (azimuth, range) float32 ...
Attributes:
fixed_angle: 0.5- azimuth: 720
- range: 936
- azimuth(azimuth)float640.25 0.75 1.25 ... 359.2 359.8
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
- a1gate :
- 1
- angle_res :
- 0.5
array([2.5000e-01, 7.5000e-01, 1.2500e+00, ..., 3.5875e+02, 3.5925e+02, 3.5975e+02]) - elevation(azimuth)float64...
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
array([0.5, 0.5, 0.5, ..., 0.5, 0.5, 0.5])
- rtime(azimuth)datetime64[ns]...
- standard_name :
- time
array(['2022-02-16T13:45:28.941817600', '2022-02-16T13:45:28.980652544', '2022-02-16T13:45:01.019417600', ..., '2022-02-16T13:45:28.825312256', '2022-02-16T13:45:28.864147456', '2022-02-16T13:45:28.902982400'], dtype='datetime64[ns]') - range(range)float3237.5 112.5 ... 7.009e+04 7.016e+04
- 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 :
- 37.5
- meters_between_gates :
- 75.0
array([3.75000e+01, 1.12500e+02, 1.87500e+02, ..., 7.00125e+04, 7.00875e+04, 7.01625e+04], dtype=float32) - time()datetime64[ns]...
- standard_name :
- time
array('2022-02-16T13:45:01.000000000', dtype='datetime64[ns]') - sweep_mode()<U20...
array('azimuth_surveillance', dtype='<U20') - longitude()float64...
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
array(13.24397)
- latitude()float64...
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
array(53.55478)
- altitude()float64...
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
array(38.)
- RATE(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- rainfall_rate
- units :
- mm h-1
- standard_name :
- rainfall_rate
[673920 values with dtype=float32]
- DBZH(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
- standard_name :
- radar_equivalent_reflectivity_factor_h
[673920 values with dtype=float32]
- VRAD(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- Radial velocity of scatterers away from instrument
- units :
- meters per seconds
- standard_name :
- radial_velocity_of_scatterers_away_from_instrument
[673920 values with dtype=float32]
- ZDR(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- Log differential reflectivity H/V
- units :
- dB
- standard_name :
- radar_differential_reflectivity_hv
[673920 values with dtype=float32]
- KDP(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- Specific differential phase HV
- units :
- degrees per kilometer
- standard_name :
- radar_specific_differential_phase_hv
[673920 values with dtype=float32]
- PHIDP(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- Differential phase HV
- units :
- degrees
- standard_name :
- radar_differential_phase_hv
[673920 values with dtype=float32]
- RHOHV(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- Correlation coefficient HV
- units :
- unitless
- standard_name :
- radar_correlation_coefficient_hv
[673920 values with dtype=float32]
- WRAD(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- Doppler spectrum width
- units :
- meters per second
- standard_name :
- radar_doppler_spectrum_width
[673920 values with dtype=float32]
- QC_INFO(azimuth, range)float32...
- _Undetect :
- 0
[673920 values with dtype=float32]
- fixed_angle :
- 0.5
We extracted the boolean data array from the clutter map.
[5]:
cmap_static_bool = cmap_static.DBZH_sum_bool
Now we can use the function fuzzy_echo_classification.
[6]:
ds_fuzz=wrf.clutter.fuzzy_echo_classification(ds=file_hdf5,
cmap=cmap_static_bool,
dims=["azimuth", "range"])
display(ds_fuzz)
<xarray.Dataset>
Dimensions: (azimuth: 720, range: 936)
Coordinates:
* azimuth (azimuth) float64 0.25 0.75 1.25 1.75 ... 358.8 359.2 359.8
elevation (azimuth) float64 0.5 0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5 0.5
rtime (azimuth) datetime64[ns] 2022-02-16T13:45:28.941817600 ... 20...
* range (range) float32 37.5 112.5 187.5 ... 7.009e+04 7.016e+04
time datetime64[ns] 2022-02-16T13:45:01
sweep_mode <U20 'azimuth_surveillance'
longitude float64 13.24
latitude float64 53.55
altitude float64 38.0
Data variables:
RATE (azimuth, range) float32 ...
DBZH (azimuth, range) float32 nan nan nan 23.0 ... -32.0 -32.0 -32.0
VRAD (azimuth, range) float32 nan nan nan 0.0 ... -35.0 nan nan nan
ZDR (azimuth, range) float32 nan nan nan ... 0.587 0.4894 -0.2914
KDP (azimuth, range) float32 ...
PHIDP (azimuth, range) float32 nan nan nan 9.844 ... 18.28 40.78 9.844
RHOHV (azimuth, range) float32 nan nan nan ... 0.1494 0.2291 0.4382
WRAD (azimuth, range) float32 ...
QC_INFO (azimuth, range) float32 ...
FUZZ (azimuth, range) bool False False False ... False False False
Attributes:
fixed_angle: 0.5- azimuth: 720
- range: 936
- azimuth(azimuth)float640.25 0.75 1.25 ... 359.2 359.8
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
- a1gate :
- 1
- angle_res :
- 0.5
array([2.5000e-01, 7.5000e-01, 1.2500e+00, ..., 3.5875e+02, 3.5925e+02, 3.5975e+02]) - elevation(azimuth)float640.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
array([0.5, 0.5, 0.5, ..., 0.5, 0.5, 0.5])
- rtime(azimuth)datetime64[ns]2022-02-16T13:45:28.941817600 .....
- standard_name :
- time
array(['2022-02-16T13:45:28.941817600', '2022-02-16T13:45:28.980652544', '2022-02-16T13:45:01.019417600', ..., '2022-02-16T13:45:28.825312256', '2022-02-16T13:45:28.864147456', '2022-02-16T13:45:28.902982400'], dtype='datetime64[ns]') - range(range)float3237.5 112.5 ... 7.009e+04 7.016e+04
- 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 :
- 37.5
- meters_between_gates :
- 75.0
array([3.75000e+01, 1.12500e+02, 1.87500e+02, ..., 7.00125e+04, 7.00875e+04, 7.01625e+04], dtype=float32) - time()datetime64[ns]2022-02-16T13:45:01
- standard_name :
- time
array('2022-02-16T13:45:01.000000000', dtype='datetime64[ns]') - sweep_mode()<U20'azimuth_surveillance'
array('azimuth_surveillance', dtype='<U20') - longitude()float6413.24
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
array(13.24397)
- latitude()float6453.55
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
array(53.55478)
- altitude()float6438.0
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
array(38.)
- RATE(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- rainfall_rate
- units :
- mm h-1
- standard_name :
- rainfall_rate
[673920 values with dtype=float32]
- DBZH(azimuth, range)float32nan nan nan ... -32.0 -32.0 -32.0
- _Undetect :
- 0
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
- standard_name :
- radar_equivalent_reflectivity_factor_h
array([[ nan, nan, nan, ..., -32. , 20. , -32. ], [ nan, nan, nan, ..., 21. , 21.5, 20.5], [ nan, nan, nan, ..., 23. , 22.5, 21.5], ..., [ nan, nan, nan, ..., -32. , -32. , -32. ], [ nan, nan, nan, ..., -32. , -32. , -32. ], [ nan, nan, nan, ..., -32. , -32. , -32. ]], dtype=float32) - VRAD(azimuth, range)float32nan nan nan 0.0 ... nan nan nan
- _Undetect :
- 0
- long_name :
- Radial velocity of scatterers away from instrument
- units :
- meters per seconds
- standard_name :
- radial_velocity_of_scatterers_away_from_instrument
array([[ nan, nan, nan, ..., nan, nan, 15. ], [ nan, nan, nan, ..., -0.5, -0.5, -0.5], [ nan, nan, nan, ..., -0.5, 0. , 0. ], ..., [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]], dtype=float32) - ZDR(azimuth, range)float32nan nan nan ... 0.4894 -0.2914
- _Undetect :
- 0
- long_name :
- Log differential reflectivity H/V
- units :
- dB
- standard_name :
- radar_differential_reflectivity_hv
array([[ nan, nan, nan, ..., 0.0665 , 0.196628, -0.031096], [ nan, nan, nan, ..., -0.291352, -0.226288, -0.454012], [ nan, nan, nan, ..., -0.09616 , -0.486544, -0.649204], ..., [ nan, nan, nan, ..., 0.424352, 0.619544, 0.196628], [ nan, nan, nan, ..., 0.131564, 0.489416, -0.063628], [ nan, nan, nan, ..., 0.587012, 0.489416, -0.291352]], dtype=float32) - KDP(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- Specific differential phase HV
- units :
- degrees per kilometer
- standard_name :
- radar_specific_differential_phase_hv
[673920 values with dtype=float32]
- PHIDP(azimuth, range)float32nan nan nan ... 18.28 40.78 9.844
- _Undetect :
- 0
- long_name :
- Differential phase HV
- units :
- degrees
- standard_name :
- radar_differential_phase_hv
array([[ nan, nan, nan, ..., 46.40625, 36.5625 , 32.34375], [ nan, nan, nan, ..., 46.40625, 50.625 , 53.4375 ], [ nan, nan, nan, ..., 43.59375, 45. , 50.625 ], ..., [ nan, nan, nan, ..., 91.40625, 68.90625, -57.65625], [ nan, nan, nan, ..., 28.125 , 28.125 , -14.0625 ], [ nan, nan, nan, ..., 18.28125, 40.78125, 9.84375]], dtype=float32) - RHOHV(azimuth, range)float32nan nan nan ... 0.2291 0.4382
- _Undetect :
- 0
- long_name :
- Correlation coefficient HV
- units :
- unitless
- standard_name :
- radar_correlation_coefficient_hv
array([[ nan, nan, nan, ..., 0.41334, 0.49302, 0.61752], [ nan, nan, nan, ..., 0.93624, 0.88146, 0.8715 ], [ nan, nan, nan, ..., 1.00596, 0.996 , 0.9213 ], ..., [ nan, nan, nan, ..., 0.13446, 0.05478, 0.06972], [ nan, nan, nan, ..., 0.31374, 0.21414, 0.29382], [ nan, nan, nan, ..., 0.1494 , 0.22908, 0.43824]], dtype=float32) - WRAD(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- Doppler spectrum width
- units :
- meters per second
- standard_name :
- radar_doppler_spectrum_width
[673920 values with dtype=float32]
- QC_INFO(azimuth, range)float32...
- _Undetect :
- 0
[673920 values with dtype=float32]
- FUZZ(azimuth, range)boolFalse False False ... False False
array([[False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], ..., [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False]])
- fixed_angle :
- 0.5
Note
The function works also for a xarray dataset which is linking over the time and for SCN/SCNX files. Before you can use the function with SCN/SCNX files, you have to rename a variable.
Now we plot the static clutter map on the left and the “FUZZ” clutter map on the right.
[7]:
import matplotlib.pyplot as plt
# georefenced dataset for plot
ds_fuzz_georef=ds_fuzz.pipe(wrl.georef.georeference_dataset)
# plot
fig = plt.figure(figsize=(14, 5))
# first subplot
ax1 = fig.add_subplot(121)
cmap_static_georef.DBZH_sum_bool.plot(x="x", y="y", ax=ax1)
t = plt.title(r'Static clutter map')
t.set_y(1.1)
# second subplot
ax2 = fig.add_subplot(122)
ds_fuzz_georef.FUZZ.plot(x="x", y="y", ax=ax2)
t = plt.title(r'FUZZY clutter map')
t.set_y(1.1)
Remove clutter
Now we want to remove the clutter in the raw reflectivity. Therefore, we use the function dbzh_no_clutter. This function set as clutter identified pixels (in the above plot the yellow points) to NaN values. So we exclude clutter pixels from further processing steps. If we use the function, then the dataset includes a new variable called “DBZH_no_clutter”.
[8]:
ds_no_clutter=wrf.clutter.dbzh_no_clutter(ds=ds_fuzz,
dims=['azimuth', 'range'])
display(ds_no_clutter)
<xarray.Dataset>
Dimensions: (azimuth: 720, range: 936)
Coordinates: (12/15)
* azimuth (azimuth) float64 0.25 0.75 1.25 1.75 ... 358.8 359.2 359.8
elevation (azimuth) float64 0.5 0.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5
rtime (azimuth) datetime64[ns] 2022-02-16T13:45:28.941817600 ....
* range (range) float32 37.5 112.5 187.5 ... 7.009e+04 7.016e+04
time datetime64[ns] 2022-02-16T13:45:01
sweep_mode <U20 'azimuth_surveillance'
... ...
x (azimuth, range) float64 0.1636 0.4909 ... -305.8 -306.1
y (azimuth, range) float64 37.5 112.5 ... 7.008e+04 7.015e+04
z (azimuth, range) float64 38.3 38.95 39.61 ... 939.2 940.3
gr (azimuth, range) float64 37.5 112.5 ... 7.008e+04 7.015e+04
rays (azimuth, range) float64 0.25 0.25 0.25 ... 359.8 359.8
bins (azimuth, range) float32 37.5 112.5 ... 7.009e+04 7.016e+04
Data variables:
RATE (azimuth, range) float32 ...
DBZH (azimuth, range) float32 nan nan nan ... -32.0 -32.0 -32.0
VRAD (azimuth, range) float32 nan nan nan 0.0 ... nan nan nan
ZDR (azimuth, range) float32 nan nan nan ... 0.4894 -0.2914
KDP (azimuth, range) float32 ...
PHIDP (azimuth, range) float32 nan nan nan ... 18.28 40.78 9.844
RHOHV (azimuth, range) float32 nan nan nan ... 0.2291 0.4382
WRAD (azimuth, range) float32 ...
QC_INFO (azimuth, range) float32 ...
FUZZ (azimuth, range) bool False False False ... False False
DBZH_no_clutter (azimuth, range) float32 nan nan nan ... -32.0 -32.0 -32.0
Attributes:
fixed_angle: 0.5- azimuth: 720
- range: 936
- azimuth(azimuth)float640.25 0.75 1.25 ... 359.2 359.8
- standard_name :
- ray_azimuth_angle
- long_name :
- azimuth_angle_from_true_north
- units :
- degrees
- axis :
- radial_azimuth_coordinate
- a1gate :
- 1
- angle_res :
- 0.5
array([2.5000e-01, 7.5000e-01, 1.2500e+00, ..., 3.5875e+02, 3.5925e+02, 3.5975e+02]) - elevation(azimuth)float640.5 0.5 0.5 0.5 ... 0.5 0.5 0.5 0.5
- standard_name :
- ray_elevation_angle
- long_name :
- elevation_angle_from_horizontal_plane
- units :
- degrees
- axis :
- radial_elevation_coordinate
array([0.5, 0.5, 0.5, ..., 0.5, 0.5, 0.5])
- rtime(azimuth)datetime64[ns]2022-02-16T13:45:28.941817600 .....
- standard_name :
- time
array(['2022-02-16T13:45:28.941817600', '2022-02-16T13:45:28.980652544', '2022-02-16T13:45:01.019417600', ..., '2022-02-16T13:45:28.825312256', '2022-02-16T13:45:28.864147456', '2022-02-16T13:45:28.902982400'], dtype='datetime64[ns]') - range(range)float3237.5 112.5 ... 7.009e+04 7.016e+04
- 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 :
- 37.5
- meters_between_gates :
- 75.0
array([3.75000e+01, 1.12500e+02, 1.87500e+02, ..., 7.00125e+04, 7.00875e+04, 7.01625e+04], dtype=float32) - time()datetime64[ns]2022-02-16T13:45:01
- standard_name :
- time
array('2022-02-16T13:45:01.000000000', dtype='datetime64[ns]') - sweep_mode()<U20'azimuth_surveillance'
array('azimuth_surveillance', dtype='<U20') - longitude()float6413.24
- long_name :
- longitude
- units :
- degrees_east
- standard_name :
- longitude
array(13.24397)
- latitude()float6453.55
- long_name :
- latitude
- units :
- degrees_north
- positive :
- up
- standard_name :
- latitude
array(53.55478)
- altitude()float6438.0
- long_name :
- altitude
- units :
- meters
- standard_name :
- altitude
array(38.)
- x(azimuth, range)float640.1636 0.4909 ... -305.8 -306.1
array([[ 1.63617129e-01, 4.90851351e-01, 8.18085521e-01, ..., 3.05444277e+02, 3.05771429e+02, 3.06098598e+02], [ 4.90838928e-01, 1.47251667e+00, 2.45419426e+00, ..., 9.16309571e+02, 9.17291001e+02, 9.18272484e+02], [ 8.18023348e-01, 2.45406985e+00, 4.09011611e+00, ..., 1.52710508e+03, 1.52874072e+03, 1.53037644e+03], ..., [-8.18023348e-01, -2.45406985e+00, -4.09011611e+00, ..., -1.52710508e+03, -1.52874072e+03, -1.53037644e+03], [-4.90838928e-01, -1.47251667e+00, -2.45419426e+00, ..., -9.16309571e+02, -9.17291001e+02, -9.18272484e+02], [-1.63617129e-01, -4.90851351e-01, -8.18085521e-01, ..., -3.05444277e+02, -3.05771429e+02, -3.06098598e+02]]) - y(azimuth, range)float6437.5 112.5 ... 7.008e+04 7.015e+04
array([[3.74980459e+01, 1.12494129e+02, 1.87490201e+02, ..., 7.00022276e+04, 7.00772048e+04, 7.01521860e+04], [3.74951903e+01, 1.12485562e+02, 1.87475923e+02, ..., 6.99968967e+04, 7.00718681e+04, 7.01468436e+04], [3.74894793e+01, 1.12468429e+02, 1.87447367e+02, ..., 6.99862352e+04, 7.00611952e+04, 7.01361593e+04], ..., [3.74894793e+01, 1.12468429e+02, 1.87447367e+02, ..., 6.99862352e+04, 7.00611952e+04, 7.01361593e+04], [3.74951903e+01, 1.12485562e+02, 1.87475923e+02, ..., 6.99968967e+04, 7.00718681e+04, 7.01468436e+04], [3.74980459e+01, 1.12494129e+02, 1.87490201e+02, ..., 7.00022276e+04, 7.00772048e+04, 7.01521860e+04]]) - z(azimuth, range)float6438.3 38.95 39.61 ... 939.2 940.3
array([[ 38.29707351, 38.95156364, 39.60605378, ..., 937.54351336, 939.18635562, 940.33497831], [ 38.29707351, 38.95156364, 39.60605378, ..., 937.54351336, 939.18635562, 940.33497831], [ 38.29707351, 38.95156364, 39.60605378, ..., 937.54351336, 939.18635562, 940.33497831], ..., [ 38.29707351, 38.95156364, 39.60605378, ..., 937.54351336, 939.18635562, 940.33497831], [ 38.29707351, 38.95156364, 39.60605378, ..., 937.54351336, 939.18635562, 940.33497831], [ 38.29707351, 38.95156364, 39.60605378, ..., 937.54351336, 939.18635562, 940.33497831]]) - gr(azimuth, range)float6437.5 112.5 ... 7.008e+04 7.015e+04
array([[3.74984029e+01, 1.12495200e+02, 1.87491986e+02, ..., 7.00028940e+04, 7.00778719e+04, 7.01528538e+04], [3.74984029e+01, 1.12495200e+02, 1.87491986e+02, ..., 7.00028940e+04, 7.00778719e+04, 7.01528538e+04], [3.74984029e+01, 1.12495200e+02, 1.87491986e+02, ..., 7.00028940e+04, 7.00778719e+04, 7.01528538e+04], ..., [3.74984029e+01, 1.12495200e+02, 1.87491986e+02, ..., 7.00028940e+04, 7.00778719e+04, 7.01528538e+04], [3.74984029e+01, 1.12495200e+02, 1.87491986e+02, ..., 7.00028940e+04, 7.00778719e+04, 7.01528538e+04], [3.74984029e+01, 1.12495200e+02, 1.87491986e+02, ..., 7.00028940e+04, 7.00778719e+04, 7.01528538e+04]]) - rays(azimuth, range)float640.25 0.25 0.25 ... 359.8 359.8
array([[2.5000e-01, 2.5000e-01, 2.5000e-01, ..., 2.5000e-01, 2.5000e-01, 2.5000e-01], [7.5000e-01, 7.5000e-01, 7.5000e-01, ..., 7.5000e-01, 7.5000e-01, 7.5000e-01], [1.2500e+00, 1.2500e+00, 1.2500e+00, ..., 1.2500e+00, 1.2500e+00, 1.2500e+00], ..., [3.5875e+02, 3.5875e+02, 3.5875e+02, ..., 3.5875e+02, 3.5875e+02, 3.5875e+02], [3.5925e+02, 3.5925e+02, 3.5925e+02, ..., 3.5925e+02, 3.5925e+02, 3.5925e+02], [3.5975e+02, 3.5975e+02, 3.5975e+02, ..., 3.5975e+02, 3.5975e+02, 3.5975e+02]]) - bins(azimuth, range)float3237.5 112.5 ... 7.009e+04 7.016e+04
array([[3.75000e+01, 1.12500e+02, 1.87500e+02, ..., 7.00125e+04, 7.00875e+04, 7.01625e+04], [3.75000e+01, 1.12500e+02, 1.87500e+02, ..., 7.00125e+04, 7.00875e+04, 7.01625e+04], [3.75000e+01, 1.12500e+02, 1.87500e+02, ..., 7.00125e+04, 7.00875e+04, 7.01625e+04], ..., [3.75000e+01, 1.12500e+02, 1.87500e+02, ..., 7.00125e+04, 7.00875e+04, 7.01625e+04], [3.75000e+01, 1.12500e+02, 1.87500e+02, ..., 7.00125e+04, 7.00875e+04, 7.01625e+04], [3.75000e+01, 1.12500e+02, 1.87500e+02, ..., 7.00125e+04, 7.00875e+04, 7.01625e+04]], dtype=float32)
- RATE(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- rainfall_rate
- units :
- mm h-1
- standard_name :
- rainfall_rate
[673920 values with dtype=float32]
- DBZH(azimuth, range)float32nan nan nan ... -32.0 -32.0 -32.0
- _Undetect :
- 0
- long_name :
- Equivalent reflectivity factor H
- units :
- dBZ
- standard_name :
- radar_equivalent_reflectivity_factor_h
array([[ nan, nan, nan, ..., -32. , 20. , -32. ], [ nan, nan, nan, ..., 21. , 21.5, 20.5], [ nan, nan, nan, ..., 23. , 22.5, 21.5], ..., [ nan, nan, nan, ..., -32. , -32. , -32. ], [ nan, nan, nan, ..., -32. , -32. , -32. ], [ nan, nan, nan, ..., -32. , -32. , -32. ]], dtype=float32) - VRAD(azimuth, range)float32nan nan nan 0.0 ... nan nan nan
- _Undetect :
- 0
- long_name :
- Radial velocity of scatterers away from instrument
- units :
- meters per seconds
- standard_name :
- radial_velocity_of_scatterers_away_from_instrument
array([[ nan, nan, nan, ..., nan, nan, 15. ], [ nan, nan, nan, ..., -0.5, -0.5, -0.5], [ nan, nan, nan, ..., -0.5, 0. , 0. ], ..., [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan], [ nan, nan, nan, ..., nan, nan, nan]], dtype=float32) - ZDR(azimuth, range)float32nan nan nan ... 0.4894 -0.2914
- _Undetect :
- 0
- long_name :
- Log differential reflectivity H/V
- units :
- dB
- standard_name :
- radar_differential_reflectivity_hv
array([[ nan, nan, nan, ..., 0.0665 , 0.196628, -0.031096], [ nan, nan, nan, ..., -0.291352, -0.226288, -0.454012], [ nan, nan, nan, ..., -0.09616 , -0.486544, -0.649204], ..., [ nan, nan, nan, ..., 0.424352, 0.619544, 0.196628], [ nan, nan, nan, ..., 0.131564, 0.489416, -0.063628], [ nan, nan, nan, ..., 0.587012, 0.489416, -0.291352]], dtype=float32) - KDP(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- Specific differential phase HV
- units :
- degrees per kilometer
- standard_name :
- radar_specific_differential_phase_hv
[673920 values with dtype=float32]
- PHIDP(azimuth, range)float32nan nan nan ... 18.28 40.78 9.844
- _Undetect :
- 0
- long_name :
- Differential phase HV
- units :
- degrees
- standard_name :
- radar_differential_phase_hv
array([[ nan, nan, nan, ..., 46.40625, 36.5625 , 32.34375], [ nan, nan, nan, ..., 46.40625, 50.625 , 53.4375 ], [ nan, nan, nan, ..., 43.59375, 45. , 50.625 ], ..., [ nan, nan, nan, ..., 91.40625, 68.90625, -57.65625], [ nan, nan, nan, ..., 28.125 , 28.125 , -14.0625 ], [ nan, nan, nan, ..., 18.28125, 40.78125, 9.84375]], dtype=float32) - RHOHV(azimuth, range)float32nan nan nan ... 0.2291 0.4382
- _Undetect :
- 0
- long_name :
- Correlation coefficient HV
- units :
- unitless
- standard_name :
- radar_correlation_coefficient_hv
array([[ nan, nan, nan, ..., 0.41334, 0.49302, 0.61752], [ nan, nan, nan, ..., 0.93624, 0.88146, 0.8715 ], [ nan, nan, nan, ..., 1.00596, 0.996 , 0.9213 ], ..., [ nan, nan, nan, ..., 0.13446, 0.05478, 0.06972], [ nan, nan, nan, ..., 0.31374, 0.21414, 0.29382], [ nan, nan, nan, ..., 0.1494 , 0.22908, 0.43824]], dtype=float32) - WRAD(azimuth, range)float32...
- _Undetect :
- 0
- long_name :
- Doppler spectrum width
- units :
- meters per second
- standard_name :
- radar_doppler_spectrum_width
[673920 values with dtype=float32]
- QC_INFO(azimuth, range)float32...
- _Undetect :
- 0
[673920 values with dtype=float32]
- FUZZ(azimuth, range)boolFalse False False ... False False
array([[False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], ..., [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False], [False, False, False, ..., False, False, False]]) - DBZH_no_clutter(azimuth, range)float32nan nan nan ... -32.0 -32.0 -32.0
- standard_name :
- radar_equivalent_reflectivity_factor_h
- long_name :
- Equivalent reflectivity factor H
- unit :
- dBZ
array([[ nan, nan, nan, ..., -32. , 20. , -32. ], [ nan, nan, nan, ..., 21. , 21.5, 20.5], [ nan, nan, nan, ..., 23. , 22.5, 21.5], ..., [ nan, nan, nan, ..., -32. , -32. , -32. ], [ nan, nan, nan, ..., -32. , -32. , -32. ], [ nan, nan, nan, ..., -32. , -32. , -32. ]], dtype=float32)
- fixed_angle :
- 0.5
Note
The function works also for a xarray dataset which is linking over the time and for SCN/SCNX files.
Here we plot the reflecivity before and after clutter correction.
[9]:
import matplotlib.pyplot as plt
# georefenced dataset for plot
ds_no_clutter_georef=ds_no_clutter.pipe(wrl.georef.georeference_dataset)
# plot
fig = plt.figure(figsize=(14, 5))
# first subplot
ax1 = fig.add_subplot(121)
ds_no_clutter_georef.DBZH.plot(x="x", y="y", ax=ax1)
t = plt.title(r'Raw reflectivity')
t.set_y(1.1)
# second subplot
ax2 = fig.add_subplot(122)
ds_no_clutter_georef.DBZH_no_clutter.plot(x="x", y="y", ax=ax2)
t = plt.title(r'Clutter corrected reflectivity')
t.set_y(1.1)
The result shows that we still have noise in the reflectivity. We can remove the noise with the variable RHOHV, which is a good indicator of noise. Is RHOHV < 0.9 then it is no rain but noise.
[10]:
ds_no_clutter=ds_no_clutter.where(ds_no_clutter.RHOHV>0.9)
[11]:
import matplotlib.pyplot as plt
# georefenced dataset for plot
ds_no_clutter_georef=ds_no_clutter.pipe(wrl.georef.georeference_dataset)
ds_no_clutter_georef.DBZH.plot(x="x", y="y")
t = plt.title(r'Clutter and RHOHV corrected reflectivity')
t.set_y(1.1)
Library Reference
Seealso
Get more information about the clutter module in the library reference section.