-
Notifications
You must be signed in to change notification settings - Fork 72
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
Rewrite check for point inside tesseroid with Numba #419
Conversation
Rewrite the functions that checks if a computation point falls inside a tesseroid using Numba instad of Numpy. This greatly reduce the memory need of the Numpy functions, that required to build large matrices even for medium-size problems.
Also, extend the tests for those cases of multiple observation points and tesseroids.
conflicting = [] | ||
for i in range(longitude.size): | ||
for j in range(tesseroids.shape[0]): | ||
if _check_point_inside_tesseroid( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@santisoler is it worth having a function here? The function itself is a single if
and is called inside another if
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not at all. I coded this fairly quickly and I was prototyping a little bit with parallelization of the checks. I ultimately decided to keep them in serial. I've already merged the two functions into a single one.
Include the if statement in the function that runs the for loop over observation points and tesseroids.
…to fix-tesseroids-bug
@leouieda I think this is ready to be merge. If you would like to give it a second look, feel free to do so. |
Rewrite the functions that checks if a computation point falls inside a tesseroid using Numba instad of Numpy. This greatly reduce the memory need of the Numpy functions, that required to build large matrices even for medium-size problems.
Relevant issues/PRs:
Fixes #417