Skip to content

Commit

Permalink
Update make_trapezoid.py to add slew rate check for the ramp down as …
Browse files Browse the repository at this point in the history
…well
  • Loading branch information
FrankZijlstra authored Dec 11, 2024
1 parent 85c3291 commit fde9c46
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pypulseq/make_trapezoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ def make_trapezoid(

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).'
), f'Refined slew rate ({abs(amplitude2)/rise_time:0.0f} Hz/m/s) for ramp up is larger than max ({max_slew:0.0f} Hz/m/s).'

assert (
abs(amplitude2) / fall_time <= max_slew
), f'Refined slew rate ({abs(amplitude2)/fall_time:0.0f} Hz/m/s) for ramp down is larger than max ({max_slew:0.0f} Hz/m/s).'

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

0 comments on commit fde9c46

Please sign in to comment.