Skip to content

Commit

Permalink
Skip flux conversion for moment maps (#3158)
Browse files Browse the repository at this point in the history
* Skip flux conversion for moment maps

* More general check on unit physical type
  • Loading branch information
rosteen authored Aug 26, 2024
1 parent a9b559b commit c3d0c81
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion jdaviz/configs/imviz/plugins/coords_info/coords_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,19 @@ def _image_viewer_update(self, viewer, x, y):
dq_value = dq_data[int(round(y)), int(round(x))]
unit = image.get_component(attribute).units
elif isinstance(viewer, (CubevizImageView, RampvizImageView)):
skip_spectral_density_eqv = False
arr = image.get_component(attribute).data
unit = image.get_component(attribute).units
value = self._get_cube_value(
image, arr, x, y, viewer
)
if self.image_unit is not None:

# We don't want to convert for things like moment maps
if str(u.Unit(unit).physical_type) not in ("spectral flux density",
"surface brightness"):
skip_spectral_density_eqv = True

if self.image_unit is not None and not skip_spectral_density_eqv:
if 'PIXAR_SR' in self.app.data_collection[0].meta:
# Need current slice value and associated unit to use to compute
# spectral density equivalencies that enable Flux to Flux conversions.
Expand Down

0 comments on commit c3d0c81

Please sign in to comment.