Open tdhopper opened 3 years ago
Thanks @tdhopper. Appears to be a projection issue, one simple fix is to project before rasterizing:
p = rasterize(gv.project(dataset.to(
gv.QuadMesh,
["lon", "lat"],
'air',
)))
Definitely shouldn't be needed though, it appears this happens because during projection the coordinates are normalized to -180 to 180 and when rasterize tries to update the data in that region it gets back an empty slice because the data longitudes range from 0 to 360.
@philippjfr Thank you. That fixes it!
Does anyone know how to fix this using hvplot.quadmesh( ... )
?
Description of expected behavior and the observed behavior
I’m trying to use
rasterize
to speed up plotting of weather maps with Geoviews/Holoviews/Bokeh in a Panel dashboard. However, when I try to pan or zoom in Bokeh, the plot disappears.Here’s a minimum example
I run this with
panel serve rasterize.ipynb
.When I try to pan or zoom the plot in the browser, the plot disappears and I get this in the Panel log:
/opt/conda/lib/python3.7/site-packages/xarray/core/nputils.py:227: RuntimeWarning: All-NaN slice encountered result = getattr(npmodule, name)(values, axis=axis, **kwargs) /opt/conda/lib/python3.7/site-packages/xarray/core/nputils.py:227: RuntimeWarning: All-NaN slice encountered
Environment
OS is Debian 10.1. Browser is firefox.
Conda env: