Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Imviz: Minimum viable "markers" #662

Closed
eteq opened this issue Jun 7, 2021 · 2 comments · Fixed by #699
Closed

[FEAT] Imviz: Minimum viable "markers" #662

eteq opened this issue Jun 7, 2021 · 2 comments · Fixed by #699
Labels
feature Feature request imviz
Milestone

Comments

@eteq
Copy link
Contributor

eteq commented Jun 7, 2021

This is an outgrowth from #622 / #630 / #632- after some out-of-band conversations (esp with @pllim and @astrofrog), we realized that the concept of "regions" that we are getting from glue's subsets are not quite comparable to ds9-style regions. The regions we're using right now in jdaviz aren't really scalable to even many 10s, much less the 1000s or more that are often needed when you want to mark all the objects of some type in a typical astronomical image.

So this issue proposes instead that we split our existing "regions" concept into "regions" and "makers". Regions map onto the glue concept of subsets, meaning interactively selectable and grabbable in the notebook as a mask or astropy region or the like. Markers are more like the marks that astrowidgets uses, and more like what happens when you load a large table of point or circles into ds9 as "regions".

So this issue suggests a minimal marker implementation

  • Markers are the standard glue-jupyter/bqplot scallter plot.
  • Only usable from the notebook with a "live" astropy table (can later implement this as a plugin, but initially only in the notebook). The minimal implementation is just add_markers from astrowidgets, remove_markers from astrowidgets, and maybe reset_markers from astrowidgets
  • If there are multiple viewers up, it just runs on all the viewers by default. Option on (if it's easy), adding a keyword to add_markers/remove_markers to reference a viewer by name (reset would just reset everything), but that's not the minimal case, so if that's too complicated, all is sufficient.

🐱

@eteq eteq added feature Feature request imviz labels Jun 7, 2021
@pllim pllim changed the title [FEAT] Imviz: Minimum vialable "markers" [FEAT] Imviz: Minimum viable "markers" Jun 7, 2021
@pllim pllim added this to the Imviz 1.0 milestone Jun 7, 2021
@pllim

This comment has been minimized.

@pllim
Copy link
Contributor

pllim commented Jun 23, 2021

OK, this glupyter example really helped a lot. The mapping from native glupyter to jdaviz was less obvious but I think I got it with some trial and error.

import numpy as np
from astropy.table import Table
from glue.core import Data

t = Table({'x': np.random.randint(0, 100, 10), 'y': np.random.randint(0, 100, 10)})
t_glue = Data('Markers', **t)

data = viewer.state.data_collection[0]

imviz.app.session.application.add_link(t_glue, 'x', data, 'Pixel Axis 1 [x]')
imviz.app.session.application.add_link(t_glue, 'y', data, 'Pixel Axis 0 [y]')

viewer.add_data(t_glue)

Still not sure how to change the color, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request imviz
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants