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

make_trapezoid() creates gradient event with slew rate bigger than max_slew_rate without warning #213

Closed
h3lg3 opened this issue Dec 4, 2024 · 1 comment
Assignees

Comments

@h3lg3
Copy link
Contributor

h3lg3 commented Dec 4, 2024

Describe the bug
Creating a gradient with make_trapezoid(), providing system, area, duration and rise_time creates a gradient with a slew rate bigger than system.max_slew without warning.

To Reproduce

import pypulseq as pp
system = pp.Opts()

# Set max slew to 50 T/m/s
system.max_slew = 50 * system.gamma  # Hz/m/s

grad_spoil = pp.make_trapezoid(channel='z', system=system, area = 800, duration = 1e-3, rise_time = 200e-6)

grad_slew_rate = grad_spoil.amplitude/grad_spoil.rise_time/system.gamma
print(f"Slew rate of gradient: {round(grad_slew_rate)} T/m/s")

# Slew rate of gradient: 117 T/m/s

Expected behavior
If I set max_slew as a system spec I dont want it to be exceeded.

Desktop (please complete the following information):

  • OS: [e.g. Win11]
  • pypulseq version: [e.g. 1.4.2]
@FrankZijlstra
Copy link
Collaborator

Resolved in #214.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants