From 429a0a30aca5034e8f8d5759295291a8d2695dc7 Mon Sep 17 00:00:00 2001 From: Wolfidan Date: Fri, 1 May 2020 15:52:55 +0200 Subject: [PATCH] Fix in filter_psidp in case of scalar mask --- pyart/retrieve/kdp_proc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyart/retrieve/kdp_proc.py b/pyart/retrieve/kdp_proc.py index 3ca17cbe5e..43b87609a9 100755 --- a/pyart/retrieve/kdp_proc.py +++ b/pyart/retrieve/kdp_proc.py @@ -1033,6 +1033,8 @@ def filter_psidp(radar, psidp_field=None, rhohv_field=None, minsize_seq=5, psidp_o = radar.fields[psidp_field]['data'] rhohv = radar.fields[rhohv_field]['data'] + if np.isscalar(psidp_o.mask): # Ensure 2D mask + psidp_o.mask = np.zeros((psidp_o.shape)) + psidp_o.mask if not isinstance(psidp_o, np.ma.masked_array): psidp_o = np.ma.array(psidp_o, mask=np.isnan(psidp_o))