spacetelescope / jdaviz

JWST astronomical data analysis tools in the Jupyter platform
https://jdaviz.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
142 stars 74 forks source link

[FEAT] Aperture photometry plugin could "live update" the displayed layer #2548

Open eteq opened 1 year ago

eteq commented 1 year ago

Jdaviz component

Imviz

What is the problem this feature will solve?

When using the aperture photometry plugin, one can get into a confusing state by doing the following:

  1. Load two datasets A and B - B will be what's displayed be default
  2. In the apphot plugin, select dataset A
  3. Now draw a region based on what you see in that moment
  4. Hit "calculate".

Confusingly, the results are for aperture photometry on dataset A even though B is the one you can see in imviz at that moment.

Describe the desired outcome

Many solutions (including none are possible)... But I think my favored solutions are this

Non-batch mode

When the user selects a single layer that's not the visible one, either:

  1. Show a big red box that says "YOU ARENT LOOKING AT THE SAME THING YOUR PHOTOMETERING! THIS MIGHT BE CONFUSING, SILLY USER!"
  2. Automatically update the viewer to show only the layer that has been selected
  3. have 2 happen only with a checkbox selected (which would be on by default)

I think 3 is the best, but 2 or 1 are OK fallbacks.

Batch mode

  1. Show the big red box if none of the selected layers are the currently visible one
  2. Select all the layers and have it start blinking through them
  3. 2 with a checkbox checked, 1 if it's not (off by default)

Same as above, I like them in order of 3,2,1

Additional context

🐱

pllim commented 1 year ago

I think this is a general problem across all plugins because of:

kecnry commented 1 year ago

"Currently visible" isn't the easiest thing to determine in general because of possible layer (semi-)transparencies, but I like the idea of showing a message in cases like this (plugins that take data as input) when the selected entry isn't the top layer in any viewer.

camipacifici commented 1 year ago

I like this too!