Skip to content

Commit

Permalink
final review comments from kyle
Browse files Browse the repository at this point in the history
  • Loading branch information
cshanahan1 committed Sep 19, 2024
1 parent c5894d1 commit 6319b05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jdaviz/configs/cubeviz/plugins/moment_maps/moment_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,16 @@ def calculate_moment(self, add_data=True):
# moment for using converted units.
if n_moment == 0:
# get display units for moment 0 based on unit conversion plugin selection
# the 0th item of this dictionary is the surface brightness unit, kept
# up to date with choices from the UC plugin
moment_0_display_unit = self.output_unit_items[0]['unit_str']

# convert unit string to Unit so moment map data can be converted
# `display_unit` is the data unit (surface brighntess) translated
# to the choice of selected flux and angle unit from the UC plugin.
display_unit = u.Unit(moment_0_display_unit)

moment_new_unit = display_unit * self.spectrum_viewer.state.x_display_unit # noqa: E501
moment_new_unit = display_unit * self.app._get_display_unit('spectral') # noqa: E501

self.moment = self.moment.to(moment_new_unit)

Expand Down

0 comments on commit 6319b05

Please sign in to comment.