Skip to content

Commit

Permalink
Use truecircle tool
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim committed Sep 6, 2023
1 parent acf85f2 commit 1f2f3d2
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion jdaviz/configs/cubeviz/plugins/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CubevizImageView(JdavizViewerMixin, BqplotImageView):
['jdaviz:homezoom', 'jdaviz:prevzoom'],
['jdaviz:pixelboxzoommatch', 'jdaviz:boxzoom',
'jdaviz:pixelpanzoommatch', 'jdaviz:panzoom'],
['bqplot:circle', 'bqplot:rectangle', 'bqplot:ellipse'],
['bqplot:truecircle', 'bqplot:rectangle', 'bqplot:ellipse'],
['jdaviz:spectrumperspaxel'],
['jdaviz:sidebar_plot', 'jdaviz:sidebar_export']
]
Expand Down
2 changes: 1 addition & 1 deletion jdaviz/configs/imviz/plugins/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ImvizImageView(JdavizViewerMixin, BqplotImageView, AstrowidgetsImageViewer
['jdaviz:homezoom', 'jdaviz:prevzoom'],
['jdaviz:boxzoommatch', 'jdaviz:boxzoom'],
['jdaviz:panzoommatch', 'jdaviz:imagepanzoom'],
['bqplot:circle', 'bqplot:rectangle', 'bqplot:ellipse', 'bqplot:circannulus',
['bqplot:truecircle', 'bqplot:rectangle', 'bqplot:ellipse', 'bqplot:circannulus',
'jdaviz:singlepixelregion'],
['jdaviz:blinkonce', 'jdaviz:contrastbias'],
['jdaviz:sidebar_plot', 'jdaviz:sidebar_export', 'jdaviz:sidebar_compass']
Expand Down
2 changes: 1 addition & 1 deletion jdaviz/configs/imviz/tests/test_linking.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def test_wcslink_affine_with_extras(self):
self.viewer.cuts = (0, 100)

# Add subsets, both interactive and static.
self.imviz._apply_interactive_region('bqplot:circle', (1.5, 2.5), (3.6, 4.6))
self.imviz._apply_interactive_region('bqplot:truecircle', (1.5, 2.5), (3.6, 4.6))
self.imviz.load_regions([CirclePixelRegion(center=PixCoord(x=6, y=2), radius=5),
PolygonPixelRegion(vertices=PixCoord(x=[1, 2, 2], y=[1, 1, 2])),
PolygonPixelRegion(vertices=PixCoord(x=[2, 3, 3], y=[2, 2, 3]))])
Expand Down
2 changes: 1 addition & 1 deletion jdaviz/configs/imviz/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def test_parse_jwst_nircam_level2(self, imviz_helper):
# --- Since download is expensive, we attach GWCS-specific tests here. ---

# Ensure interactive region supports GWCS. Also see test_regions.py
imviz_helper._apply_interactive_region('bqplot:circle',
imviz_helper._apply_interactive_region('bqplot:truecircle',
(965, 1122),
(976.9, 1110.1)) # Star
imviz_helper._apply_interactive_region('bqplot:rectangle',
Expand Down
6 changes: 3 additions & 3 deletions jdaviz/configs/imviz/tests/test_regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_regions_pixel(self):

def test_regions_sky_has_wcs(self):
# Mimic interactive region (before)
self.imviz._apply_interactive_region('bqplot:circle', (1.5, 2.5), (3.6, 4.6))
self.imviz._apply_interactive_region('bqplot:truecircle', (1.5, 2.5), (3.6, 4.6))

sky = SkyCoord(ra=337.5202808, dec=-20.833333059999998, unit='deg')
# These will become indistinguishable from normal Subset.
Expand Down Expand Up @@ -234,9 +234,9 @@ def test_ds9_load_one_good_one_bad(self, imviz_helper):
class TestGetInteractiveRegions(BaseImviz_WCS_NoWCS):
def test_annulus(self):
# Outer circle
self.imviz._apply_interactive_region('bqplot:circle', (0, 0), (9, 9))
self.imviz._apply_interactive_region('bqplot:truecircle', (0, 0), (9, 9))
# Inner circle
self.imviz._apply_interactive_region('bqplot:circle', (2, 2), (7, 7))
self.imviz._apply_interactive_region('bqplot:truecircle', (2, 2), (7, 7))

# At this point, there should be two normal circles.
subsets = self.imviz.get_interactive_regions()
Expand Down
6 changes: 3 additions & 3 deletions jdaviz/configs/imviz/tests/test_simple_aper_phot.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class TestSimpleAperPhot(BaseImviz_WCS_WCS):
def test_plugin_wcs_dithered(self):
self.imviz.link_data(link_type='wcs') # They are dithered by 1 pixel on X
self.imviz._apply_interactive_region('bqplot:circle', (0, 0), (9, 9)) # Draw a circle
self.imviz._apply_interactive_region('bqplot:truecircle', (0, 0), (9, 9)) # Draw a circle

phot_plugin = self.imviz.app.get_tray_item_from_name('imviz-aper-phot-simple')

Expand Down Expand Up @@ -171,7 +171,7 @@ def test_plugin_wcs_dithered(self):
class TestSimpleAperPhot_NoWCS(BaseImviz_WCS_NoWCS):
def test_plugin_no_wcs(self):
# Most things already tested above, so not re-tested here.
self.imviz._apply_interactive_region('bqplot:circle', (0, 0), (9, 9)) # Draw a circle
self.imviz._apply_interactive_region('bqplot:truecircle', (0, 0), (9, 9)) # Draw a circle
phot_plugin = self.imviz.app.get_tray_item_from_name('imviz-aper-phot-simple')

phot_plugin.dataset_selected = 'has_wcs[SCI,1]'
Expand Down Expand Up @@ -277,7 +277,7 @@ def test_annulus_background(imviz_helper):

# Mark an object of interest
# CirclePixelRegion(center=PixCoord(x=150, y=25), radius=7)
imviz_helper._apply_interactive_region('bqplot:circle', (143, 18), (157, 32))
imviz_helper._apply_interactive_region('bqplot:truecircle', (143, 18), (157, 32))

# Load annulus (this used to be part of the plugin but no longer)
annulus_1 = CircleAnnulusPixelRegion(
Expand Down
2 changes: 1 addition & 1 deletion jdaviz/tests/test_subsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_region_from_subset_3d(cubeviz_helper):
# Circular Subset
flux_viewer = cubeviz_helper.app.get_viewer("flux-viewer")
# We set the active tool here to trigger a reset of the Subset state to "Create New"
flux_viewer.toolbar.active_tool = flux_viewer.toolbar.tools['bqplot:circle']
flux_viewer.toolbar.active_tool = flux_viewer.toolbar.tools['bqplot:truecircle']
cubeviz_helper.app.get_viewer('flux-viewer').apply_roi(CircularROI(xc=3, yc=4, radius=2.4))
assert subset_plugin.subset_selected == "Subset 2"
assert subset_plugin.subset_types == ["CircularROI"]
Expand Down

0 comments on commit 1f2f3d2

Please sign in to comment.