Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes in make_extended_trapezoid and add_gradients #167

Merged
merged 6 commits into from
Feb 7, 2024
Next Next commit
Added missing area calculation to make_extended_trapezoid
FrankZijlstra committed Feb 5, 2024
commit 72010259b67da23f9f33be19c89da2cc7cb84c45
1 change: 1 addition & 0 deletions pypulseq/make_extended_trapezoid.py
Original file line number Diff line number Diff line change
@@ -139,6 +139,7 @@ def make_extended_trapezoid(
grad.shape_dur = (
round(times[-1] / system.grad_raster_time) * system.grad_raster_time
)
grad.area = 0.5 * ((grad.tt[1:] - grad.tt[:-1]) * (grad.waveform[1:] + grad.waveform[:-1])).sum()

grad.first = amplitudes[0]
grad.last = amplitudes[-1]