Skip to content

Commit

Permalink
DOC: Footprints plugin API docs (#2426)
Browse files Browse the repository at this point in the history
* build footprints API docs

* add code snippet in plugin docs

* fix syntax in API docs

---------

Co-authored-by: P. L. Lim <[email protected]>
  • Loading branch information
kecnry and pllim authored Sep 6, 2023
1 parent 994fc68 commit acf85f2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
9 changes: 9 additions & 0 deletions docs/imviz/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/api_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
12 changes: 6 additions & 6 deletions jdaviz/configs/imviz/plugins/footprints/footprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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``
Expand All @@ -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)
Expand Down

0 comments on commit acf85f2

Please sign in to comment.