Quansight / lsst_dashboard

LSST Dashboard https://quansight.github.io/lsst_dashboard/
BSD 3-Clause "New" or "Revised" License
8 stars 3 forks source link

Add Colorbar to Skyplot #43

Closed brendancol closed 4 years ago

chbrandt commented 4 years ago

This is a work-around Tim itself considered to have the skyplot colorbar.

philippjfr commented 4 years ago

I'd really just suggest to switch to the rasterize operation. Don't think datashade with histogram equalization is appropriate for this data.

chbrandt commented 4 years ago

Cool, thanks @philippjfr , done. I could not set the colormap though. Any suggestion?

philippjfr commented 4 years ago

When rasterized the colormap is set as a style option using .opts(cmap=...)

chbrandt commented 4 years ago

@brendancol Branch skyplot_colorbar has the skyplot with colorbar (viridis). It is using rasterize and viridis. It is not using any spreading though, to be solved.

brendancol commented 4 years ago

@philippjfr This is the code in question here. I would think we need a shade call after rasterize:

https://github.com/Quansight/lsst_dashboard/blob/skyplot_colorbar/lsst_dashboard/plots.py#L397-L405

chbrandt commented 4 years ago

@brendancol Fixed the datapoints spreading limitation when using colorbar in Skyplot in commit b6db1dc286271e654abb7082a9899a385c8a71c7 of branch skyplot_colorbar; not yet merged to master because there are some widgets in need for styling, but branch is running stable.

The overall solution is to (go back and) use datashade() + dynspread(), and over it (like decimate()) we use a transparent rasterize(), to which we can associate a colorbar. The layers use the same colormap and aggregator.

Once we have the widgets therein decently styled we can merge to master and close here.

chbrandt commented 4 years ago
kidpixo commented 4 years ago

@chbrandt thanks for the hint!

I'm using something like:

import holoviews.operation.datashader as hds

raster = hds.raster(data).opts(alpha=1,colorbar=True)

raster*\
background_image\*
hds.shade(raster).opts(alpha=0.7)

because in my case I found the setting alpha=0 to raster apply to the colorbar too.

This way raster is covered by the the hds.shade(raster) anyway, plus I have a background image.