jdaviz
jdaviz copied to clipboard
get_subsets doesn't return sky_region for composite subset created with 'remove'[BUG]
Jdaviz component
Imviz
Description
I noticed this issue when working on https://github.com/bmorris3/jdaviz/pull/19, which displays sky coordinates and allows editing in sky coordinates when WCS linked. If you create a composite subset with the 'remove' mode, the 'remove' sub-subset does not have a parent.coords so it doesn't have a WCS, and get_subsets(include_sky_region=True) returns None for sky_region. This creates issues when you're trying to display editable sky coordinates for that subset in the subset_plugin in my PR.
How to Reproduce
Create a composite subset using 'remove' mode on a dataset with a valid WCS (e.g imviz example notebook), run app.get_subsets(include_sky_region=True), and you will see that for the 'remove' component there is no WCS.
Sounds like whatever logic was added in https://github.com/spacetelescope/jdaviz/pull/2496 missed this combo?
It might have entered this block and there is no sky conversion done here?
https://github.com/spacetelescope/jdaviz/blob/ac3078a99fc76f022d15c924d09bf7862a537b42/jdaviz/app.py#L1174-L1178