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

1D quiver in non-PlateCarree projections #672

Closed
ocefpaf opened this issue Sep 14, 2015 · 8 comments
Closed

1D quiver in non-PlateCarree projections #672

ocefpaf opened this issue Sep 14, 2015 · 8 comments

Comments

@ocefpaf
Copy link
Member

ocefpaf commented Sep 14, 2015

Using quiver with 1D arrays of x, y, u, v works just fine with ccrs.PlateCarree(), but raises a ValueError with any other projection:

ValueError: x, y, u and v arrays must be the same shape

Using np.atleast_2d fixes this, and the quiver docs do say: Plot a 2-D field of arrows.

However, I wonder if the atleast2d should be inside Cartopy, or if the 1D case should raise an error in PlateCarree too.

(See http://nbviewer.ipython.org/gist/ocefpaf/b2f79fe0f96fa1776b97 for a SSCCE.)

ocefpaf added a commit to ocefpaf/cartopy that referenced this issue Sep 14, 2015
@ocefpaf
Copy link
Member Author

ocefpaf commented Sep 14, 2015

BTW: This bug was found by a student @rafacsantana during our Python course here. Hopefully the students will be sending PRs of their own soon 😉

@pelson
Copy link
Member

pelson commented Sep 15, 2015

👍 - let's fix it.

@pelson
Copy link
Member

pelson commented Sep 15, 2015

Ping @scmc72 / @Jozhogg if you're interested.

@JosephHogg
Copy link
Contributor

Taking a look now 👍

@ocefpaf
Copy link
Member Author

ocefpaf commented Sep 15, 2015

@Jozhogg take a look at:

#674

@JosephHogg
Copy link
Contributor

Thanks @ocefpaf . Didn't spot your PR at first but I just made that same change myself! It certainly makes sense to me - transform_vectors is ok with everything being 1D so I feel like it makes sense to have that capability available in quiver. Opinions on that fix @pelson ?

@pelson
Copy link
Member

pelson commented Sep 15, 2015

Apologies to @ocefpaf and @Jozhogg. I hadn't seen the PR (or at least, hadn't linked the two).
Looks like #674 will do the trick. 👍

@ocefpaf
Copy link
Member Author

ocefpaf commented Sep 15, 2015

Apologies to @ocefpaf and @Jozhogg.

My bad. I sent this after a long day and forgot to cross-reference issue/PR.

ocefpaf added a commit to ocefpaf/cartopy that referenced this issue Sep 15, 2015
@pelson pelson added this to the 0.14 milestone Jan 28, 2016
@QuLogic QuLogic modified the milestones: 0.14, 0.14.0 Mar 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants