PyMoDAQ / pymodaq_plugins_andor

Set of PyMoDAQ plugins for Andor Camera (CCD camera using SDK2, SCMOS cameras using SDK3...) and spectrometer (Shamrock series)
MIT License
1 stars 8 forks source link

Visualisation issue when switching read mode from 1D to image #6

Open pvalvin opened 5 months ago

pvalvin commented 5 months ago

Dear PymoDAQers

I have prepared a preset for a spectroscopy setup based on a Andor ShamrockCCDComposition. The 3 1D-modes are working fine (FVB, singletrack, multitrack). I can switch from 'FVB' to the 'image' mode. It is still working. I can switch back to FVB or singletrack or multitrack. Still working. But when I switch from 'singletrack' to 'image' or from 'multitrack' to 'image' the viewer disappears and I can't get it back.

The corresponding line in the log fil is :

_2024-03-27 13:23:49,288 - py.warnings - WARNING - C:\repo\PyMoDAQ\src\pymodaq\utils\plotting\data_viewers\viewer.py:313: RuntimeWarning: Cannot close dock <Dock Det 00_Viewer_1 (350, 350)> because it is not open. dock.close() 2024-03-27 13:23:49,290 - pymodaq.pymodaq.daqviewer.Det 00 - ERROR - pop from empty list

And then we have the Traceback. I can add it if needed.

It seems that the problem refers to a file I should not have to touch.

Thanks for your help, Cheers,

Pierre

pvalvin commented 5 months ago

My bad : No bug with an updated version of PyMoDAQ (4.1.13). I was running 4.0.8. I'm closing the issue.

Pierre

pvalvin commented 5 months ago

False joy... Still have the bug. It is difficult to predict when it appears or not. Pierre

seb5g commented 5 months ago

And then we have the Traceback. I can add it if needed.

yes please copy the traceback

pvalvin commented 5 months ago

Here you are 👍

2024-03-27 13:23:49,288 - py.warnings - WARNING - C:\repo\PyMoDAQ\src\pymodaq\utils\plotting\data_viewers\viewer.py:313: RuntimeWarning: Cannot close dock <Dock Det 00_Viewer_1 (350, 350)> because it is not open.   dock.close()

2024-03-27 13:23:49,290 - pymodaq.pymodaq.daq_viewer.Det 00 - ERROR - pop from empty list Traceback (most recent call last):   File "C:\repo\PyMoDAQ\src\pymodaq\control_modules\daq_viewer.py", line 797, in show_data     self._init_show_data(dte)   File "C:\repo\PyMoDAQ\src\pymodaq\control_modules\daq_viewer.py", line 853, in _init_show_data     self.ui.update_viewers(self._viewer_types)   File "C:\repo\PyMoDAQ\src\pymodaq\control_modules\daq_viewer_ui.py", line 246, in update_viewers     super().update_viewers(viewers_type)   File "C:\repo\PyMoDAQ\src\pymodaq\utils\plotting\data_viewers\viewer.py", line 368, in update_viewers     self.remove_viewers(Nviewers_to_leave)   File "C:\repo\PyMoDAQ\src\pymodaq\utils\plotting\data_viewers\viewer.py", line 314, in remove_viewers     self.viewers.pop() IndexError: pop from empty list 2024-03-27 13:23:51,630 - pymodaq.pymodaq.daq_viewer.Det 00 - INFO - Det 00: Snap 2024-03-27 13:23:51,793 - pymodaq.pymodaq.daq_viewer.Det 00 - ERROR - list index out of range Traceback (most recent call last):   File "C:\repo\PyMoDAQ\src\pymodaq\control_modules\daq_viewer.py", line 827, in show_data     self.set_data_to_viewers(data_to_plot.data)   File "C:\repo\PyMoDAQ\src\pymodaq\control_modules\daq_viewer.py", line 870, in set_data_to_viewers     self.viewer_docks[ind].setTitle(self._title + ' ' + data.name)     ~~~~~^^^^^ IndexError: list index out of range 2024-03-27 13:23:54,038 - pymodaq.pymodaq.daq_viewer.Det 00 - INFO - Det 00: Snap 2024-03-27 13:23:54,201 - pymodaq.pymodaq.daq_viewer.Det 00 - ERROR - list index out of range Traceback (most recent call last):   File "C:\repo\PyMoDAQ\src\pymodaq\control_modules\daq_viewer.py", line 827, in show_data     self.set_data_to_viewers(data_to_plot.data)   File "C:\repo\PyMoDAQ\src\pymodaq\control_modules\daq_viewer.py", line 870, in set_data_to_viewers     self.viewer_docks[ind].setTitle(self._title + ' ' + data.name)     ~~~~~^^^^^ IndexError: list index out of range

