Skip to content

Commit

Permalink
FIX: optional conversion of h_factor and dist_factor to array (compat…
Browse files Browse the repository at this point in the history
…ibility)
  • Loading branch information
isilber committed Apr 5, 2024
1 parent 5c17055 commit 03f8777
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyart/map/gates_to_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,15 @@ def map_gates_to_grid(
except TypeError:
grid_origin_alt = np.mean(radars[0].altitude["data"])

# convert input h_factor and dist_factor from tuple or list to array
# convert input h_factor and dist_factor from scalar, tuple, or list to array
if isinstance(h_factor, (tuple, list)):
h_factor = np.array(h_factor, dtype="float32")
elif isinstance(h_factor, float):
h_factor = np.full(3, h_factor, dtype="float32")
if isinstance(dist_factor, (tuple, list)):
dist_factor = np.array(dist_factor, dtype="float32")
elif isinstance(dist_factor, float):
dist_factor = np.full(3, dist_factor, dtype="float32")

gatefilters = _parse_gatefilters(gatefilters, radars)
cy_weighting_function = _detemine_cy_weighting_func(weighting_function)
Expand Down

0 comments on commit 03f8777

Please sign in to comment.