Skip to content

Commit

Permalink
Local autocenter test
Browse files Browse the repository at this point in the history
  • Loading branch information
duytnguyendtn committed Jul 20, 2024
1 parent c1f9160 commit 7941aa4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import pytest

from jdaviz.configs.imviz.tests.utils import BaseImviz_WCS_WCS
from jdaviz.configs.default.plugins.virtual_observatory.vo_plugin import vo_plugin_label


# TODO: Update all _obj calls to formal API calls once Plugin API is available
class TestVOImvizLocal(BaseImviz_WCS_WCS):
def test_autocenter_coords(self):
# Create a second viewer and put each data in its own viewer
self.imviz.create_image_viewer()
self.imviz.app.remove_data_from_viewer('imviz-0','has_wcs_2[SCI,1]')
self.imviz.app.add_data_to_viewer('imviz-1','has_wcs_2[SCI,1]')

# Check default viewer is "Manual"
vo_plugin = self.imviz.plugins[vo_plugin_label]._obj
assert vo_plugin.viewer_selected == "Manual"

# Switch to first viewer and verify coordinates have switched
vo_plugin.viewer_selected = "imviz-0"
assert vo_plugin.source == "337.51894336761296 -20.832083054811765"

# Switch to second viewer and verify coordinates
vo_plugin.viewer_selected = "imviz-1"
assert vo_plugin.source == "337.51924057481 -20.83208305686149"


@pytest.mark.remote_data
def test_M32(self):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
)

__all__ = ["VoPlugin"]
vo_plugin_label = "Virtual Observatory"


@tray_registry("VoPlugin", label="Virtual Observatory")
@tray_registry("VoPlugin", label=vo_plugin_label)
class VoPlugin(PluginTemplateMixin, AddResultsMixin, TableMixin):
"""Plugin to query the Virtual Observatory and load data into Imviz"""

Expand Down

0 comments on commit 7941aa4

Please sign in to comment.