-
Notifications
You must be signed in to change notification settings - Fork 34
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
Support GEOS Cube-Sphere Grids #802
Conversation
Let me know if you have any feedback! |
Well, I think I need to learn more Python but I decided to try on a stretched grid file I finally got. I first tried plotting the grid but apparently this:
was a bit too much for my laptop. I waited a few minutes and in the end it was just solid blue. But following some of your examples, I did get out: which is nice! I then tried a I think what this demonstrates is that I need to convince my boss to help make a much coarser stretch grid...or learn more UXarray |
Glad you were able to get it working! Surprised that the Polygon plot took that long. Typically grids of that size should take no longer than a minute maximum for the first run. |
Hmm. Well, it was on an M3 MacBook Air...if that matters? Note: it's also possible I called things incorrectly. I was just sort of trying to echo the cookbook. 😄 |
Yeah, I've run similar sized meshes on a 32GB M1 and had reasonable performance. Mind sharing the file so I can try to recreate it? |
Yes...if I can figure out how to share it. Can you try: https://gmao.gsfc.nasa.gov/gmaoftp/gmao_SIteam/test-fixapp-c270.geosgcm_prog_nat.20200415_0000z.nc4 I think that works. If you get it, let me know. It's about 500 MB because I didn't really clean it up |
import uxarray as ux
import geoviews.feature as gf
import cartopy.crs as ccrs
features = gf.coastline(
projection=ccrs.PlateCarree(), line_width=1, scale="50m"
) * gf.states(projection=ccrs.PlateCarree(), line_width=1, scale="50m")
file_path = r"C:\Users\chmie\Downloads\test-fixapp-c270.geosgcm_prog_nat.20200415_0000z.nc4" %%time
uxds = ux.open_dataset(file_path, file_path) Took about 3s %%time
uxds['T'][0][-1].plot.rasterize(method='polygon', exclude_antimeridian=True) * features Took about 3s as well. uxds['RH'][0][0].subset.bounding_circle((-90, 25), 10).plot.rasterize(method='polygon', exclude_antimeridian=True, pixel_ratio=4.0) * features |
I'd like to mention that the white spots are due to an upstream issue with Datashader, which will be fixed in the next release. |
Hmm. When I first tried your first block of code, I got:
So, I added:
And then the plots took about 2s. So...yeah, I must have really screwed things up in my testing to be ~100x slower. 😄 |
And I was wondering about the weird white spots, but I figured they were due to just...something. Now, my laptop was not happy with:
Actually, my browser sort of crashed before it could render... |
uxgrid = ux.open_grid(file_path,file_path) %%time
The issue here is that you're using |
Ohhhh. So:
would be faster? I'll try that tonight on my laptop! (I'm learning!) |
Plotting a data variable would be faster, since that performs a raster operation as opposed to a vector plot of the geometries. Our grid (i.e. only mesh) plotting is all vector based, but our data variables can be plotted as rasters. # defaults to raster plot
uxds['T'].plot()
# can specifically call a raster
uxds['T'].plot.rasterize(method='polygon') |
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.
Nice work on this!
Doubly so from me and the GEOS community. Nice to have another package that can read our files without need to do all sort of gymnastics! |
Woo! Thanks. I eagerly await the next release! 😄 |
Can confirm, speckles are gone...though I am getting a lot of:
I can get a picture, so this is working, but is this something we should worry about in future? |
Closes #801
Overview