From 1325c8924db4e4b2919a076bde2e9896f9f163e2 Mon Sep 17 00:00:00 2001 From: Ultrasound PC Date: Wed, 26 Mar 2025 16:37:15 +0100 Subject: [PATCH] ultrasound: change control roi0 to a Readable + remove cfg/PEUS.py + fix equipment_id of PEUS --- cfg/PEUS.py | 67 ---------------------------------------- cfg/PEUS_cfg.py | 2 +- frappy_psi/ultrasound.py | 6 ++-- 3 files changed, 4 insertions(+), 71 deletions(-) delete mode 100644 cfg/PEUS.py diff --git a/cfg/PEUS.py b/cfg/PEUS.py deleted file mode 100644 index 164276d..0000000 --- a/cfg/PEUS.py +++ /dev/null @@ -1,67 +0,0 @@ -Node(equipment_id = 'pe_ultrasound.psi.ch', - description = 'pulse echo ultra sound setup', - interface = 'tcp://5000', - ) - -Mod('f', - cls = 'frappy_psi.ultrasound.Frequency', - description = 'ultrasound frequency and acquisition loop', - uri = 'serial:///dev/ttyS1', - pars = 'pars', - pollinterval = 0.1, - time = 900, # start time - size = 5000, - freq = 1.17568e+06, - basefreq = 4.14902e+07, - control = False, - rusmode = False, - amp = 5.0, - nr = 1000, #500 #300 #100 #50 #30 #10 #5 #3 #1 #1000 #500 #300 #100 #50 #30 #10 #5 #3 #1 #500 - sr = 32768, #16384 - plot = True, - maxstep = 100000, - bw = 10E6, #butter worth filter bandwidth - maxy = 0.7, # y scale for plot - curves = 'curves', # module to transmit curves: - ) - -Mod('curves', - cls = 'frappy_psi.ultrasound.Curves', - description = 't, I, Q and pulse arrays for plot', - ) - -Mod('delay', - cls = 'frappy__psi.dg645.Delay', - description = 'delay line with 2 channels', - uri = 'serial:///dev/ttyS2', - on1 = 1e-9, - on2 = 1E-9, - off1 = 400e-9, - off2 = 600e-9, - ) - -Mod('pars', - cls = 'frappy_psi.ultrasound.Pars', - description = 'SEA parameters', - ) - -def roi(nr, time=None, size=300): - Mod(f'roi{nr}', - cls = 'frappy_psi.ultrasound.Roi', - description = f'I/Q of region {nr}', - main = 'f', - time=time or 4000, - size=size, - enable=time is not None, - ) - -roi(0, 2450) # you may add size as argument if not default -roi(1, 5950) -roi(2, 9475) -roi(3, 12900) -roi(4, 16100) -roi(5) # disabled -roi(6) -roi(7) -roi(8) -roi(9) diff --git a/cfg/PEUS_cfg.py b/cfg/PEUS_cfg.py index 77cd34d..096f436 100644 --- a/cfg/PEUS_cfg.py +++ b/cfg/PEUS_cfg.py @@ -1,4 +1,4 @@ -Node('pulse_echo.cfg', +Node('PEUS.psi.ch', 'ultrasound, pulse_echo configuration', interface='5000', ) diff --git a/frappy_psi/ultrasound.py b/frappy_psi/ultrasound.py index 1a50669..f13e48e 100644 --- a/frappy_psi/ultrasound.py +++ b/frappy_psi/ultrasound.py @@ -85,14 +85,15 @@ class Roi(Readable): class ControlRoi(Roi, Writable): freq = Attached() - target = Parameter(datatype=Roi.value.datatype) + # target is not releavnt -> always moving to I to zero + target = Parameter(datatype=Roi.value.datatype, export=False) maxstep = Parameter('max frequency step', FloatRange(unit='Hz'), readonly=False, default=10000) minstep = Parameter('min frequency step for slope calculation', FloatRange(unit='Hz'), readonly=False, default=4000) slope = Parameter('inphase/frequency slope', FloatRange(), readonly=False, default=1e6) - control_active = Parameter('are we controlling?', BoolType(), readonly=False) + control_active = Parameter('are we controlling?', BoolType(), readonly=False, default=0) _freq_target = None _skipctrl = 2 @@ -263,7 +264,6 @@ class PulseEcho(Base, Readable): value = Parameter(default=0) nr = Parameter('number of records', datatype=IntRange(1, 9999), default=500) bw = Parameter('bandwidth lowpassfilter', datatype=FloatRange(unit='Hz'), default=10E6) - control = Parameter('control loop on?', BoolType(), readonly=False, default=True) time = Parameter('pulse start time', FloatRange(unit='nsec'), readonly=False) size = Parameter('pulse length (starting from time)', FloatRange(unit='nsec'),