-
Notifications
You must be signed in to change notification settings - Fork 45
to_raster: handle unset extent; accept singleton extra dims #1420
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
Conversation
… and returns that 1D view.
|
@erogluorhan We can auto-set bounds just for the rasterization (or via an extent kwarg) so users still get a meaningful image without having to call set_global(). What do you think? xarray’s .plot() sets xlim/ylim from coord.. |
Thanks for this, Rajeev! It makes complete sense to me to provide some auto-set here. So, applying xarray's way here would work in a way to set axes extent based on the min-max x and y that is in the grid rather than setting to global, right?, So, it will work for our rasterization, correct? Also, since this "axes extent" thing was the actual reason behind #1393 , could you modify the description of this PR to reflect that (the current description can still reflect what additional features we are implementing about multi dims, but it is not the reason behind the reported issue) |
64602f1 to
e8c5198
Compare
erogluorhan
left a comment
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.
This is looking great and almost there; please see my comments below.
Cartopy can set projection limits while autoscale stays on, so the old (0,1)-only check missed default extents. Using autoscale plus a global PlateCarree extent keeps the warning firing when users never set an extent.
…array into rajeeja/fix_issue1393
erogluorhan
left a comment
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.
Looks good to me! Please fix the link-check and merge
Thanks to @brianpm for reporting #1393. This PR fixes #1393 that axes extent must be set before calling to_raster, and fixes the flat-output issue by auto-detecting default axes limits and setting a reasonable extent from grid lon/lat bounds when needed (with a warning). It also adds support for data with extra length-1 dimensions by allowing singleton dims and squeezing to (n_face,) before rasterization.