jdaviz icon indicating copy to clipboard operation
jdaviz copied to clipboard

get_subsets doesn't return sky_region for composite subset created with 'remove'[BUG]

Open cshanahan1 opened this issue 2 years ago • 2 comments

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.

Screen Shot 2023-11-17 at 1 05 45 PM

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.

cshanahan1 avatar Nov 17 '23 18:11 cshanahan1

Sounds like whatever logic was added in https://github.com/spacetelescope/jdaviz/pull/2496 missed this combo?

pllim avatar Nov 17 '23 20:11 pllim

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

pllim avatar Nov 17 '23 20:11 pllim