Skip to content

Commit

Permalink
Merge pull request PyLops#546 from mrava87/patch-contdeb
Browse files Browse the repository at this point in the history
fix: change BlendingContinuous to work with pylops solvers
  • Loading branch information
mrava87 authored Nov 15, 2023
2 parents e69a172 + 1c7c9e0 commit 99f5aa8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pylops/waveeqprocessing/blending.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ def _matvec_largerecs(self, x: NDArray) -> NDArray:
if self.ShiftOps[i] is None:
blended_data[:, shift_int : shift_int + self.nt] += x[i, :, :]
else:
shifted_data = self.ShiftOps[i] * self.PadOp * x[i, :, :]
shifted_data = (
self.ShiftOps[i]
.matvec(self.PadOp.matvec(x[i, :, :].ravel()))
.reshape(self.ShiftOps[i].dimsd)
)
blended_data[:, shift_int : shift_int + self.nt + 1] += shifted_data
return blended_data

Expand All @@ -172,11 +176,11 @@ def _rmatvec_largerecs(self, x: NDArray) -> NDArray:
if self.ShiftOps[i] is None:
deblended_data[i, :, :] = x[:, shift_int : shift_int + self.nt]
else:
shifted_data = (
self.PadOp.H
* self.ShiftOps[i].H
* x[:, shift_int : shift_int + self.nt + 1]
)
shifted_data = self.PadOp.rmatvec(
self.ShiftOps[i].rmatvec(
x[:, shift_int : shift_int + self.nt + 1].ravel()
)
).reshape(self.PadOp.dims)
deblended_data[i, :, :] = shifted_data
return deblended_data

Expand Down

0 comments on commit 99f5aa8

Please sign in to comment.