Skip to content

Commit

Permalink
avoid unit-conversion error in cubeviz tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Apr 5, 2023
1 parent 375230b commit d3c60ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jdaviz/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,12 @@ def _handle_display_units(data, use_display_units):
if use_display_units:
if isinstance(data, Spectrum1D):
spectral_unit = self.app._get_display_unit('spectral')
if self.app.config == 'cubeviz' and spectral_unit == 'deg':
# this happens before the correct axis is set for the spectrum-viewer
# and would result in a unit-conversion error if attempting to convert
# to the display units. This should only ever be temporary during
# app intialization.
return data
flux_unit = self.app._get_display_unit('flux')
# TODO: any other attributes (meta, wcs, etc)?
# TODO: implement uncertainty.to upstream
Expand Down

0 comments on commit d3c60ba

Please sign in to comment.