astrowidgets
astrowidgets copied to clipboard
Exploring reimplementation using bqplot
Today I spend some time to explore the possibility of using bqplot for implementation, image from FITS has to be convert to other standard format such as PNG, JPEG for it to work, my question is there better to convert FITS to these format?
My current way of converting it is using pillow.
I think @mwcraig or @astrofrog would have to advise on the bqplot side. I think they use Qt mainly, but I am not sure. In the meantime, we ask for your patience.
The bqplot implementation would probably use https://github.com/glue-viz/ipyastroimage as the Mark on the bqplot plot. That can take a numpy array, so I think we can avoid the conversion to another image format. I haven't had a chance to experiment much with https://github.com/glue-viz/ipyastroimage
I have a rough draft implementation of a really basic image viewer based on bqplot somewhere, will try to dig it up tomorrow.
Hi, have you digged up the draft implementation? I would like to have a look! :)
Found it, will upload soon (it had zero comments and didn't actually quite work 😮)
Look in this, don't judge the code too harshly 😀
https://gist.github.com/mwcraig/303cfb6e3e970d137e91789245ff259d
You will need to change the image you are using, let me know if you need me to send an image.
@mwcraig , what is the overlap with https://github.com/glue-viz/glue-jupyter ? Maarten seems to be involved in that too.
@pllim -- not too much from what I understand.
Maarten developed ipyastroimage as a more astronomy-centric replacement for the Image mark in bqplot because they needed that for the jupyter version of glue. He released as a separate package so that we could use it also.
When I asked Tom R. about the api for astrowidgets his response was that glue didn't really have an API for images like that.
I don't think it makes much sense to do a ton of work on making new selection tools or trying to generate images with a bunch of linked plots, since glue is focusing on that.
I could see adding a glue-based image widget in the future and/or replacing whatever bqplot-based widget developed this summer with something from glue down the road. But my impression is that we would still need to do a fair bit of wrapping because the API here is so much different than what glue provides.
Looks like they renamed ipyastroimage to bqplot-image-gl. I kinda went a slightly different route at #121 mainly because I forgot about this issue.
@mwcraig , I see that in your gist above, you had to do some Event hacking to get the cursor info. Do you think that will work inside the ImageWidget class or it has to be done inside the notebook itself?