Skip to content

Commit

Permalink
resolve failing tests and spectral extraction issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gibsongreen committed Aug 16, 2024
1 parent ea76c26 commit d3ec377
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion jdaviz/configs/imviz/plugins/coords_info/coords_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,11 @@ def _image_viewer_update(self, viewer, x, y):
value = flux_conversion(value, unit, self.image_unit,
eqv=_eqv_pixar_sr(self.app.data_collection[0].meta['PIXAR_SR']), # noqa: E501
slice=slice)
unit = self.image_unit

elif self.image_unit.is_equivalent(unit):
value = (value * u.Unit(unit)).to_value(u.Unit(self.image_unit))
unit = self.image_unit
unit = self.image_unit

if associated_dq_layers is not None:
associated_dq_layer = associated_dq_layers[0]
Expand Down
4 changes: 3 additions & 1 deletion jdaviz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,9 @@ def flux_conversion(values, original_units, target_units, spec=None, eqv=None, s
eqv=eqv, spec_unit=spec_unit
)

if len(result) == 2:
if result and len(result) == 2:
values, updated_units = result
orig_units = updated_units

Check warning on line 394 in jdaviz/utils.py

View check run for this annotation

Codecov / codecov/patch

jdaviz/utils.py#L393-L394

Added lines #L393 - L394 were not covered by tests
else:
values, updated_units, selected_unit_updated = result
if selected_unit_updated == 'targ':
Expand Down Expand Up @@ -440,6 +441,7 @@ def _indirect_conversion(values, orig_units, targ_units, eqv,
values = (values * temp_orig).to_value(temp_targ, equivalencies=eqv)
# Lastly a Flux to Surface Brightness translation in the return statement
orig_units = temp_targ

return values, orig_units

return values, orig_units
Expand Down

0 comments on commit d3ec377

Please sign in to comment.