Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #340 from nmearl/master
Browse files Browse the repository at this point in the history
Fix glue viewer
  • Loading branch information
nmearl committed Nov 14, 2017
2 parents 80788f2 + c42b995 commit fcd7181
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions specviz/third_party/glue/data_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,16 @@ def register_to_hub(self, hub):
handler=self._update_data)

def _spectrum_from_component(self, layer, component, wcs, mask=None):
data = SpectralCube(component.masked_data, wcs)
data = SpectralCube(component.data, wcs)

if mask is not None:
data = data.with_mask(mask)

spec_data = data.sum((1, 2))

spec_data = Spectrum1DRef(spec_data.masked_data,
spec_data = Spectrum1DRef(spec_data.data,
unit=spec_data.unit,
dispersion=data.spectral_axis.masked_data,
dispersion=data.spectral_axis.data,
dispersion_unit=data.spectral_axis.unit,
wcs=data.wcs)

Expand Down Expand Up @@ -190,12 +190,12 @@ def _update_subset(self, message):
return

subset = self._layer_widget.layer
cid = subset.masked_data.id[self._options_widget.file_att]
cid = subset.data.id[self._options_widget.file_att]
mask = subset.to_mask()
component = subset.masked_data.get_component(cid)
component = subset.data.get_component(cid)

self._spectrum_from_component(subset, component,
subset.masked_data.coords.wcs, mask=mask)
subset.data.coords.wcs, mask=mask)

def _remove_subset(self, message):
if message.subset in self._layer_widget:
Expand Down

0 comments on commit fcd7181

Please sign in to comment.