Skip to content

Commit

Permalink
fix: better handling of nttot in BlendingContinuous
Browse files Browse the repository at this point in the history
  • Loading branch information
mrava87 committed Jan 9, 2024
1 parent 64556cd commit 68ee8b9
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 68ee8b9

Please sign in to comment.