0

I am working with irregularly gridded earth observation data, and am trying to find ways to plot this efficiently using holoview with bokeh as the backend. I wish to avoid interpolation if at all possible.

Plotting regularly gridded data seems simple enough via the RGB method Holoviews RGB coordinates. However, the approach for irregularly gridded data seems to be to use Quadmesh. Implementing this, and using datashading to conserve memory, is simple enough for a single channel of data mapped to a defined colourmap, e.g.;

qmesh = hv.QuadMesh((lon, lat, band_dict['Oa08_radiance']))
datashade(qmesh, cmap=plt.cm.viridis).opts(width=np.shape(lon)[0], height=np.shape(lon)[1])

So far, so good, but despite my best efforts, I can't find a way to implement this for 3-channel RGB. In my previous matplotlib attempts to achieve the same thing, I passed either a tuple to the pcolormesh "color" argument, or a LinearSegmentedColormap to the "cmap" argument. Neither work in this case.

Surprisingly, I can find no pre-existing examples of this; which makes me wonder if what I am attempting is impossible. Has anyone else attempted the same and can help?

Ben
  • 3
  • 3
  • HoloViews does not offer an RGB QuadMesh element. I think this could be done using a Compositor given three or four datashaded QuadMesh elements, combining them into one final RGB element for display. Probably about 5 lines of code, but I haven't tried it. If you post an example with data at the HoloViz discourse we can probably help. – James A. Bednar Feb 05 '22 at 15:44
  • 1
    Thanks @JamesA.Bednar, I'll head to HoloViz and post the example there. – Ben Feb 08 '22 at 18:23

0 Answers0