-
Notifications
You must be signed in to change notification settings - Fork 64
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
'split_gradient_at' function does not work well #25
Comments
Could you please share code to reproduce this on |
For example: gy = make_trapezoid(channel='y', system=system, area=4.166666666666667) gy_parts = split_gradient_at(grad=gy, time_point=6e-05 / 2, system=system) Here, gy is: and gy_parts is: As you can see, gy max is 138888.88888 then, even gy_parts says its first and last values (on the right and left parts, respectively) are of 138888.888888. However, the actual values of the arrays ([ 23148.14814815, 69444.44444444, 115740.74074074] and [115740.74074074, 69444.44444444, 23148.14814815]) are scaled differently. Probably because it changes the shape of the triangle. As far as I understand it, this way we are loosing one raster time to construct the triangle with a desired area. Thanks! |
- Round to 6 digits in multiple places for expected results - Minor code reformatting
Hello, can you please pull from commit 7ee6852 and let me know if the issue is fixed? You can download the ZIP from: https://github.com/imr-framework/pypulseq/tree/7ee685224962cfa5c500c6976a624fb6d09ff396 |
Please reopen this issue if the bug is not fixed. |
Describe the bug
split_gradient_at function does not split the gradient defined as 'trap' correctly.
Expected behavior
For example, if the gradient maximum value is gy.amplitude=138888 and the rise and fall times are of 3xraster times, when you split in two equal parts the values of, ie., the fall part are array([115740.74074074, 69444.44444444, 23148.14814815]). See that the maximum values is not 138888 anymore, and that it does not end in zero either.
The text was updated successfully, but these errors were encountered: