Skip to content

Commit

Permalink
display units for flux cubes
Browse files Browse the repository at this point in the history
  • Loading branch information
cshanahan1 committed Aug 9, 2024
1 parent 42d5bae commit cd67777
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion jdaviz/configs/imviz/plugins/coords_info/coords_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def _on_viewer_added(self, msg):
self._create_viewer_callbacks(self.app.get_viewer_by_id(msg.viewer_id))

def _on_global_display_unit_changed(self, msg):
# eventually should observe change in flux OR angle
if msg.axis == "sb":
self.image_unit = u.Unit(msg.unit)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,15 @@ def _on_glue_y_display_unit_changed(self, y_unit_str):
self.flux_unit.selected,
self.angle_unit.selected
)
self.hub.broadcast(GlobalDisplayUnitChanged("sb", self.sb_unit_selected, sender=self))

# if SB is per pixel, mouseover info (which is the only thing listening
# to 'sb' currently), should display just the flux unit and drop the / pix
if self.angle_unit.selected == 'pix':
mouseover_unit = self.flux_unit.selected
else:
mouseover_unit = self.sb_unit_selected

self.hub.broadcast(GlobalDisplayUnitChanged("sb", mouseover_unit, sender=self))

else:
# if cube was loaded in flux units, we still need to broadcast
Expand Down

0 comments on commit cd67777

Please sign in to comment.