Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Cunning plan not so cunning [ci skip]
Browse files Browse the repository at this point in the history
pllim committed Jul 24, 2022
1 parent 9e20b50 commit 33a8b7e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions jdaviz/configs/imviz/plugins/aper_phot_simple/aper_phot_simple.py
Original file line number Diff line number Diff line change
@@ -140,9 +140,18 @@ def _get_region_from_subset(self, subset):
if subset_grp.label == subset:
for sbst in subset_grp.subsets:
if sbst.data.label == self.dataset_selected:
# TODO: https://github.com/glue-viz/glue-astronomy/issues/52
return sbst.data.get_selection_definition(
subset_id=subset, format='astropy-regions')
reg = sbst.data.get_selection_definition(
subset_id=subset, format='astropy-regions')
# Works around https://github.com/glue-viz/glue-astronomy/issues/52
# Assume it is always pixel region, not sky region.
# FIXME: I thought this was a cunning plan but now I remember this plugin
# is viewer agnostic because of Ori, so I need to think of a viewer
# agnostic way to do this; or just disallow this plugin when WCS linking is detected?
x, y, _ = viewer._get_real_xy(self.app.data_collection[self.dataset_selected],
reg.center.x, reg.center.y)
reg.center.x = x
reg.center.y = y
return reg
else:
raise ValueError(f'Subset "{subset}" not found')

0 comments on commit 33a8b7e

Please sign in to comment.