gic, camera and fixes

This commit is contained in:
gac bernina
2026-06-05 19:50:22 +02:00
parent 1aa2afe35a
commit ff057af10f
4 changed files with 42 additions and 6 deletions
+2 -2
View File
@@ -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(
+4
View File
@@ -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 = {
@@ -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,
+4 -4
View File
@@ -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: