From 8a4b34c5b41e2e263b03e5344c025cb59cc732eb Mon Sep 17 00:00:00 2001 From: "Pey Lian Lim (Github)" <2090236+pllim@users.noreply.github.com> Date: Thu, 17 Nov 2022 16:52:08 -0500 Subject: [PATCH 1/2] DOC: Clarify centroid subtlety that requires background subtraction. --- docs/imviz/import_data.rst | 9 +++++++++ docs/imviz/plugins.rst | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/docs/imviz/import_data.rst b/docs/imviz/import_data.rst index f3c5a1a811..9fee93b2b7 100644 --- a/docs/imviz/import_data.rst +++ b/docs/imviz/import_data.rst @@ -172,6 +172,15 @@ form ``(region, reason)``: bad_regions = imviz.load_regions_from_file("/path/to/data/myregions.reg", return_bad_regions=True) +You could also define :ref:`regions:shapes` programmatically and load them; e.g.: + +.. code-block:: python + + from regions import CirclePixelRegion, PixCoord + aper_1 = CirclePixelRegion(center=PixCoord(x=42, y=43), radius=4.2) + aper_2 = CirclePixelRegion(center=PixCoord(x=10, y=20), radius=3) + imviz.load_regions([aper_1, aper_2]) + For more details on the API, please see :meth:`~jdaviz.core.helpers.ImageConfigHelper.load_regions_from_file` and :meth:`~jdaviz.core.helpers.ImageConfigHelper.load_regions` methods diff --git a/docs/imviz/plugins.rst b/docs/imviz/plugins.rst index b02b654624..3a44b48517 100644 --- a/docs/imviz/plugins.rst +++ b/docs/imviz/plugins.rst @@ -59,6 +59,14 @@ center-of-mass of the data within the aperture. No background subtraction is performed. Click :guilabel:`Recenter` to change its parameters and move it to the calculated centroid. +.. note:: + + If you want accurate centroid calculations, it is recommended that you + use a background subtracted image. Alternately, you could calculate + the centroid outside of Jdaviz (e.g., using ``photutils``) and then + manually edit the subset (see below) or load your own aperture object + (:ref:`imviz-import-regions-api`). + For a simple subset, you can edit its parameters by changing the values in the corresponding editable text fields. Once you have entered the new value(s), click :guilabel:`Update` to apply. You should see the subset From 5f7a96dbf6e1cae42f96d705e47623ba1b6c1719 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Fri, 18 Nov 2022 08:30:55 -0500 Subject: [PATCH 2/2] Add hyphen Co-authored-by: Larry Bradley --- docs/imviz/plugins.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/imviz/plugins.rst b/docs/imviz/plugins.rst index 3a44b48517..7ed8316bc9 100644 --- a/docs/imviz/plugins.rst +++ b/docs/imviz/plugins.rst @@ -62,7 +62,7 @@ to change its parameters and move it to the calculated centroid. .. note:: If you want accurate centroid calculations, it is recommended that you - use a background subtracted image. Alternately, you could calculate + use a background-subtracted image. Alternately, you could calculate the centroid outside of Jdaviz (e.g., using ``photutils``) and then manually edit the subset (see below) or load your own aperture object (:ref:`imviz-import-regions-api`).