-
Notifications
You must be signed in to change notification settings - Fork 314
Fix circular quiver plots #3371
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
Changes from 4 commits
5f655f4
2f38a70
d47fc7a
936a7e7
fa7f056
36c0fdc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -167,6 +167,26 @@ def test_fail_unsupported_coord_system(self): | |
| self.plot('2d_rotated', u_cube, v_cube, | ||
| coords=('longitude', 'latitude')) | ||
|
|
||
| def test_circular_longitude(self): | ||
| # Test circular longitude does not cause a crash. | ||
| res = 5 | ||
| lat = DimCoord(np.arange(-90, 91, res), 'latitude', | ||
| units='degrees_north') | ||
| lon = DimCoord(np.arange(0, 360, res), 'longitude', | ||
| units='degrees_east') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E127 continuation line over-indented for visual indent |
||
| nlat = len(lat.points) | ||
| nlon = len(lon.points) | ||
| u_arr = np.ones((nlat, nlon)) | ||
| v_arr = np.ones((nlat, nlon)) | ||
| u_cube = Cube(u_arr, dim_coords_and_dims=[(lat, 0), (lon, 1)], | ||
| standard_name='eastward_wind') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E127 continuation line over-indented for visual indent |
||
| v_cube = Cube(v_arr, dim_coords_and_dims=[(lat, 0), (lon, 1)], | ||
| standard_name='northward_wind') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E127 continuation line over-indented for visual indent |
||
| u_cube.coord('longitude').circular = True | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also set Also, you could do it when you initialise the As that would apply to both u_cube and v_cube |
||
|
|
||
| self.plot('circular', u_cube, v_cube, | ||
| coords=('longitude', 'latitude')) | ||
|
|
||
|
|
||
| class TestQuiver(MixinVectorPlotCases, tests.GraphicsTest): | ||
| def setUp(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.
E127 continuation line over-indented for visual indent