From ff057af10f52325820ff3260d02bf71d792ed582 Mon Sep 17 00:00:00 2001 From: gac bernina Date: Fri, 5 Jun 2026 19:50:22 +0200 Subject: [PATCH] gic, camera and fixes --- eco/devices_general/cameras_swissfel.py | 4 +-- eco/endstations/bernina_incoupling.py | 4 +++ .../bernina_sample_environments.py | 32 +++++++++++++++++++ eco/timing/timing_diag.py | 8 ++--- 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/eco/devices_general/cameras_swissfel.py b/eco/devices_general/cameras_swissfel.py index 4f83306..5b2044c 100644 --- a/eco/devices_general/cameras_swissfel.py +++ b/eco/devices_general/cameras_swissfel.py @@ -56,7 +56,7 @@ class CamserverConfig2(Assembly): precision=0, check_interval=None, name="_config", - is_setting=False, + is_setting=True, is_display=False, ) @@ -64,7 +64,7 @@ class CamserverConfig2(Assembly): AdjustableObject, self._config, name="config", - is_setting=True, + is_setting=False, is_display="recursive", ) self._append( diff --git a/eco/endstations/bernina_incoupling.py b/eco/endstations/bernina_incoupling.py index 07fad2d..2fec348 100644 --- a/eco/endstations/bernina_incoupling.py +++ b/eco/endstations/bernina_incoupling.py @@ -28,6 +28,10 @@ class Incoupling(Assembly): # self._append( # SmaractRecord, "SARES20-MCS2:MOT_17", name="thz_par1_ry", is_setting=True # ) + self._append( + SmaractRecord, "SARES20-MCS3:MOT_17", name="power_check", is_setting=True + ) + try: self.motor_configuration_thorlabs = { diff --git a/eco/endstations/bernina_sample_environments.py b/eco/endstations/bernina_sample_environments.py index 1f395bc..f6359ef 100644 --- a/eco/endstations/bernina_sample_environments.py +++ b/eco/endstations/bernina_sample_environments.py @@ -1609,6 +1609,21 @@ def get_array_frame(a): return np.concatenate([a[:, 0], a[-1, 1:], a[-2::-1, -1], a[0, -2::-1]]) +class GicCameras(Assembly): + def __init__(self, name=None, camera_config={}): + super().__init__(name=name) + for name, cfg in camera_config.items(): + self._append( + CameraBasler, + cfg["pvname"], + camserver_alias="GIC_" + name, + name=name, + is_setting=True, + is_display="recursive", + ) + self.__dict__[name].serial_no.mv(cfg["serial_number"]) + + class GrazingIncidenceLowTemperatureChamber(Assembly): def __init__(self, xp=None, helium_control_valve=None, name=None): super().__init__(name=name) @@ -1647,6 +1662,23 @@ class GrazingIncidenceLowTemperatureChamber(Assembly): "channel": 14, }, } + self.camera_configuration = { + "inline": { + "pvname": "SARES20-CAMS142-M1", + "serial_number": 40298870, + }, + "sideview": { + "pvname": "SARES20-CAMS142-M2", + "serial_number": 40298884, + }, + } + + self._append( + GicCameras, + name="samplecam", + camera_config=self.camera_configuration, + ) + for name, config in self.motor_configuration.items(): self._append( SmaractRecord, diff --git a/eco/timing/timing_diag.py b/eco/timing/timing_diag.py index a61178b..d8efa52 100644 --- a/eco/timing/timing_diag.py +++ b/eco/timing/timing_diag.py @@ -401,10 +401,10 @@ class TimetoolBerninaUSD(Assembly): fig.tight_layout() plt.show() if to_elog: - fpath = "/home/gac-bernina/tt_calib.jpg" + fpath = f"{Path.home()}/temp/tt_calib.jpg" fig.savefig(fpath, dpi=200) fpath = Path(fpath) - dpath = Path("/home/gac-bernina/tt_calib.pkl") + dpath = Path(f"{Path.home()}/temp/tt_calib.pkl") df = DataFrame({"tt_kb.delay": x, "tt_kb.edge_position_px": y}) df.to_pickle(dpath) if to_elog: @@ -767,10 +767,10 @@ class TimetoolBerninaDSD(Assembly): fig.tight_layout() plt.show() if to_elog: - fpath = "/home/gac-bernina/tt_calib.jpg" + fpath = f"{Path.home()}/temp/tt_calib.jpg" fig.savefig(fpath, dpi=200) fpath = Path(fpath) - dpath = Path("/home/gac-bernina/tt_calib.pkl") + dpath = Path(f"{Path.home()}/temp/tt_calib.pkl") df = DataFrame({"tt_kb.delay": x, "tt_kb.edge_position_px": y}) df.to_pickle(dpath) if to_elog: