Skip to content

Commit

Permalink
Fixed incorrect shape_dur in make_extended_trapezoid when a delay…
Browse files Browse the repository at this point in the history
… is specified in the `times` argument
  • Loading branch information
FrankZijlstra committed Feb 5, 2024
1 parent 20358a5 commit a22879a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pypulseq/make_extended_trapezoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ def make_extended_trapezoid(
round(times[0] / system.grad_raster_time) * system.grad_raster_time
)
grad.tt = times - grad.delay
grad.shape_dur = (
round(times[-1] / system.grad_raster_time) * system.grad_raster_time
)
grad.shape_dur = grad.tt[-1]
grad.area = 0.5 * ((grad.tt[1:] - grad.tt[:-1]) * (grad.waveform[1:] + grad.waveform[:-1])).sum()

grad.first = amplitudes[0]
Expand Down

0 comments on commit a22879a

Please sign in to comment.