Skip to content

Commit

Permalink
ensure specutils has access to custom eqvs and update targ solid angl…
Browse files Browse the repository at this point in the history
…e bug
  • Loading branch information
gibsongreen committed Dec 9, 2024
1 parent 6c946d3 commit b4a2fa2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,9 @@ def _fit_model_to_cube(self, add_data):

sb_unit = self.app._get_display_unit('sb')
if spec.flux.unit != sb_unit:
spec = spec.with_flux_unit(sb_unit)
# ensure specutils has access to jdaviz custom unit equivalencies
equivalencies = all_flux_unit_conversion_equivs()
spec = spec.with_flux_unit(sb_unit, equivalencies=equivalencies)

snackbar_message = SnackbarMessage(
"Fitting model to cube...",
Expand Down
1 change: 1 addition & 0 deletions jdaviz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ def _indirect_conversion(values, orig_units, targ_units, eqv,
elif image_data or (spec_unit and solid_angle_in_spec):
if not solid_angle_in_targ:
targ_units /= solid_angle_in_spec
solid_angle_in_targ = solid_angle_in_spec
if ((u.Unit(targ_units) in indirect_units()) or
(u.Unit(orig_units) in indirect_units())):
# SB -> Flux -> Flux -> SB
Expand Down

0 comments on commit b4a2fa2

Please sign in to comment.