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

Fixed divide-by-zero errors in ecef2geodetic caused by changes in 3.0.0 release. #83

Merged
merged 2 commits into from
Nov 15, 2023

Conversation

adamshapiro0
Copy link
Contributor

After the recent change to use isclose() in commit dde1b9c, ecef2geodetic now raises ValueError if you try to convert more than one position, and at least one of those results in a divide-by-zero error. This fixes that, and also fixes the Beta value used for all positions that did not have a divide-by-zero error.

After the change in commit dde1b9 to use isclose(), this now fails with the
following exception when trying to convert multiple locations (len(z) > 1) and
one or more of them has a divide-by-zero error:
ValueError: The truth value of an array with more than one element is
ambiguous. Use a.any() or a.all()
If one or more values would divide by zero and needs to use a fallback Beta
value, it's still necessary to calculate the correct Beta for any other values
that would have succeeded. Previously, this used the same fallback value for all
positions if even just one failed.
@scivision scivision merged commit 3e4908f into geospace-code:main Nov 15, 2023
scivision added a commit that referenced this pull request Nov 20, 2023
@scivision
Copy link
Member

@adamshapiro0 I had to revert this because it broke a lot of tests. I reimplemented it, and wonder if this works for your scenario or if it needs further improvement.

scivision added a commit that referenced this pull request Nov 20, 2023
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.

2 participants