Skip to content

Commit

Permalink
FIX: Phase processing code throwing deprecation warnings for scipy.nd…
Browse files Browse the repository at this point in the history
…image.filters.convolve1d (#1313)

* FIX: Return zero phase for sweeps completely filtered out with gatefilter.

* FIX: Remove debug statement

* FIX: Deprecation warning in phase_proc
  • Loading branch information
rcjackson authored Nov 4, 2022
1 parent 83d0cdb commit 661bdb2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyart/correct/phase_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def smooth_and_trim_scan(x, window_len=11, window='hanning'):
The smoothed signal with length equal to the input signal.
"""
from scipy.ndimage.filters import convolve1d
from scipy.ndimage import convolve1d

if x.ndim != 2:
raise ValueError("smooth only accepts 2 dimension arrays.")
Expand Down Expand Up @@ -1151,7 +1151,7 @@ def phase_proc_lp(radar, offset, debug=False, self_const=60000.0,
sobel = sobel/(abs(sobel).sum())
sobel = sobel[::-1]
gate_spacing = (radar.range['data'][1] - radar.range['data'][0]) / 1000.
kdp = (scipy.ndimage.filters.convolve1d(proc_ph['data'], sobel, axis=1) /
kdp = (scipy.ndimage.convolve1d(proc_ph['data'], sobel, axis=1) /
((window_len / 3.0) * 2.0 * gate_spacing))

# copy the KDP metadata from existing field or create anew
Expand Down Expand Up @@ -1349,7 +1349,7 @@ def phase_proc_lp_gf(radar, gatefilter=None, debug=False, self_const=60000.0,
sobel = sobel / (abs(sobel).sum())
sobel = sobel[::-1]
gate_spacing = (radar.range['data'][1] - radar.range['data'][0]) / 1000.
kdp = (scipy.ndimage.filters.convolve1d(proc_ph['data'], sobel, axis=1) /
kdp = (scipy.ndimage.convolve1d(proc_ph['data'], sobel, axis=1) /
((window_len / 3.0) * 2.0 * gate_spacing))

# copy the KDP metadata from existing field or create anew
Expand Down

0 comments on commit 661bdb2

Please sign in to comment.