Skip to content

Commit

Permalink
Merge pull request #563 from mrava87/patch-debl
Browse files Browse the repository at this point in the history
fix: better handling of nttot in BlendingContinuous
  • Loading branch information
mrava87 committed Jan 9, 2024
2 parents 64556cd + 68ee8b9 commit 54bef33
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pylops/waveeqprocessing/blending.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ def __init__(
self.dt = dt
self.times = times
self.shiftall = shiftall
self.nttot = int(np.max(self.times) / self.dt + self.nt + 1)
if np.max(self.times) // dt == np.max(self.times) / dt:
# do not add extra sample as no shift will be applied
self.nttot = int(np.max(self.times) / self.dt + self.nt)
else:
# add 1 extra sample at the end
self.nttot = int(np.max(self.times) / self.dt + self.nt + 1)
if not self.shiftall:
# original implementation, where each source is shifted indipendently
self.PadOp = Pad((self.nr, self.nt), ((0, 0), (0, 1)), dtype=self.dtype)
Expand Down

0 comments on commit 54bef33

Please sign in to comment.