Compare commits

...

3 Commits

Author SHA1 Message Date
x01dc
c1559e4c0b fixed ascii logo flomni and omny
Some checks failed
CI for csaxs_bec / test (push) Failing after 1m54s
2026-03-06 14:35:04 +01:00
x01dc
8013a6305d added beck startup
Some checks failed
CI for csaxs_bec / test (push) Failing after 1m53s
CI for csaxs_bec / test (pull_request) Failing after 40s
2026-03-06 14:32:47 +01:00
x01dc
393b91c2ac now reading encoder values for axes with encoder
Some checks failed
CI for csaxs_bec / test (push) Failing after 1m57s
CI for csaxs_bec / test (pull_request) Failing after 1m56s
2026-03-06 14:31:23 +01:00
7 changed files with 81 additions and 28 deletions

View File

@@ -107,11 +107,12 @@ class flomniGuiTools:
idle_text_box = self.gui.flomni.new("idle_textbox").new("TextBox") idle_text_box = self.gui.flomni.new("idle_textbox").new("TextBox")
text = ( text = (
"<pre>" "<pre>"
+ " ,---.,--. ,-----. ,--. ,--.,--. ,--.,--. \n" + "██████╗ ███████╗ ██████╗ ███████╗██╗ ██████╗ ███╗ ███╗███╗ ██╗██╗\n"
+ "/ .-'| |' .-. '| `.' || ,'.| || | \n" + "██╔══██╗██╔════╝██╔════╝ ██╔════╝██║ ██╔═══██╗████╗ ████║████╗ ██║██║\n"
+ "| `-,| || | | || |'.'| || |' ' || | \n" + "██████╔╝█████╗ ██║ █████╗ ██║ ██║ ██║██╔████╔██║██╔██╗ ██║██║\n"
+ "| .-'| |' '-' '| | | || | ` || | \n" + "██╔══██╗██╔══╝ ██║ ██╔══╝ ██║ ██║ ██║██║╚██╔╝██║██║╚██╗██║██║\n"
+ "`--' `--' `-----' `--' `--'`--' `--'`--' \n" + "██████╔╝███████╗╚██████╗ ██║ ███████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚████║██║\n"
+ "╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝\n"
+ "</pre>" + "</pre>"
) )
idle_text_box.set_html_text(text) idle_text_box.set_html_text(text)

View File

@@ -83,16 +83,12 @@ class OMNYGuiTools:
pass pass
text = ( text = (
"<pre>" "<pre>"
+ " ,o888888o. ,8. ,8. b. 8 `8.`8888. ,8' \n" + "██████╗ ███████╗ ██████╗ ██████╗ ███╗ ███╗███╗ ██╗██╗ ██╗\n"
+ " . 8888 `88. ,888. ,888. 888o. 8 `8.`8888. ,8' \n" + "██╔══██╗██╔════╝██╔════╝ ██╔═══██╗████╗ ████║████╗ ██║╚██╗ ██╔╝\n"
+ ",8 8888 `8b .`8888. .`8888. Y88888o. 8 `8.`8888. ,8' \n" + "██████╔╝█████╗ ██║ ██║ ██║██╔████╔██║██╔██╗ ██║ ╚████╔╝ \n"
+ "88 8888 `8b ,8.`8888. ,8.`8888. .`Y888888o. 8 `8.`8888.,8' \n" + "██╔══██╗██╔══╝ ██║ ██║ ██║██║╚██╔╝██║██║╚██╗██║ ╚██╔╝ \n"
+ "88 8888 88 ,8'8.`8888,8^8.`8888. 8o. `Y888888o. 8 `8.`88888' \n" + "██████╔╝███████╗╚██████╗ ╚██████╔╝██║ ╚═╝ ██║██║ ╚████║ ██║ \n"
+ "88 8888 88 ,8' `8.`8888' `8.`8888. 8`Y8o. `Y88888o8 `8. 8888 \n" + "╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ \n"
+ "88 8888 ,8P ,8' `8.`88' `8.`8888. 8 `Y8o. `Y8888 `8 8888 \n"
+ "`8 8888 ,8P ,8' `8.`' `8.`8888. 8 `Y8o. `Y8 8 8888 \n"
+ " ` 8888 ,88' ,8' `8 `8.`8888. 8 `Y8o.` 8 8888 \n"
+ " `8888888P' ,8' ` `8.`8888. 8 `Yo 8 8888 \n"
+ "</pre>" + "</pre>"
) )
self.idle_text_box.set_html_text(text) self.idle_text_box.set_html_text(text)

