|
6 | 6 | The technique here uses a vertically pointing scan in regions of light rain. |
7 | 7 | In these regions, raindrops should be approximately spherical and therefore their |
8 | 8 | ZDR near zero. Therefore, we want the average ZDR in these regions. |
9 | | -This code applies reflectivity and cross correlation ratio-based thresholds to the ZDR |
| 9 | +This code applies reflectivity and cross correlation ratio-based threshold to the ZDR |
10 | 10 | bias calculation to ensure that we are taking the average ZDR in light rain. |
11 | 11 |
|
12 | 12 | """ |
13 | 13 |
|
14 | 14 | import matplotlib.pyplot as plt |
| 15 | +import xradar as xd |
15 | 16 | from open_radar_data import DATASETS |
16 | 17 |
|
17 | 18 | import pyart |
18 | 19 |
|
19 | 20 | # Read in example data |
20 | 21 | filename = DATASETS.fetch("sgpxsaprcfrvptI4.a1.20200205.100827.nc") |
21 | | -ds = pyart.io.read(filename) |
| 22 | + |
| 23 | +# Read in the data |
| 24 | +tree = xd.io.open_cfradial1_datatree(filename) |
| 25 | +radar = tree.pyart.to_radar() |
22 | 26 |
|
23 | 27 | # Set up a typical filter for ZDR bias calculation in birdbath scan |
24 | 28 | # Light rain and RhoHV near 1 ensures that raindrops are close to spherical |
25 | 29 | # Therefore ZDR should be zero in these regions |
26 | | -gatefilter = pyart.filters.GateFilter(ds) |
| 30 | +gatefilter = pyart.filters.GateFilter(radar) |
27 | 31 | gatefilter.exclude_below("cross_correlation_ratio_hv", 0.995) |
28 | 32 | gatefilter.exclude_above("cross_correlation_ratio_hv", 1) |
29 | 33 | gatefilter.exclude_below("reflectivity", 10) |
30 | 34 | gatefilter.exclude_above("reflectivity", 30) |
31 | 35 |
|
32 | 36 | results = pyart.correct.calc_zdr_offset( |
33 | | - ds, |
| 37 | + radar, |
34 | 38 | zdr_var="differential_reflectivity", |
35 | 39 | gatefilter=gatefilter, |
36 | 40 | height_range=(1000, 3000), |
|
0 commit comments