GeoscienceAustralia / GeodePy

A toolkit for Geodesy and Surveying in Python
Apache License 2.0
91 stars 47 forks source link

Normal-orthometric correction and vincinv fix #110

Closed nicgowans closed 4 years ago

nicgowans commented 4 years ago

Add the normal-orthometric correction function:

Fixes a math domain error occasionally encountered with the vincinv function (Eqn 78).

Apologies for having these in the same pull request - had already started on the noc function before it presented itself.

BatchelorJ commented 4 years ago

Great stuff Nic! Re: fixing the Eqn 78 issue in vincinv, did you want to add the example in your commit message into the test suite? Should ensure that if we refactor vincinv later we'll have a test for this problem.

nicgowans commented 4 years ago

Cheers, Josh. Great idea. Will do.

nicgowans commented 4 years ago

All done. I also corrected what looks like a copy/paste error in test2 (line 79), but I now notice the same error is repeated on lines 91, 106. e.g. test2 = vincinv(lat1_DMS, lon1_DMS, lat1_DMS, lon1_DMS) self.assertEqual(test2[0], 0) self.assertEqual(test2[0], 0) self.assertEqual(test2[2], 0)

BatchelorJ commented 4 years ago

Awesome, and that looks like some fat fingers on my part with 79, 91, 106. I think that test would be better as self.assertEqual(test2, (0, 0, 0)) rather than the clunky 3-liner test I've got it there. Happy for you to fix those lines up, or I'm also happy to open a new PR once you've closed this one off

nicgowans commented 4 years ago

Thanks, Josh. I've implemented the changes to those tests.

Cheers, Craig. Happy to help out.