View File

@@ -271,4 +271,20 @@ rty:
enabled: true enabled: true
readOnly: False readOnly: False
############################################################
######################### Cameras ##########################
############################################################
cam_xeye:
description: Camera LamNI Xray eye ID15
deviceClass: csaxs_bec.devices.ids_cameras.ids_camera.IDSCamera
deviceConfig:
camera_id: 15
bits_per_pixel: 24
num_rotation_90: 3
transpose: false
force_monochrome: true
m_n_colormode: 1
enabled: true
onFailure: buffer
readOnly: false
readoutPriority: async

View File

@@ -15,7 +15,6 @@ from csaxs_bec.devices.omny.galil.galil_ophyd import (
GalilAxesReferenced, GalilAxesReferenced,
GalilController, GalilController,
GalilMotorIsMoving, GalilMotorIsMoving,
GalilMotorResolution,
GalilSetpointSignal, GalilSetpointSignal,
GalilSignalRO, GalilSignalRO,
retry_once, retry_once,
@@ -24,6 +23,19 @@ from csaxs_bec.devices.omny.galil.galil_ophyd import (
logger = bec_logger.logger logger = bec_logger.logger
class GalilMotorResolution(GalilSignalRO):
@retry_once
@threadlocked
def _socket_get(self):
if self.parent.axis_Id_numeric < 6:
return float(
self.controller.socket_put_and_receive(f"MG encpermm[{self.parent.axis_Id_numeric}]")
)
else:
return float(
self.controller.socket_put_and_receive(f"MG stppermm[{self.parent.axis_Id_numeric}]")
)
class LamniGalilController(GalilController): class LamniGalilController(GalilController):
@@ -154,11 +166,18 @@ class LamniGalilReadbackSignal(GalilSignalRO):
Returns: Returns:
float: Readback value after adjusting for sign and motor resolution. float: Readback value after adjusting for sign and motor resolution.
""" """
current_pos = float(self.controller.socket_put_and_receive(f"TD{self.parent.axis_Id}")) if self.parent.axis_Id_numeric < 6:
current_pos *= self.parent.sign current_pos = float(self.controller.socket_put_and_receive(f"TP{self.parent.axis_Id}"))
step_mm = self.parent.motor_resolution.get() current_pos *= self.parent.sign
return current_pos / step_mm encoder_resolution = self.parent.motor_resolution.get()
logger.info(f"Read galil encoder position of axis {self.parent.axis_Id_numeric} to be TP {current_pos} with resolution {encoder_resolution}")
return current_pos / encoder_resolution
else:
current_pos = float(self.controller.socket_put_and_receive(f"TD{self.parent.axis_Id}"))
current_pos *= self.parent.sign
step_mm = self.parent.motor_resolution.get()
return current_pos / step_mm
def read(self): def read(self):
self._metadata["timestamp"] = time.time() self._metadata["timestamp"] = time.time()
val = super().read() val = super().read()

View File

@@ -169,6 +169,9 @@ class LamNIMixin:
self.device_manager.devices.lsamx.read_only = True self.device_manager.devices.lsamx.read_only = True
self.device_manager.devices.lsamy.read_only = True self.device_manager.devices.lsamy.read_only = True
#update angle readback before start of the scan
yield from self.stubs.send_rpc_and_wait("lsamrot", "readback.get")
yield from self.stubs.send_rpc_and_wait("rtx", "controller.feedback_enable_without_reset") yield from self.stubs.send_rpc_and_wait("rtx", "controller.feedback_enable_without_reset")

View File

@@ -108,12 +108,17 @@ The nano-positioning is controlled by a feedback loop running on a real-time lin
Once the loop has started, it is possible to start bec with the flOMNI configuration file. Once the loop has started, it is possible to start bec with the flOMNI configuration file.
Starting bec with session will load the scripts
`bec --session flomni`
The flOMNI scripts can be loaded manually by
`from csaxs_bec.bec_ipython_client.plugins.flomni import Flomni`
`flomni = Flomni(bec)`
Loading the flOMNI configuration (this command will load the OMNY configuration only - isolated from the beamline) Loading the flOMNI configuration (this command will load the OMNY configuration only - isolated from the beamline)
`bec.config.update_session_with_file("/bec/csaxs_bec/csaxs_bec/device_configs/flomni_config.yaml")` `bec.config.update_session_with_file("/bec/csaxs_bec/csaxs_bec/device_configs/flomni_config.yaml")`
Loading the flOMNI scripts
`from csaxs_bec.bec_ipython_client.plugins.flomni import Flomni`
`flomni = Flomni(bec)`
If the realtime system is restarted, bec will lose communication. To restart: If the realtime system is restarted, bec will lose communication. To restart:
`flomni.rt_off()` … then wait a few seconds `flomni.rt_off()` … then wait a few seconds
@@ -138,10 +143,14 @@ This script will first verify that the stages are not in an initialized state, a
The positions of the optics stages are stored as stage parameters and are thus linked to the configuration file. The positions of the optics stages are stored as stage parameters and are thus linked to the configuration file.
Example: The OSAx “in” position can be reviewed by `dev.fosax.user_parameter` Example: The OSAx “in” position can be reviewed by `dev.fosax.user_parameter`
Update the value by (example "fosax", "in") by `dev.fosax.update_user_parameter({"in":value})` Update the value by (example "fosax", "in") by `dev.fosax.update_user_parameter({"in":value})`
Important note: if these values are changed, they are not automatically stored to the config file and will only be available in the current session.
`flomni.ffzp_info()` shows info about the available FZPs at the current energy of the beamline. Optional parameter is the photon _energy_ in keV. `flomni.ffzp_info()` shows info about the available FZPs at the current energy of the beamline. Optional parameter is the photon _energy_ in keV.
Example: `flomni.ffzp_info(6.2)` Example: `flomni.ffzp_info(6.2)`
Documents about availabe optics can be accessed by
`flomni.flomnigui_docs`
The [laser feedback](user.ptychography.flomni.laser_feedback) will be disabled and fine alignment lost if foptx/y are moved! The [laser feedback](user.ptychography.flomni.laser_feedback) will be disabled and fine alignment lost if foptx/y are moved!
Following functions exist to move the optics in and out, with self-explaining naming. Following functions exist to move the optics in and out, with self-explaining naming.

View File

@@ -102,13 +102,16 @@ The nano-positioning is controlled by a feedback loop running on a real-time lin
Once the loop has started, it is possible to start bec with the LamNI configuration file. Once the loop has started, it is possible to start bec with the LamNI configuration file.
Loading the LamNI configuration (this command will load the LamNI configuration only - isolated from the beamline) Loading the LamNI scripts is done by starting bec as
`bec.config.update_session_with_file("/bec/csaxs_bec/csaxs_bec/device_configs/lamni_config.yaml")` `bec --session lamni`
Loading the LamNI scripts The scripts can alternatively manually be loaded by
`from csaxs_bec.bec_ipython_client.plugins.LamNI import LamNI` `from csaxs_bec.bec_ipython_client.plugins.LamNI import LamNI`
`lamni = LamNI(bec)` `lamni = LamNI(bec)`
Loading the LamNI configuration (this command will load the LamNI configuration only - isolated from the beamline)
`bec.config.update_session_with_file("/bec/csaxs_bec/csaxs_bec/device_configs/lamni_config.yaml")`
If the realtime system is restarted, BEC will lose communication. To restart: If the realtime system is restarted, BEC will lose communication. To restart:
`lamni.rt_off()` … then wait a 10 seconds `lamni.rt_off()` … then wait a 10 seconds
`lamni.rt_on()` `lamni.rt_on()`
@@ -152,6 +155,12 @@ The underlying scan function can be called as
Use `scans.lamni_fermat_scan?`for detailed information. A prerequisite for scanning is a running feedback system. Use `scans.lamni_fermat_scan?`for detailed information. A prerequisite for scanning is a running feedback system.
### GUI tools
During operation the BEC GUI will show the relevant cameras or progress information. To manually switch view TAB completion on 'lamni.lamnigui_' will show all options to control the GUI. Most useful
'lamni.lamnigui_show_progress()' will show the measurement progress GUI
'lamnigui_show_xeyealign()' will show the XrayEye alignment GUI
### X-ray optics alignment ### X-ray optics alignment
The positions of the optics stages are stored as stage parameters and are thus linked to the configuration file. The positions of the optics stages are stored as stage parameters and are thus linked to the configuration file.