Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Phase processing code throwing deprecation warnings for scipy.ndimage.filters.convolve1d #1313

Merged
merged 3 commits into from
Nov 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 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 @@ -1300,6 +1300,12 @@ def phase_proc_lp_gf(radar, gatefilter=None, debug=False, self_const=60000.0,

start_gate = 0

if len(radar.range['data'][start_gate:end_gate]) <= 5:
mysoln = np.zeros_like(
proc_ph['data'][start_ray:end_ray, start_gate:end_gate])
proc_ph['data'][start_ray:end_ray, start_gate:end_gate] = mysoln
continue

A_Matrix = construct_A_matrix(
len(radar.range['data'][start_gate:end_gate]),
St_Gorlv_differential_5pts)
Expand Down Expand Up @@ -1343,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