Skip to content

Commit

Permalink
FIX: modified pyart examples to handle new hydroclass_semisupervised …
Browse files Browse the repository at this point in the history
…output
  • Loading branch information
wolfidan committed Aug 28, 2024
1 parent a4f4fb0 commit 3ff109b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/retrieve/plot_hydrometeor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
kdp_field="specific_differential_phase",
rhv_field="uncorrected_cross_correlation_ratio",
temp_field="temperature",
)
)["hydro"]

radar.add_field("radar_echo_classification", hydro)

Expand Down
2 changes: 1 addition & 1 deletion examples/retrieve/plot_hydrometeor_class_x_band.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
rhv_field="RHOHV",
temp_field="sounding_temperature",
radar_freq=9.2e9,
)
)["hydro"]

radar.add_field("hydro_classification", hydromet_class, replace_existing=True)

Expand Down
6 changes: 5 additions & 1 deletion pyart/correct/phase_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ def fzl_index(fzl, ranges, elevation, radar_height):
p_r = 4.0 * Re / 3.0
z = (
radar_height
+ (ranges**2 + p_r**2 + 2.0 * ranges * p_r * np.sin(elevation * np.pi / 180.0))
+ (
ranges**2
+ p_r**2
+ 2.0 * ranges * p_r * np.sin(elevation * np.pi / 180.0)
)
** 0.5
- p_r
)
Expand Down
4 changes: 1 addition & 3 deletions pyart/retrieve/qvp.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
_update_qvp_metadata
_update_along_coord_metadata
"""
""" "" "" "" "" "" "" "" "" "" "" "" "" "" ""

from copy import deepcopy
from warnings import warn
Expand Down Expand Up @@ -106,7 +106,6 @@ def quasi_vertical_profile(radar, desired_angle=None, fields=None, gatefilter=No
fields = radar.fields

for field in fields:

# Filtering data based on defined gatefilter
# If none is defined goes to else statement
if gatefilter is not None:
Expand Down Expand Up @@ -431,7 +430,6 @@ def compute_rqvp(
)

for field_name in field_names:

# mask weights where there is no data
mask = np.ma.getmaskarray(val_interp[field_name])
weight_aux = np.ma.masked_where(mask, weight)
Expand Down
18 changes: 9 additions & 9 deletions pyart/util/radar_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,17 +414,17 @@ def subset_radar(

if radar_aux.instrument_parameters is not None:
if "nyquist_velocity" in radar_aux.instrument_parameters:
radar_aux.instrument_parameters["nyquist_velocity"]["data"] = (
radar_aux.instrument_parameters["nyquist_velocity"]["data"][ind_rays]
)
radar_aux.instrument_parameters["nyquist_velocity"][
"data"
] = radar_aux.instrument_parameters["nyquist_velocity"]["data"][ind_rays]
if "pulse_width" in radar_aux.instrument_parameters:
radar_aux.instrument_parameters["pulse_width"]["data"] = (
radar_aux.instrument_parameters["pulse_width"]["data"][ind_rays]
)
radar_aux.instrument_parameters["pulse_width"][
"data"
] = radar_aux.instrument_parameters["pulse_width"]["data"][ind_rays]
if "number_of_pulses" in radar_aux.instrument_parameters:
radar_aux.instrument_parameters["number_of_pulses"]["data"] = (
radar_aux.instrument_parameters["number_of_pulses"]["data"][ind_rays]
)
radar_aux.instrument_parameters["number_of_pulses"][
"data"
] = radar_aux.instrument_parameters["number_of_pulses"]["data"][ind_rays]

# Get new fields
if field_names is None:
Expand Down

0 comments on commit 3ff109b

Please sign in to comment.