Skip to content
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

Cartopy bug when plotting quivers #628

Closed
b-barton opened this issue Oct 24, 2023 · 6 comments · Fixed by #647
Closed

Cartopy bug when plotting quivers #628

b-barton opened this issue Oct 24, 2023 · 6 comments · Fixed by #647
Assignees

Comments

@b-barton
Copy link
Collaborator

b-barton commented Oct 24, 2023

There is a bug in cartopy when plotting quivers using a stereographic projection. This is hard to understand when a correction to the quivers is also needed for plotting NEMO currents over the North Pole. There is a correction that can be added to when plotting currents over the pole. The bug has been un-resolved in cartopy for several years.

There are additional functions needed to enable plotting NEMO velocities in general so that the curvilinear grid i, j currents are projected in northwards and westwards currents that can be plotted in CartoPy.

Branch made bug/#628_cartopy_quivers

AC:

  • Add functions to COAsT that allow the correct plotting of currents over the pole.
@jpolton jpolton moved this to MSM - todo in COAsT_dev Oct 24, 2023
@b-barton b-barton self-assigned this Oct 31, 2023
@b-barton b-barton moved this from MSM - todo to MSM - in progress in COAsT_dev Oct 31, 2023
@b-barton
Copy link
Collaborator Author

Added functions in plot_util.py:
velocity_polar()
make_projection()
velocity_rotate()
grid_angle()
velocity_on_t()
velocity_grid_to_geo()

@b-barton
Copy link
Collaborator Author

I've taken this a little further than the bug states. velocity_polar() fixes the cartopy bug but id doesn't make sense to just fix the bug without the other utilities for plotting NEMO velocities as quivers.

@b-barton
Copy link
Collaborator Author

b-barton commented Nov 2, 2023

I've added some unit tests for each function. I need to make sure they work.

@b-barton
Copy link
Collaborator Author

b-barton commented Nov 3, 2023

I've run the tests and they pass. I'm going to check how it works with some real NEMO data before suggesting to merge.

@b-barton
Copy link
Collaborator Author

b-barton commented Nov 6, 2023

I'm having problems running the build tests on Windows (Windows fatal exception: access violation). I've only added code not changed any so don't expect the tests to fail. Could someone else check the tests for me.

@b-barton
Copy link
Collaborator Author

b-barton commented Nov 6, 2023

I have been able to run most of the tests. test_gridded_initialisation and test_tidegauge_methods don't seem to run on my laptop, I don't think it is anything related to the functions I've added just weird windows things.

@b-barton b-barton mentioned this issue Nov 6, 2023
8 tasks
@jpolton jpolton linked a pull request Nov 7, 2023 that will close this issue
8 tasks
jpolton added a commit that referenced this issue Nov 9, 2023
@github-project-automation github-project-automation bot moved this from MSM - in progress to Done in COAsT_dev Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant