-
Notifications
You must be signed in to change notification settings - Fork 771
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
Increase MAX_ITER so Mollweide forward projection works near the poles. #3082
Conversation
Seems reasonable to me. Please add your test points to Lines 3581 to 3612 in 6243d11
Also, is Mollweide undefined at the poles or can latitudes very close to 90 be special cased to return the coordinates at the poles? |
The projection is defined up to +/-90.0, and I added the test to confirm that works. The problem before was that everything within +/-0.85 degrees snapped to the value at the pole. The additional test ensures that +/-89.99 is indeed different from the pole. If you wish I could change this to more 9s, but I thought this would be sufficient. |
I can't figure out from the logs what the test failures are, and building locally seems to work for me. |
I'll make a quick PR to use
|
Awesome. Thanks! I guess the output you get here also shows all the noise made from tests that expect an error code. I recall having been annoyed by that previously without finding a good solution. |
Oh wonderful, it looks like the test is machine dependent at the pole (and I don't believe that part of the code was touched by my PR). I've changed the test to look very near the pole which is the primary problem I'm trying to solve here. |
docs/source/*.rst
for new APIAs has been reported on
cartopy
here, and here, thePROJ
implementation of the Mollweide projection fails near the poles. In particular, with all versions up to and including 9.0.0, you can see that all declinations north of ~89.15 map to the same x/y point:It turns out the problem is simply that the
MAX_ITER
value is too low. SettingMAX_ITER = 30
as in this PR allows the projection to work properly up to (at least) 89.99999. There should be no penalty for performance at other declinations since the convergence tolerance has not been changed.With this PR:
For further information, setting
MAX_ITER = 20
works up to 89.999.