-
Notifications
You must be signed in to change notification settings - Fork 45
Add pixel_ratio option to .to_raster()
#1354
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
if plotting same scene again, say or tweaking a plot
mainly for temporary notebook files that may be around
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
Yeah, I think I'd slightly prefer the kwarg, keep |
|
I like the idea of returning the |
|
Sounds like we have a plan; looking forward to your edits, @zmoon ! |
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 looks great! Docs looks really good! I only had a few inline comments.
what the majority of users (and devs, I would think), would want the redirects are not followed, for example: intersphinx inventory 'https://numba.readthedocs.io/objects.inv' not fetchable due to <class 'requests.exceptions.HTTPError'>: 404 Client Error: Not Found for url: https://numba.readthedocs.io/objects.inv
and encapsulate note that `ccrs.CRS(str(ax.projection))` can recover the proj in many cases, but not all
|
@zmoon could you please update this from UXarray's main branch. Once we see all test pass after that, I'll approve it |
philipc2
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 great! Thank you for this contribution.
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 looks great; thanks a lot for the contribution!
|
Thanks @philipc2 and @erogluorhan , sorry that this ballooned a bit from the initial simple |
|
No worries at all! I really like how it evolved! |


Overview
As discussed in #1353, this PR introduces a
pixel_ratiosetting to theUxDataArray.to_raster()method, allowing you to easily control the resolution of the rasterization when using Matplotlib+Cartopy without HoloViz.One issue is that the get-faces-containing-points gets pretty slow as you increase pixel ratio. So I also added an option to pass in a pre-computed mapping (
pixel_mapping). Example use-cases could be if you are making a lot of plots of the same scene, or overlaying multiple fields in one plot, or tweaking things and want a faster iterate cycle. But I wasn't sure what would be the best way to expose creating the mapping to the user.Also added an example and a few other docs tweaks.
Expected Usage
PR Checklist
General
Testing
Documentation
_)docs/user_api/index.rstExamples
docs/examples/folderdocs/examples.rsttoctreedocs/gallery.ymlwith appropriate thumbnail photo indocs/_static/thumbnails/