Skip to content

Commit

Permalink
* fix: exceed of max slew rate for gradient event if make_trapezoid()…
Browse files Browse the repository at this point in the history
… is called.
  • Loading branch information
h3lg3 committed Dec 4, 2024
1 parent 2f14543 commit bb4a55f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pypulseq/make_trapezoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ def make_trapezoid(
abs(amplitude2) <= max_grad
), f'Refined amplitude ({abs(amplitude2):0.0f} Hz/m) is larger than max ({max_grad:0.0f} Hz/m).'

assert (
abs(amplitude2)/rise_time <= max_slew
), f"Refined slew rate ({abs(amplitude2)/rise_time:0.0f} Hz/m/s) is larger than max ({max_slew:0.0f} Hz/m/s)."

grad = SimpleNamespace()
grad.type = 'trap'
grad.channel = channel
Expand Down

0 comments on commit bb4a55f

Please sign in to comment.