diff --git a/docs/imviz/plugins.rst b/docs/imviz/plugins.rst index 4d5d1b249d..5d7118deb2 100644 --- a/docs/imviz/plugins.rst +++ b/docs/imviz/plugins.rst @@ -329,6 +329,15 @@ position angle, offsets, etc). To import a file, choose "From File..." from the presets dropdown and select a valid file (must be able to be parsed by `regions.Regions.read`). +To import a regions file or object from the API: + +.. code-block:: python + + fp = imviz.plugins['Footprints'] + fp.open_in_tray() + fp.add_overlay('my imported overlay') # or fp.rename_overlay to rename an existing entry + fp.import_region(region) + .. _rotate-canvas: diff --git a/docs/reference/api_plugins.rst b/docs/reference/api_plugins.rst index 85c87cb271..ff16486760 100644 --- a/docs/reference/api_plugins.rst +++ b/docs/reference/api_plugins.rst @@ -57,6 +57,9 @@ Plugins API .. automodapi:: jdaviz.configs.imviz.plugins.coords_info.coords_info :no-inheritance-diagram: +.. automodapi:: jdaviz.configs.imviz.plugins.footprints.footprints + :no-inheritance-diagram: + .. automodapi:: jdaviz.configs.imviz.plugins.image_viewer_creator.image_viewer_creator :no-inheritance-diagram: diff --git a/jdaviz/configs/imviz/plugins/footprints/footprints.py b/jdaviz/configs/imviz/plugins/footprints/footprints.py index 29bf25236d..8ec2a74b9a 100644 --- a/jdaviz/configs/imviz/plugins/footprints/footprints.py +++ b/jdaviz/configs/imviz/plugins/footprints/footprints.py @@ -32,11 +32,11 @@ class Footprints(PluginTemplateMixin, ViewerSelectMixin, HasFileImportSelect): * :meth:`~jdaviz.core.template_mixin.PluginTemplateMixin.open_in_tray` * ``overlay`` (:class:`~jdaviz.core.template_mixin.EditableSelectPluginComponent`): the currently active overlay (all other traitlets control this overlay instance) - * :meth:``rename_overlay`` + * :meth:`rename_overlay` rename any overlay - * :meth:``add_overlay`` + * :meth:`add_overlay` add a new overlay instance (and select as active) - * :meth:``remove_overlay`` + * :meth:`remove_overlay` remove any overlay * ``viewer`` (:class:`~jdaviz.core.template_mixin.ViewerSelect`): viewer(s) to show the current overlay @@ -48,8 +48,8 @@ class Footprints(PluginTemplateMixin, ViewerSelectMixin, HasFileImportSelect): opacity of the filled region of the currently selected overlay * ``preset`` (:class:`~jdaviz.core.template_mixin.SelectPluginComponent`): selected overlay preset - * :meth:``import_region`` - * :meth:``center_on_viewer`` + * :meth:`import_region` + * :meth:`center_on_viewer` * ``ra`` central right ascension for the footprint overlay * ``dec`` @@ -63,7 +63,7 @@ class Footprints(PluginTemplateMixin, ViewerSelectMixin, HasFileImportSelect): * ``v3_offset`` Additional V3 offset in telescope coordinates to apply to instrument center, as from a dither pattern. - * :meth:``overlay_regions`` + * :meth:`overlay_regions` """ template_file = __file__, "footprints.vue" uses_active_status = Bool(True).tag(sync=True)