From 73d4d4950acc696df36edeb7cd2e562044259f9c Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 15:34:21 +0000 Subject: [PATCH 1/2] Point the ShamrockSCMOS plugins to the legacy Shamrock actuator and declare them Windows only Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg --- .../plugins_1D/daq_1Dviewer_ShamrockSCMOS.py | 3 ++- .../plugins_1D/daq_1Dviewer_ShamrockSCMOSLegacy.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_1D/daq_1Dviewer_ShamrockSCMOS.py b/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_1D/daq_1Dviewer_ShamrockSCMOS.py index 4d9ec74..7a2c707 100644 --- a/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_1D/daq_1Dviewer_ShamrockSCMOS.py +++ b/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_1D/daq_1Dviewer_ShamrockSCMOS.py @@ -12,7 +12,7 @@ from pymodaq_plugins_andor.daq_viewer_plugins.plugins_2D.daq_2Dviewer_AndorSCMOS import DAQ_2DViewer_AndorSCMOS -from pymodaq_plugins_andor.daq_move_plugins.daq_move_Shamrock import DAQ_Move_Shamrock +from pymodaq_plugins_andor.legacy.daq_move_Shamrock import DAQ_Move_Shamrock logger = set_logger(get_module_name(__file__)) @@ -27,6 +27,7 @@ class DAQ_1DViewer_ShamrockSCMOS(DAQ_2DViewer_AndorSCMOS): -------- utility_classes.DAQ_Viewer_base """ + supported_platforms = ('win32',) # the Shamrock SDK is loaded with ctypes.windll param_camera = DAQ_2DViewer_AndorSCMOS.params params_shamrock = DAQ_Move_Shamrock.params putils.get_param_dict_from_name(params_shamrock, 'andor_lib', pop=True) diff --git a/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_1D/daq_1Dviewer_ShamrockSCMOSLegacy.py b/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_1D/daq_1Dviewer_ShamrockSCMOSLegacy.py index bd6b5c1..9b9f2c5 100644 --- a/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_1D/daq_1Dviewer_ShamrockSCMOSLegacy.py +++ b/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_1D/daq_1Dviewer_ShamrockSCMOSLegacy.py @@ -12,7 +12,7 @@ from pymodaq.utils.data import Axis, DataFromPlugins from ..plugins_2D.daq_2Dviewer_AndorSCMOS import DAQ_2DViewer_AndorSCMOS -from ...daq_move_plugins.daq_move_Shamrock import DAQ_Move_Shamrock +from pymodaq_plugins_andor.legacy.daq_move_Shamrock import DAQ_Move_Shamrock logger = set_logger(get_module_name(__file__)) @@ -27,6 +27,7 @@ class DAQ_1DViewer_ShamrockSCMOSLegacy(DAQ_2DViewer_AndorSCMOS, DAQ_Move_Shamroc -------- utility_classes.DAQ_Viewer_base """ + supported_platforms = ('win32',) # the Shamrock SDK is loaded with ctypes.windll param_camera = DAQ_2DViewer_AndorSCMOS.params params_shamrock = DAQ_Move_Shamrock.params From af12dfaf017919af3c48dad486636b5a24a167b6 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 15:39:01 +0000 Subject: [PATCH 2/2] Use the pylablib Shamrock actuator in the ShamrockSCMOS composite plugin Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg --- .../plugins_1D/daq_1Dviewer_ShamrockSCMOS.py | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_1D/daq_1Dviewer_ShamrockSCMOS.py b/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_1D/daq_1Dviewer_ShamrockSCMOS.py index 7a2c707..1aac178 100644 --- a/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_1D/daq_1Dviewer_ShamrockSCMOS.py +++ b/src/pymodaq_plugins_andor/daq_viewer_plugins/plugins_1D/daq_1Dviewer_ShamrockSCMOS.py @@ -12,7 +12,7 @@ from pymodaq_plugins_andor.daq_viewer_plugins.plugins_2D.daq_2Dviewer_AndorSCMOS import DAQ_2DViewer_AndorSCMOS -from pymodaq_plugins_andor.legacy.daq_move_Shamrock import DAQ_Move_Shamrock +from pymodaq_plugins_andor.daq_move_plugins.daq_move_ShamrockPll import DAQ_Move_ShamrockPll logger = set_logger(get_module_name(__file__)) @@ -27,10 +27,9 @@ class DAQ_1DViewer_ShamrockSCMOS(DAQ_2DViewer_AndorSCMOS): -------- utility_classes.DAQ_Viewer_base """ - supported_platforms = ('win32',) # the Shamrock SDK is loaded with ctypes.windll + supported_platforms = ('win32',) # the Andor SDK3 is loaded with ctypes.windll param_camera = DAQ_2DViewer_AndorSCMOS.params - params_shamrock = DAQ_Move_Shamrock.params - putils.get_param_dict_from_name(params_shamrock, 'andor_lib', pop=True) + params_shamrock = DAQ_Move_ShamrockPll.params d = putils.get_param_dict_from_name(params_shamrock, 'spectro_wl') if d is not None: @@ -47,7 +46,7 @@ class DAQ_1DViewer_ShamrockSCMOS(DAQ_2DViewer_AndorSCMOS): def ini_attributes(self): self.controller: DAQ_2DViewer_AndorSCMOS = None - self.shamrock_controller: DAQ_Move_Shamrock = None + self.shamrock_controller: DAQ_Move_ShamrockPll = None self.x_axis: Axis = None self.is_calibrated = False @@ -82,10 +81,11 @@ def ini_detector(self, controller=None): cam_status, cam_init = super().ini_detector(controller) QtWidgets.QApplication.processEvents() - self.shamrock_controller = DAQ_Move_Shamrock(None, self.settings.child('sham_settings').saveState()) + self.shamrock_controller = DAQ_Move_ShamrockPll(None, self.settings.child('sham_settings').saveState()) self.shamrock_controller.settings = self.settings.child('sham_settings') + self.settings.child('sham_settings', 'controller').hide() self.shamrock_controller.emit_status = self.emit_status - sham_status, sham_init = self.shamrock_controller.ini_stage(controller) + sham_status, sham_init = self.shamrock_controller.ini_stage() QtWidgets.QApplication.processEvents() @@ -98,21 +98,19 @@ def ini_detector(self, controller=None): def setCalibration(self): #setNpixels width, height = self.get_pixel_size() - err = self.shamrock_controller.controller.SetNumberPixelsSR(0, self.get_ROI_size_x()) - err = self.shamrock_controller.controller.SetPixelWidthSR(0, width) + self.shamrock_controller.controller.set_number_pixels(self.get_ROI_size_x()) + self.shamrock_controller.controller.set_pixel_width(width) - self.shamrock_controller.get_wavelength() + self.settings.child('sham_settings', 'spectro_settings', + 'spectro_wl').setValue(self.shamrock_controller.controller.get_wavelength() * 1e9) self.x_axis = self.get_xaxis() def getCalibration(self): if self.shamrock_controller is not None and self.shamrock_controller.controller is not None: - (err, calib) = self.shamrock_controller.controller.GetCalibrationSR(0, self.get_ROI_size_x()) - if err != "SHAMROCK_SUCCESS": - raise Exception(err) - - calib = np.array(calib) + self.shamrock_controller.controller.set_number_pixels(self.get_ROI_size_x()) # the ROI may have changed + calib = np.array(self.shamrock_controller.controller.get_calibration()) * 1e9 # m to nm else: raise(Exception('controller not defined')) self.is_calibrated = True @@ -159,7 +157,7 @@ def stop(self): if self.controller is not None: super().stop() if self.shamrock_controller is not None: - self.shamrock_controller.stop() + self.shamrock_controller.stop_motion() def close(self): self.stop()