From 517c3f061850a753ecc6a2dd12c1807384fceca1 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Sun, 10 May 2026 08:34:53 +0200 Subject: [PATCH] add SPEC styled hkl scans wrapper --- .../high_level_interface/hkl_hli.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/addams_bec/bec_ipython_client/high_level_interface/hkl_hli.py b/addams_bec/bec_ipython_client/high_level_interface/hkl_hli.py index 356047e..9e91c04 100644 --- a/addams_bec/bec_ipython_client/high_level_interface/hkl_hli.py +++ b/addams_bec/bec_ipython_client/high_level_interface/hkl_hli.py @@ -169,6 +169,30 @@ def umvhkl(h: float, k: float, l: float, auto=False): ubr(h, k, l) +def hklscan(h1: float, h2: float, k1: float, k2: float, l1: float, l2: float, steps: int, exp_time: float, fly: bool = False): + """ + Scan in reciprocol space along a line starting at (h1, k1, l1) and ending at (h2, k2,l2) in number of steps. + """ + if fly: + scans.hkl_flyscan(h1, h2, k1, k2, l1, l2, steps, exp_time=exp_time) + else: + scans.hkl_scan(h1, h2, k1, k2, l1, l2, steps, exp_time=exp_time) + +def hscan(h1: float, h2: float, steps: int, exp_time: float, fly: bool = False): + k = diffract.k.position + l = diffract.l.position + hklscan(h1, h2, k, k, l, l, steps, exp_time, fly) + +def kscan(k1: float, k2: float, steps: int, exp_time: float, fly: bool = False): + h = diffract.h.position + l = diffract.l.position + hklscan(h, h, k1, k2, l, l, steps, exp_time, fly) + +def lscan(l1: float, l2: float, steps: int, exp_time: float, fly: bool = False): + h = diffract.h.position + k = diffract.k.position + hklscan(h, h, k, k, l1, l2, steps, exp_time, fly) + def ca(h: float, k: float, l: float): """ Calculate angle positions for a given point in reciprocol space