66from pylops .signalprocessing import Convolve2D
77
88
9- def Smoothing2D (nsmooth , dims , axes = (- 2 , - 1 ), nodir = None , dtype = "float64" ):
9+ def Smoothing2D (nsmooth , dims , axes = (- 2 , - 1 ), dtype = "float64" ):
1010 r"""2D Smoothing.
1111
1212 Apply smoothing to model (and data) along two ``axes`` of a
@@ -22,13 +22,6 @@ def Smoothing2D(nsmooth, dims, axes=(-2, -1), nodir=None, dtype="float64"):
2222 .. versionadded:: 2.0.0
2323
2424 Axes along which model (and data) are smoothed.
25- nodir : :obj:`int`, optional
26- Direction along which smoothing is **not** applied (set to ``None`` for 2d
27- arrays)
28-
29- .. deprecated:: 2.0.0
30- Use ``axes`` instead. Note that ``axes`` applies along axes instead.
31-
3225 dtype : :obj:`str`, optional
3326 Type of elements in input array.
3427
@@ -67,26 +60,6 @@ def Smoothing2D(nsmooth, dims, axes=(-2, -1), nodir=None, dtype="float64"):
6760 nsmooth [0 ] += 1
6861 if nsmooth [1 ] % 2 == 0 :
6962 nsmooth [1 ] += 1
70- if nodir is not None :
71- warnings .warn (
72- "nodir will be deprecated in version 2.0.0, use axes instead." ,
73- category = DeprecationWarning ,
74- stacklevel = 2 ,
75- )
76- if nodir == 0 :
77- axes = (1 , 2 )
78- elif nodir == 1 :
79- axes = (0 , 2 )
80- else :
81- axes = (0 , 1 )
82- else :
83- axes = tuple (normalize_axis_index (ax , len (dims )) for ax in axes )
84-
8563 h = np .ones ((nsmooth [0 ], nsmooth [1 ])) / float (nsmooth [0 ] * nsmooth [1 ])
86- return Convolve2D (
87- dims ,
88- h = h ,
89- offset = [(nsmooth [0 ] - 1 ) / 2 , (nsmooth [1 ] - 1 ) / 2 ],
90- axes = axes ,
91- dtype = dtype ,
92- )
64+ offset = [(nsmooth [0 ] - 1 ) / 2 , (nsmooth [1 ] - 1 ) / 2 ]
65+ return Convolve2D (dims , h = h , offset = offset , axes = axes , dtype = dtype )
0 commit comments