glue-viz / glue-vispy-viewers

3-d data viewers for glue based on VisPy
http://glueviz.org/en/stable/whatsnew/experimental_3d.html#experimental-3d
BSD 2-Clause "Simplified" License
25 stars 21 forks source link

Error when loading irregularly sized data cube #272

Closed drdavella closed 6 years ago

drdavella commented 6 years ago

Here's the traceback that I get when attempting to load a somewhat oddly sized data cube. It appears to result from a rounding error that occurs when scaling dimensions that are larger than a certain size:

ValueError: Shape of arrays should be [3840 48 46] instead of (3841, 48, 46)

Traceback (most recent call last):

File "/Users/ddavella/miniconda3/envs/cubeviz/lib/python3.6/site-packages/glue_core-0.12.0.dev3920-py3.6.egg/glue/external/echo/qt/connect.py", line 359, in update_prop

setattr(instance, prop, widget.itemData(idx))

File "/Users/ddavella/miniconda3/envs/cubeviz/lib/python3.6/site-packages/glue_core-0.12.0.dev3920-py3.6.egg/glue/external/echo/core.py", line 253, in setattr

self._notify_global(**{attribute: value})

File "/Users/ddavella/miniconda3/envs/cubeviz/lib/python3.6/site-packages/glue_core-0.12.0.dev3920-py3.6.egg/glue/external/echo/core.py", line 248, in _notify_global

callback(**kwargs)

File "/Users/ddavella/miniconda3/envs/cubeviz/lib/python3.6/site-packages/glue_vispy_viewers/volume/layer_artist.py", line 124, in _update_from_state

self._update_data()

File "/Users/ddavella/miniconda3/envs/cubeviz/lib/python3.6/site-packages/glue_vispy_viewers/volume/layer_artist.py", line 177, in _update_data

self._multivol.set_data(self.id, data)

File "/Users/ddavella/miniconda3/envs/cubeviz/lib/python3.6/site-packages/glue_vispy_viewers/volume/volume_visual.py", line 216, in set_data

self._update_scaled_data(label)

File "/Users/ddavella/miniconda3/envs/cubeviz/lib/python3.6/site-packages/glue_vispy_viewers/volume/volume_visual.py", line 236, in _update_scaled_data

"of {1}".format(self._vol_shape, data.shape))

ValueError: Shape of arrays should be [3840 48 46] instead of (3841, 48, 46)