This commit is contained in:
2023-12-10 13:54:05 +01:00
parent 941b8f0b07
commit 07df2011fb
5 changed files with 129 additions and 18 deletions
+24 -9
View File
@@ -826,13 +826,13 @@ namespace.append_obj(
module_name="eco.devices_general.wago",
)
namespace.append_obj(
"AnalogInput",
"SARES20-CWAG-GPS01:ADC08",
lazy=True,
name="oxygen_sensor",
module_name="eco.devices_general.wago",
)
# namespace.append_obj(
# "AnalogInput",
# "SARES20-CWAG-GPS01:ADC08",
# lazy=True,
# name="oxygen_sensor",
# module_name="eco.devices_general.wago",
# )
namespace.append_obj(
"GudeStrip",
@@ -1722,7 +1722,7 @@ namespace.append_obj(
namespace.append_obj(
"MicroscopeMotorRecord",
"SARES20-CAMS142-C2",
"SARES20-CAMS142-C1",
lazy=True,
pvname_zoom="SARES20-MF1:MOT_7",
name="samplecam_topview",
@@ -1744,6 +1744,15 @@ namespace.append_obj(
module_name="eco.devices_general.cameras_swissfel",
)
namespace.append_obj(
"OxygenSensor",
"SARES20-CWAG-GPS01:ADC08",
lazy=True,
name="oxygen_sensor",
module_name="eco.devices_general.sensors_ai",
)
# namespace.append_obj(
# "CameraBasler",
# "SARES20-CAMS142-C2",
@@ -2677,11 +2686,17 @@ from eco.devices_general.powersockets import MpodChannel
class IlluminatorsLasers(Assembly):
def __init__(self, name="sample_illumination"):
super().__init__(name=name)
self._append(
MpodChannel,
pvbase="SARES21-CPCL-PS7071",
channel_number=5,
name="illumination_inline",
)
self._append(
MpodChannel,
pvbase="SARES21-CPCL-PS7071",
channel_number=2,
name="illumination_1",
name="illumination_side",
)
self._append(
MpodChannel,
+47 -5
View File
@@ -12,6 +12,16 @@ from datetime import datetime
import requests
class JungfrauChannel(Assembly):
def __init__(
self,
jf_id,
name=None,
):
super().__init__(name=name)
self.alias = Alias(name, channel=jf_id, channeltype="JF")
class Jungfrau(Assembly):
def __init__(
self,
@@ -25,10 +35,15 @@ class Jungfrau(Assembly):
name=None,
):
super().__init__(name=name)
self.alias = Alias(name, channel=jf_id, channeltype="JF")
# self.alias = Alias(name, channel=jf_id, channeltype="JF")
self.pgroup = pgroup_adj
self.jf_id = jf_id
self.broker_address = broker_address
self._append(JungfrauChannel,jf_id,name='data')
self._append(JungfrauChannel,jf_id+'_rawdata',name='raw_data')
self._append(JungfrauChannel,jf_id+'_raw',name='data_raw')
self._append(JungfrauChannel,jf_id+'_dap_col4',name='data_online_processing')
self._append(JungfrauChannel,jf_id+'_dap_col3',name='ppref_online_processing')
self._append(
AdjustablePv,
pv_trigger,
@@ -161,7 +176,7 @@ class Jungfrau(Assembly):
def get_isrunning(self):
is_running = (
self.jf_id
in requests.get(f"{self.broker_address}/get_running_detectors_list").json()[
in requests.get(f"{self.broker_adc_to_energyaddress}/get_running_detectors_list").json()[
"detectors"
]
)
@@ -181,7 +196,7 @@ class Jungfrau(Assembly):
# JF_list = self.get_JFs_running()
# parameters = {
# "pgroup": pgroup,
# "rate_multiplicator": 1,
# "rate_multiplicator": 1,adc_to_energy
# "detectors": {tJF: {} for tJF in JF_list},
# }
# return requests.post(
@@ -256,6 +271,14 @@ class JungfrauDaqConfig(Assembly):
is_display=True,
is_setting=True,
)
self._append(
AdjustableGetSet,
self._get_save_online_processing,
self._set_save_online_processing,
name="save_online_processing",
is_display=True,
is_setting=True,
)
def _get_adc_to_energy(self, *args):
try:
@@ -286,7 +309,7 @@ class JungfrauDaqConfig(Assembly):
self._jf_daq_cfg.set_target_value(cfg).wait()
else:
cfg = self._jf_daq_cfg.get_current_value()
cfg[self._jf_id]["adc_to_energy"] = False
cfg[self._jf_id]["geometry"] = False
self._jf_daq_cfg.set_target_value(cfg).wait()
def _get_compressed_bitshuffle(self, *args):
@@ -305,6 +328,25 @@ class JungfrauDaqConfig(Assembly):
cfg[self._jf_id]["compression"] = False
self._jf_daq_cfg.set_target_value(cfg).wait()
def _get_save_online_processing(self, *args):
try:
return not self._jf_daq_cfg.get_current_value()[self._jf_id][
"save_dap_results"
]
except KeyError:
# raise Exception("unclear what the default for keeping raw files is!")
return None
def _set_save_online_processing(self, value):
if value:
cfg = self._jf_daq_cfg.get_current_value()
cfg[self._jf_id]["save_dap_results"] = False
self._jf_daq_cfg.set_target_value(cfg).wait()
else:
cfg = self._jf_daq_cfg.get_current_value()
cfg[self._jf_id]["save_dap_results"] = True
self._jf_daq_cfg.set_target_value(cfg).wait()
def _get_keep_raw_data(self, *args):
try:
return not self._jf_daq_cfg.get_current_value()[self._jf_id][
@@ -321,7 +363,7 @@ class JungfrauDaqConfig(Assembly):
self._jf_daq_cfg.set_target_value(cfg).wait()
else:
cfg = self._jf_daq_cfg.get_current_value()
cfg[self._jf_id]["remove_raw_files"] = True
cfg[self._jf_id]["remove_raw_files"] = Trueadc_to_energy
self._jf_daq_cfg.set_target_value(cfg).wait()
def _get_large_pixel_processing(self, *args):
+22
View File
@@ -0,0 +1,22 @@
from eco.devices_general.wago import AnalogInput
from eco.elements.adjustable import AdjustableVirtual
class OxygenSensor(AnalogInput):
def __init__(self,pvname,name=None):
super().__init__(pvname,name=name)
self.unit.set_target_value('%')
def set_no_oxygen(self, val_curr=None):
if not val_curr:
val_curr = self.raw.get_current_value()
slo = self.linear_calibration_slope.get_current_value()
off = self.linear_calibration_offset.get_current_value()
slo_new = slo*((100-val_curr)/(100-off))
self.linear_calibration_offset(val_curr)
self.linear_calibration_slope(slo_new)
def set_full_oxygen(self, val_curr=None):
if not val_curr:
val_curr = self.raw.get_current_value()
sval = (100-self.linear_calibration_offset.get_current_value())/val_curr
self.linear_calibration_slope(sval)
+3 -3
View File
@@ -30,7 +30,7 @@ class AnalogInput(Assembly):
self.pvname + ".EGU",
name="unit",
is_setting=False,
is_display=True,
is_display=False,
)
self.value.unit = self.unit
self._append(
@@ -59,14 +59,14 @@ class AnalogInput(Assembly):
self.pvname + ".EOFF",
name="linear_calibration_offset",
is_setting=True,
is_display=True,
is_display=False,
)
self._append(
AdjustablePv,
self.pvname + ".ESLO",
name="linear_calibration_slope",
is_setting=True,
is_display=True,
is_display=False,
)
def get_current_value(self):
+33 -1
View File
@@ -306,10 +306,42 @@ class LaserBernina(Assembly):
MotorRecord, self.pvname + "-M534:MOT", name="wp_att", is_setting=True
)
######## Implementation segmented ND filter wheel in rotation stage #########
self._append(
MotorRecord, "SARES20-MF1:MOT_16", name="nd_filt", is_setting=True
MotorRecord, "SARES20-MF1:MOT_16", name="nd_filt_stg", is_setting=True
)
filters = np.array([
[0.912010839, 330],
[0.794328235, 15],
[0.630957345, 60],
[0.501187234, 105],
[0.398107171, 150],
[0.316227766, 195],
[0.251188643, 240],
[0.1, 285],
])
def set_transmission(t):
idx = np.argmin(abs(filters.T[0]-t))
stg = filters[idx][1]
t = filters[idx][0]
print(f"Setting ND filter transmission to {t:.3} at position {stg}")
return stg
def get_transmission(stg):
idx = np.argmin(abs(filters.T[1]-stg))
t = filters[idx][0]
return t
self._append(
AdjustableVirtual, [self.nd_filt_stg], get_transmission, set_transmission, name="nd_filt"
)
######## END Implementation segmented ND filter wheel in rotation stage #########
self._append(
AdjustableFS,
"/photonics/home/gac-bernina/eco/configuration/wp_att_calibration",