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

Rewrite check for point inside tesseroid with Numba #419

Merged
merged 9 commits into from
Jul 19, 2023

Conversation

santisoler
Copy link
Member

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

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(
Copy link
Member

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.

Copy link
Member Author

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.
@santisoler
Copy link
Member Author

@leouieda I think this is ready to be merge. If you would like to give it a second look, feel free to do so.

@santisoler santisoler merged commit 2e35878 into main Jul 19, 2023
20 checks passed
@santisoler santisoler deleted the fix-tesseroids-bug branch July 19, 2023 21:55
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

Successfully merging this pull request may close these issues.

Check for observartion point inside tesseroid eats too much memory
2 participants