diff --git a/pylops/signalprocessing/sliding1d.py b/pylops/signalprocessing/sliding1d.py index 5a9232f9..5cb8c213 100644 --- a/pylops/signalprocessing/sliding1d.py +++ b/pylops/signalprocessing/sliding1d.py @@ -157,7 +157,7 @@ def Sliding1D( # create tapers if tapertype is not None: - tap = taper(nwin, nover, tapertype=tapertype) + tap = taper(nwin, nover, tapertype=tapertype).astype(Op.dtype) tapin = tap.copy() tapin[:nover] = 1 tapend = tap.copy() @@ -172,7 +172,9 @@ def Sliding1D( if tapertype is None: OOp = BlockDiag([Op for _ in range(nwins)]) else: - OOp = BlockDiag([Diagonal(taps[itap].ravel()) * Op for itap in range(nwins)]) + OOp = BlockDiag( + [Diagonal(taps[itap].ravel(), dtype=Op.dtype) * Op for itap in range(nwins)] + ) combining = HStack( [ diff --git a/pylops/signalprocessing/sliding2d.py b/pylops/signalprocessing/sliding2d.py index 5af92b0b..c97802c6 100644 --- a/pylops/signalprocessing/sliding2d.py +++ b/pylops/signalprocessing/sliding2d.py @@ -191,7 +191,7 @@ def Sliding2D( # create tapers if tapertype is not None: - tap = taper2d(dimsd[1], nwin, nover, tapertype=tapertype) + tap = taper2d(dimsd[1], nwin, nover, tapertype=tapertype).astype(Op.dtype) tapin = tap.copy() tapin[:nover] = 1 tapend = tap.copy() @@ -206,7 +206,9 @@ def Sliding2D( if tapertype is None: OOp = BlockDiag([Op for _ in range(nwins)]) else: - OOp = BlockDiag([Diagonal(taps[itap].ravel()) * Op for itap in range(nwins)]) + OOp = BlockDiag( + [Diagonal(taps[itap].ravel(), dtype=Op.dtype) * Op for itap in range(nwins)] + ) combining = HStack( [ diff --git a/pylops/signalprocessing/sliding3d.py b/pylops/signalprocessing/sliding3d.py index f0a2b64a..7d21018c 100644 --- a/pylops/signalprocessing/sliding3d.py +++ b/pylops/signalprocessing/sliding3d.py @@ -183,13 +183,16 @@ def Sliding3D( # create tapers if tapertype is not None: - tap = taper3d(dimsd[2], nwin, nover, tapertype=tapertype) + tap = taper3d(dimsd[2], nwin, nover, tapertype=tapertype).astype(Op.dtype) # transform to apply if tapertype is None: OOp = BlockDiag([Op for _ in range(nwins)], nproc=nproc) else: - OOp = BlockDiag([Diagonal(tap.ravel()) * Op for _ in range(nwins)], nproc=nproc) + OOp = BlockDiag( + [Diagonal(tap.ravel(), dtype=Op.dtype) * Op for _ in range(nwins)], + nproc=nproc, + ) hstack = HStack( [