Bon week end !

pvalvin commented 5 months ago

Hi Sebastien,

I tried again this morning. At my first trial, that was not possible to reproduce a bug. Then I just changed the organisation of the windows. I wanted to have de spectrum viewer on the bottom instead of having it as a vertical pannel on the right. And when I switched from spectrum to image mode, the viewer disappeared. Here is the log again.

(...) 2024-04-04 11:26:49,356 - py.warnings - WARNING - C:\Users\MacroPLUV\anaconda3\envs\pymo4\lib\site-packages\pymodaq\utils\plotting\data_viewers\viewer.py:313: RuntimeWarning: Cannot close dock <Dock Det 00_Viewer_1 (350, 350)> because it is not open. dock.close()

2024-04-04 11:26:49,356 - pymodaq.pymodaq.daq_viewer.Det 00 - ERROR - pop from empty list Traceback (most recent call last): File "C:\Users\MacroPLUV\anaconda3\envs\pymo4\lib\site-packages\pymodaq\control_modules\daq_viewer.py", line 827, in show_data self._init_show_data(data_to_plot) File "C:\Users\MacroPLUV\anaconda3\envs\pymo4\lib\site-packages\pymodaq\control_modules\daq_viewer.py", line 857, in _init_show_data self.ui.update_viewers(self._viewer_types) File "C:\Users\MacroPLUV\anaconda3\envs\pymo4\lib\site-packages\pymodaq\control_modules\daq_viewer_ui.py", line 249, in update_viewers super().update_viewers(viewers_type) File "C:\Users\MacroPLUV\anaconda3\envs\pymo4\lib\site-packages\pymodaq\utils\plotting\data_viewers\viewer.py", line 368, in update_viewers self.remove_viewers(Nviewers_to_leave) File "C:\Users\MacroPLUV\anaconda3\envs\pymo4\lib\site-packages\pymodaq\utils\plotting\data_viewers\viewer.py", line 314, in remove_viewers self.viewers.pop() IndexError: pop from empty list 2024-04-04 11:27:06,426 - pymodaq.pymodaq.daq_viewer.Det 00 - INFO - Det 00: Snap 2024-04-04 11:27:07,523 - py.warnings - WARNING - C:\Users\MacroPLUV\anaconda3\envs\pymo4\lib\site-packages\pymodaq\utils\data.py:1142: DataSizeWarning: The size of the axis is not coherent with the shape of the data. Replacing it with a linspaced version: np.array([0, 1, 2, ...]) warnings.warn(DataSizeWarning('The size of the axis is not coherent with the shape of the data. '

2024-04-04 11:27:07,523 - pymodaq.pymodaq.daq_viewer.Det 00 - ERROR - list index out of range Traceback (most recent call last): File "C:\Users\MacroPLUV\anaconda3\envs\pymo4\lib\site-packages\pymodaq\control_modules\daq_viewer.py", line 828, in show_data self.set_data_to_viewers(data_to_plot) File "C:\Users\MacroPLUV\anaconda3\envs\pymo4\lib\site-packages\pymodaq\control_modules\daq_viewer.py", line 876, in set_data_to_viewers self.viewer_docks[ind].setTitle(self._title + ' ' + dwa.name) IndexError: list index out of range

seb5g commented 5 months ago

It seems the viewer loose the reference of the dock in the process. For the time being, don't move the panels around and I'll come with a patch later