spacetelescope / specviz

An interactive astronomical 1D spectra analysis tool.
http://specviz.readthedocs.io
BSD 3-Clause "New" or "Revised" License
43 stars 31 forks source link

Changing units via the third party plugin causes exception #683

Closed brechmos-stsci closed 5 years ago

brechmos-stsci commented 5 years ago

I loaded the manga data into cubeviz, changed the units to micrometer (from the value of meter that from when it was loaded). Then switched back to meter and got the following exception:

Traceback (most recent call last):
  File "/opt/miniconda3/envs/cubeviz-v0.3b1/lib/python3.6/site-packages/cubeviz/tools/wavelengths_ui.py", line 98, in _calculate_callback
    self.do_calculation(wavelength_redshift=redshift, wavelength_units=units)                                               
  File "/opt/miniconda3/envs/cubeviz-v0.3b1/lib/python3.6/site-packages/cubeviz/tools/wavelengths_ui.py", line 70, in do_calculation
    self.wavelength_controller.update_units(wavelength_units)
  File "/opt/miniconda3/envs/cubeviz-v0.3b1/lib/python3.6/site-packages/cubeviz/controls/wavelengths.py", line 84, in update_units
    self._send_wavelength_unit_message(units)
  File "/opt/miniconda3/envs/cubeviz-v0.3b1/lib/python3.6/site-packages/cubeviz/controls/wavelengths.py", line 113, in _send_wavelength_unit_message
    self._hub.broadcast(msg)
  File "/opt/miniconda3/envs/cubeviz-v0.3b1/lib/python3.6/site-packages/glue/core/hub.py", line 217, in broadcast           
    handler(message)
  File "/opt/miniconda3/envs/cubeviz-v0.3b1/lib/python3.6/site-packages/cubeviz/image_viewer.py", line 245, in <lambda>     
    handler=lambda msg: self.cubeviz_layout.specviz._widget.update_units(spectral_axis_unit=msg.units))                     
  File "/opt/miniconda3/envs/cubeviz-v0.3b1/lib/python3.6/site-packages/specviz/third_party/glue/viewer.py", line 452, in update_units
    self.hub.plot_widget.spectral_axis_unit = spectral_axis_unit                                                            
  File "/opt/miniconda3/envs/cubeviz-v0.3b1/lib/python3.6/site-packages/specviz/widgets/plotting.py", line 304, in spectral_axis_unit
    plot_data_item.spectral_axis_unit = value
  File "/opt/miniconda3/envs/cubeviz-v0.3b1/lib/python3.6/site-packages/specviz/core/items.py", line 271, in spectral_axis_unit
    self.spectral_axis_unit_changed.emit(self._spectral_axis_unit)                                                          
TypeError: PlotDataItem.spectral_axis_unit_changed[str].emit(): argument 1 has unexpected type 'IrreducibleUnit'