Skip to content

Commit

Permalink
BUG: Also check for inf in spaxel tool (#3368)
Browse files Browse the repository at this point in the history
* BUG: Also check for inf in spaxel tool
when setting new Y limits

* Add change log

* BUG: Avoid INF in MANGA IVAR uncert
  • Loading branch information
pllim authored Dec 30, 2024
1 parent 6135293 commit a8b3e03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Bug Fixes
Cubeviz
^^^^^^^

- Fixed copious warnings from spaxel tool when data has INF. [#3368]

Imviz
^^^^^

Expand Down
1 change: 1 addition & 0 deletions jdaviz/configs/cubeviz/plugins/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions jdaviz/configs/cubeviz/plugins/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit a8b3e03

Please sign in to comment.