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

Error when using "too large" interval as parameter in RadonParallelCircle #16

Closed
sebaseb98 opened this issue Aug 15, 2024 · 6 comments
Closed

Comments

@sebaseb98
Copy link

Observed behaviour:

when executing radon(zeros((10,10)), [0, π/4, π/2]; geometry=RadonParallelCircle(10, -5:5)) in my REPL, I get an error which originates from RadonKA/DK5pc/src/utils.jl line 60. My full error message is:
image

possible solution:

As far as I understood the code, it could be enough to just add an abs() around the expression that becomes negative for too large values in the in_height array/range, as x_dist probably(?) should be the distance.

@roflmaostc
Copy link
Owner

roflmaostc commented Aug 15, 2024

Ah maybe I should throw errors upon creation of RadonParallelCircle(10, -5:5)).
But -5:5 is not supported for an array of size 10.
The limits are -4 and 4.
The center of an array with 10 elements is index 6. So 6 + 5 > 10, which means a ray would travel outside of the support of the array.

@roflmaostc
Copy link
Owner

Added better error message and updated docstring with
9764d53

@sebaseb98
Copy link
Author

That should work as well, but in the real world you could also use a large CT-scanner for small things. That's what I wanted to try :D
But of course it's up to you and if the implementation is designed in a way that this would be hard to fix otherwise, your solution is completely fine

@roflmaostc
Copy link
Owner

Yeah, in this case I guess you need to make the array larger or work around it.

@roflmaostc
Copy link
Owner

Better error message will be included soon in 0.6.2.
Functionality is the same in 0.6.1

JuliaRegistries/General#113188

@roflmaostc
Copy link
Owner

Just hit me up you find other sharp edges or errors :)

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

2 participants