From 86603a35f013c8ff4bf37e862d579211a74ade46 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Thu, 19 Dec 2024 17:46:32 -0500 Subject: [PATCH 1/3] BUG: Also check for inf in spaxel tool when setting new Y limits --- jdaviz/configs/cubeviz/plugins/tools.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jdaviz/configs/cubeviz/plugins/tools.py b/jdaviz/configs/cubeviz/plugins/tools.py index d49660ba9c..ec77106dda 100644 --- a/jdaviz/configs/cubeviz/plugins/tools.py +++ b/jdaviz/configs/cubeviz/plugins/tools.py @@ -172,5 +172,8 @@ def _mouse_move_worker(self, x, y): self.viewer.start_stream() self.viewer.update_sonified_cube(x, y) - self._profile_viewer.set_limits( - y_min=np.nanmin(y_values) * 0.8, y_max=np.nanmax(y_values) * 1.2) + # Data might have inf too. + new_ymin = np.nanmin(y_values) + new_ymax = np.nanmax(y_values) + if np.all(np.isfinite([new_ymin, new_ymax])): + self._profile_viewer.set_limits(y_min=new_ymin * 0.8, y_max=new_ymax * 1.2) From 7b3b9c985231a6f2370d512cb9904e06294aea82 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Tue, 24 Dec 2024 11:52:50 -0500 Subject: [PATCH 2/3] Add change log --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 1bb87ddd0c..004db01f16 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -43,6 +43,8 @@ Bug Fixes Cubeviz ^^^^^^^ +- Fixed copious warnings from spaxel tool when data has INF. [#3368] + Imviz ^^^^^ From 38ae73e5bb0760e1169d374bcdc24415fec21905 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Fri, 27 Dec 2024 20:07:13 -0500 Subject: [PATCH 3/3] BUG: Avoid INF in MANGA IVAR uncert --- jdaviz/configs/cubeviz/plugins/parsers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jdaviz/configs/cubeviz/plugins/parsers.py b/jdaviz/configs/cubeviz/plugins/parsers.py index 715df19f4d..017cde1264 100644 --- a/jdaviz/configs/cubeviz/plugins/parsers.py +++ b/jdaviz/configs/cubeviz/plugins/parsers.py @@ -456,6 +456,7 @@ def _parse_spectrum1d_3d(app, file_obj, data_label=None, flux = val << u.dimensionless_unscaled # DQ flags have no unit elif attr == "uncertainty": flux = val.represent_as(StdDevUncertainty).quantity + flux[np.isinf(flux)] = np.nan # Avoid INF from IVAR conversion else: flux = val