-
Notifications
You must be signed in to change notification settings - Fork 366
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
Improve warped rectangular projections #1180
Conversation
These tests all appear in most of the other projections' tests.
7e77064
to
08982cc
Compare
Also, instead of using existing results as I did before, I worked out the limits from the equations (that's how I noticed Mollweide didn't support ellipses.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff. Thanks @QuLogic.
@@ -175,9 +175,11 @@ def test_transform_points_xyz(self): | |||
def test_globe(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting that this test hasn't changed based on the fact that the globe changed. Shows that the test is of questionable value. Perhaps the first thing to fix is the name of the variables (rugby_globe
-> footy_globe
and footy_globe
-> tennisball_globe
). And then we should think about whether this test needs to remain at all...
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, that's kind of the point; Mollweide doesn't support elliptical globes, so specifying ellipse
or semiminor_axis
does nothing.
This test doesn't actually check that the results are different in the end... only that they match some 'true' value, whatever that might be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, perhaps I was a bit unclear; that's the point of the changes in this file. As to the point of the test, I think it's just testing that the globe
does something, though maybe it's become a bit redundant by the individual test_eccentric_ellipse
tests in the crs
directory.
Maybe we should add a test_globe
for the ones that only support spheres and remove this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. That works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add a test_globe for the ones that only support spheres and remove this test?
Either that, or we keep the test but fix the variable name. Either works for me. I'll defer this though in order to move the PR forwards.
assert np.all(np.isnan(result)) | ||
|
||
|
||
def test_transform_points(): | ||
""" | ||
Mostly tests the workaround for a specific problem. | ||
Problem report in: https://github.com/SciTools/cartopy/issues/23 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a 2 at the end (issue 232, I believe)
Oh, I might have been wrong about Mollweide; it seems to make a difference using WGS84 spherical-ized semimajor radius vs. WGS84-the-ellipse. But I'm not sure exactly if it truly supports ellipses. |
Oops, copy&paste type; was comparing against Robinson with the ellipse. Never mind. |
Improves warped rectangular projections in a few ways: