holoviz / geoviews

Simple, concise geographical visualization in Python
http://geoviews.org
BSD 3-Clause "New" or "Revised" License
587 stars 75 forks source link

How do debug Quadmesh issue with curvilinear coordinates? #222

Closed rsignell-usgs closed 5 years ago

rsignell-usgs commented 6 years ago

I'm trying to visualize some curvilinear model output from the ROMS ocean model with quadmesh. The xarray quadmesh example from the geoviews docs works perfectly, but when I try my own example, I get nothing, even though my geoviews object looks the same to me:

The notebook executes with no python or javascript errors errors, but hangs in a way that is not interruptable by a kernel interrupt when the cell after cell [13] is called:

%%opts QuadMesh [width=700 height=350]
tiles * qmeshes2

Any ideas how to debug?
(p.s. my notebook should be reproducible since it accesses data in xarray via OPeNDAP)

philippjfr commented 6 years ago

I suspect this is simply because large quadmeshes are very inefficient when plotted with bokeh because each grid cell is an individual polygon. I think we may just have to add warnings for large grids, and suggest that the mesh should be rasterized with datashader. That should at least work although that too requires significant optimization.

rsignell-usgs commented 6 years ago

@philippjfr, okay, I'll use datashader. But I think there might be some other problem here, because the example that works has 6348 quads to render at each time step, and mine doesn't work even with 3060 quads to render: https://nbviewer.jupyter.org/gist/rsignell-usgs/f1aa53894e995820da1250149f586cda

This notebook should be able to be run without changes if you want to test.

philippjfr commented 5 years ago

I believe the slowdown is unrelated to anything in geoviews, and it's something to do with accessing the file, e.g. if I try to run this on its own:

ds.Hwave[0:2,::10,::10]

It hangs in the same way.