glue-viz / glue-jupyter

Glue front-end for the Jupyter ecosystem
https://glue-jupyter.readthedocs.io/en/latest/
Other
88 stars 38 forks source link

Implement world coordinate display in bqplot image viewer #154

Open astrofrog opened 4 years ago

astrofrog commented 4 years ago

Currently the Matplotlib image viewer uses WCSAxes to display world coordinates. There are two parts to this:

@maartenbreddels - since you have experience with bqplot, do you think there is a way to disable the default ticks/tick labels and plot ticks and tick labels at custom locations instead?

maartenbreddels commented 4 years ago

Yes, location we can control, using bqplot's Axes object has a tick_values. But we don't have a way to control the tick label, only via a formatter. I guess we can open an issue at bqplot, and I could work on that.

astrofrog commented 4 years ago

@maartenbreddels - yes having the ability to use a custom formatter would be great - and ideally we would then want to use the WCSAxes one, maybe with a thin wrapper if needed. Based on discussions with @eteq I'm pretty sure that this issue is reasonably high priority so it might indeed make sense if you can work on that part. I can work on generalizing the WCSAxes code so that I can provide bqplot with a list of ticks and tick labels.

Do you think it's something we can develop as a patch to bqplot in a separate package (in the short term), or is it something that would require internal changes in bqplot?

eteq commented 4 years ago

I just discussed this a bit more with @astrofrog, and I think the second of these check box is the higher priority, because it might be better in at least some views to hide the ticks/axis labels entirely.

Of course that still requires the "tick finding" logic, so maybe all the work is needed anyway even if we hide the axes (while showing the overlay grid lines). @maartenbreddels perhaps has a guess at that?

maartenbreddels commented 4 years ago

I'll keep both options in mind. Would it make sense to have an axis object that is wcs aware, or do you want to handle it all in the kernel?

astrofrog commented 4 years ago

I don't think we could handle WCS in a generic way in the frontend, we'd need to be able to support FITS-WCS, GWCS, and so on (any APE-14-compliant WCS).

astrofrog commented 6 months ago

One option for this, to at least have something working, would be to see if we can somehow internally store a WCSAxes instance that can be used to determine the ticks and tick labels, and then use the new bqplot functionality to override these in order to set them in the front-end.

astrofrog commented 6 months ago

I've opened https://github.com/astropy/astropy/issues/16464 to see how we can facilitate this on the WCSAxes side.