Skip to content

Commit

Permalink
Uncommented code needed for uncert viewer to change slice
Browse files Browse the repository at this point in the history
  • Loading branch information
javerbukh committed Apr 9, 2024
1 parent 25bd285 commit a03ba2b
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions jdaviz/configs/cubeviz/plugins/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,18 @@ def slice_values(self):
to_value(display_spectral_units,
equivalencies=u.spectral()),
dtype=float))
# TODO: remove if unneeded
# elif 'Wave' in layer.layer.data.world_component_ids:
# if display_spectral_units == '':
# display_spectral_units = layer.layer.data.get_component('Wave').units
# # Special if statement for handling cubes without 'Wavelength' in
# # world_component_ids
# uncert_units = layer.layer.data.get_component('Wave').units
# # uncert_data = layer.layer.data.get_component('Wave').data.ravel()
# uncert_data = layer.layer.data.get_component('Wave').data[0][0]
# converted_axis = (np.asarray((uncert_data * u.Unit(uncert_units)).
# to_value(display_spectral_units,
# equivalencies=u.spectral()),
# dtype=float))
elif 'Wave' in layer.layer.data.world_component_ids:
if display_spectral_units == '':
display_spectral_units = layer.layer.data.get_component('Wave').units
# Special if statement for handling cubes without 'Wavelength' in
# world_component_ids
uncert_units = layer.layer.data.get_component('Wave').units
# uncert_data = layer.layer.data.get_component('Wave').data.ravel()
uncert_data = layer.layer.data.get_component('Wave').data[0][0]
converted_axis = (np.asarray((uncert_data * u.Unit(uncert_units)).
to_value(display_spectral_units,
equivalencies=u.spectral()),
dtype=float))
else:
data_obj = layer.layer.data.get_component(self.slice_component_label).data
converted_axis = np.asarray(data_obj.take(0, take_inds[0]).take(0, take_inds[1]), # noqa
Expand Down

0 comments on commit a03ba2b

Please sign in to comment.