Closed nmearl closed 5 years ago
Spectral smoothing seems broken when using the specviz viewer inside glue:
Traceback (most recent call last):
File "/Users/tom/Projects/Glue/STScI/specviz/specviz/core/plugin.py", line 282, in <lambda>
action.triggered.connect(lambda: func(plugin, *args, **kwargs))
File "/Users/tom/Projects/Glue/STScI/specviz/specviz/plugins/model_editor/continuum_generator.py", line 32, in on_action_triggered
cont_mod = fit_generic_continuum(spec, exclude_regions=exc_regs)
File "/Users/tom/python/dev/lib/python3.7/site-packages/specutils/fitting/continuum.py", line 51, in fit_generic_continuum
spectrum_smoothed = median_smooth(spectrum, median_window)
File "/Users/tom/python/dev/lib/python3.7/site-packages/specutils/manipulation/smoothing.py", line 200, in median_smooth
rest_value=spectrum.rest_value)
File "/Users/tom/python/dev/lib/python3.7/site-packages/specutils/spectra/spectrum1d.py", line 76, in __init__
wcs = WCSWrapper.from_array(spectral_axis)
File "/Users/tom/python/dev/lib/python3.7/site-packages/specutils/wcs/wcs_wrapper.py", line 57, in from_array
spec_frame = cf.SpectralFrame(unit=array.unit, axes_order=(0,))
File "/Users/tom/python/dev/lib/python3.7/site-packages/gwcs/coordinate_frames.py", line 350, in __init__
axis_physical_types=axis_physical_types)
File "/Users/tom/python/dev/lib/python3.7/site-packages/gwcs/coordinate_frames.py", line 97, in __init__
self._axis_physical_types = self._set_axis_physical_types(axis_physical_types)
File "/Users/tom/python/dev/lib/python3.7/site-packages/gwcs/coordinate_frames.py", line 148, in _set_axis_physical_types
validate_physical_types(ph_type)
UnboundLocalError: local variable 'ph_type' referenced before assignment
EDIT: issue report in GWCS - basically due to velocity axis: https://github.com/spacetelescope/gwcs/issues/207
I tried to create a 'Simple Linemap' and ended up with the following exception:
Traceback (most recent call last):
File "/Users/tom/Projects/Glue/STScI/specviz/specviz/third_party/glue/operation_handler.py", line 191, in on_finished
self._layout.add_overlay(data[0, :, :], component_name, display_now=False)
AttributeError: 'NoneType' object has no attribute 'add_overlay'
I'm using specviz inside glue, but not cubeviz.
What dataset are you using?
@nmearl - I'm using a variant of https://astropy.stsci.edu/data/l1448/l1448_13co.fits - let me know if that specific file doesn't reproduce the errors.
My cube doesn't have flux units, and the dialog for changing units looks strange - I'm not sure what the different options are:
Another small issue: the 'Export Plot' button doesn't appear to be working. Sorry for all the separate comments, I'm just posting things as I find them.
Glue refuses to load your data cube? Seems like glue is choking on the wcs, and there are unit mismatches.
Probably not related to this PR, but the zoom is quite sensitive - while trying to zoom in a lot I managed to make the plot become stuck:
I'm not able to zoom back out and I have to close and re-open the viewer.
I'm not able to zoom back out and I have to close and re-open the viewer.
What happens when you click the "reset view" button?
@nmearl - no I'm not having issues loading the cube, these are all issues that occur once I have the dataset inside the specviz viewer in glue (I've tried to describe what I was doing at the start of each comment). Let me know if it'd be more useful to record a screencast.
What happens when you click the "reset view" button?
Yep that fixes it!
When I load your cube, I get multiple errors and warnings:
And the Glue closes without ever opening up fully.