Files
sf-op/script/Diagnostics/BLM_ROI_finetune.py
gobbo_a 8beeb7dbc7
2023-08-17 15:16:51 +02:00

17 lines
664 B
Python

# shift BLM ROI by desired offset in us and reinitialise ioc
blm = "SATUN22-DBLM005"
ioc = "SARCL02-DBLM469"
offset = 0.040 # us
PIX = 2.33426704 # 1 / (124.8 MHz * 3) = 2.33426704 ns
evr = caget(blm + ":GPAC-DELAY-OP.INPA").split()[0]
delay = caget(evr)
start_b1 = int(caget(blm + ":B1_ROI_START"))
new_start_b1 = int(start_b1 + offset * 1000 / PIX)
print(blm, ioc, delay, offset, start_b1, new_start_b1)
caput(blm + ":B1_ROI_START", new_start_b1)
caput(blm + ":B1_ROI_STOP", new_start_b1 + 18)
caput(blm + ":B2_ROI_START", new_start_b1 + 19)
caput(blm + ":B2_ROI_STOP", new_start_b1 + 37)
print(ioc + ":SYSTEM-INIT.PROC", 1)
caput(ioc + ":SYSTEM-INIT.PROC", 1)