ortk95 / planetmapper

PlanetMapper: An open source Python package for visualising, navigating and mapping Solar System observations
https://planetmapper.readthedocs.io
MIT License
10 stars 1 forks source link

Ensure `angular_dist` returns a valid values #363

Closed ortk95 closed 3 months ago

ortk95 commented 3 months ago

For some input values (e.g. for identical input points), SpiceBase.angular_dist returned NaN. This was due to the accumulation of small floating point errors causing the code to evaluate e.g. np.arccos(1.0000000000000002) -> NaN rather than the correct np.arccos(1.0) -> 0.0. This has been fixed by clipping the value in np.arccos to ensure it always lies between -1 and 1.

Closes #357

Pull request checklist

See CONTRIBUTING.md for more details.

coveralls commented 3 months ago

Pull Request Test Coverage Report for Build 9480837579

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Totals Coverage Status
Change from base Build 9480466937: 0.0%
Covered Lines: 2955
Relevant Lines: 2968

💛 - Coveralls