Skip to content

Commit

Permalink
BUG: Also check for inf in spaxel tool
Browse files Browse the repository at this point in the history
when setting new Y limits
  • Loading branch information
pllim committed Dec 24, 2024
1 parent 48be154 commit 86603a3
Showing 1 changed file with 5 additions and 2 deletions.
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 86603a3

Please sign in to comment.