This commit is contained in:
gobbo_a
2023-08-17 15:16:51 +02:00
parent c545879253
commit 8beeb7dbc7
134 changed files with 3722 additions and 1287 deletions

View File

@@ -0,0 +1,8 @@
# change LED EVR delay
blm = "SARMA01-DLLM125"
delta = 5.0 # us
led = caget(blm + ":LED-DELAY-OP.INPA").split()[0]
delay1 = caget(led)
delay2 = delay1 + delta
print(blm, led, delay1, delay2)
caput(led, delay2)

View File

@@ -0,0 +1,16 @@
# 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)

View File

@@ -0,0 +1,36 @@
# shift all ROIs such that the GPAC EVRs have all the same delay, set GPAC delay, reinitialsie ioc
blm_list = {"S10BC01-DBLM065", "S10CB04-DBLM240", "S10CB06-DBLM240", "S10CB08-DBLM240", "S10DI01-DBLM015",
"S10DI01-DBLM045", "S20CB02-DBLM435", "S20SY02-DBLM075", "S20SY03-DBLM025", "S20SY03-DBLM110",
"S30CB02-DBLM445", "S30CB06-DBLM445", "S30CB10-DBLM445", "S30CB14-DBLM445", "SARCL02-DBLM135",
"SARCL02-DBLM355", "SARUN01-DBLM065", "SARUN03-DBLM030", "SARUN04-DBLM030", "SARUN05-DBLM030",
"SARUN06-DBLM030", "SARUN07-DBLM030", "SARUN08-DBLM030", "SARUN09-DBLM030", "SARUN10-DBLM030",
"SARUN11-DBLM030", "SARUN12-DBLM030", "SARUN13-DBLM030", "SARUN14-DBLM030", "SARUN15-DBLM030",
"SARUN15-DBLM035", "SARUN20-DBLM035", "SATBD01-DBLM205", "SATCB01-DBLM245", "SATCL01-DBLM135",
"SATCL02-DBLM295", "SATCL02-DBLM435", "SATDI01-DBLM095", "SATDI01-DBLM105", "SATDI01-DBLM225",
"SATDI01-DBLM305", "SATMA01-DBLM065", "SATSY03-DBLM085", "SATUN06-DBLM005", "SATUN14-DBLM405",
"SATUN22-DBLM005", "SINDI02-DBLM025", "SINDI02-DBLM085", "SINLH02-DBLM230", "SINLH02-DBLM235"}
ioc_list = {"SARCL02-DBLM469", "S10BC01-DBLM184", "S10CB06-DBLM153", "S10CB04-DBLM130", "SINLH02-DBLM018",
"S10DI01-DBLM113", "S20CB02-DBLM234", "S30CB10-DBLM381", "SINDI02-DBLM084", "S20SY03-DBLM292",
"S30CB02-DBLM310", "S30CB14-DBLM417", "SARUN01-DBLM499", "SARUN04-DBLM516", "SARUN08-DBLM537",
"SARUN11-DBLM546", "SARMA01-DBLM482", "SARUN20-DBLM599", "SATDI01-DBLM344", "SARUN13-DBLM555",
"SATCB01-DBLM355", "S10CB08-DBLM170", "SATCL01-DBLM328", "SARUN15-DBLM567", "S20CB04-DBLM255",
"SARCL02-DBLM457", "SINEG01-DBLM009", "S20SY03-DBLM269"}
PIX = 2.33426704 # 1 / (124.8 MHz * 3) = 2.33426704 ns
for blm in blm_list:
evr = caget(blm + ":GPAC-DELAY-OP.INPA").split()[0]
delay = caget(evr)
offset = delay - 7439.0 # 7439 ns
start_b1 = int(caget(blm + ":B1_ROI_START"))
new_start_b1 = int(start_b1 + offset * 1000 / PIX)
print(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)
for ioc in ioc_list:
caput(ioc + "-EVR0:Pul10-Delay-SP", 7439.0)
caput(ioc + ":SYSTEM-INIT.PROC", 1)
print(ioc + "-EVR0:Pul10-Delay-SP", 7439.0)
print(ioc + ":SYSTEM-INIT.PROC", 1)

View File

@@ -0,0 +1,17 @@
# shift (and scale) the position of the start and end of the LLM GPAC waveform
# delta is in m, scaling may be unphysical (change of signal speed in the fibber)
llmlist = ("SINEG01-DLLM335", "SINDI01-DLLM105", "S10CB09-DLLM110", "S20CB04-DLLM110",
"S30CB05-DLLM110", "S30CB13-DLLM110", "SARMA01-DLLM125", "SARUN15-DLLM075",
"SATSY01-DLLM005", "SATDI01-DLLM305", "SATUN09-DLLM035")
llm = "SATSY01-DLLM005"
delta = 1.0
scale = 1.0 # should not be changed individually (same fibber type-> same signal speed)
z1 = caget(llm + ":Z-START-OP")
z2 = caget(llm + ":Z-STOP-OP")
dz = (z2 - z1) * scale
zc = (z1 + z2) / 2 + delta
z1 = zc - dz / 2
z2 = zc + dz / 2
caput(llm + ":Z-START-OP", z1)
caput(llm + ":Z-STOP-OP", z2)

View File

@@ -0,0 +1,7 @@
# scale globally LLM GPAC waveform length
# the length in m should normally be: 1 / (142.8 MHz * 3) * 2047 * c / (1 + n=1.4585) = 582.7 m
llmlist = ("SINEG01-DLLM335", "SINDI01-DLLM105", "S10CB09-DLLM110", "S20CB04-DLLM110",
"S30CB05-DLLM110", "S30CB13-DLLM110", "SARMA01-DLLM125", "SARUN15-DLLM075",
"SATSY01-DLLM005", "SATDI01-DLLM305", "SATUN09-DLLM035")
for llm in llmlist: caput(llm + ":Z-STOP-OP", caget(llm + ":Z-START-OP") + 582.7)

View File

@@ -0,0 +1,21 @@
# shift LLM ROIs by set amount delta_m in m and init ioc
delta_m = 0.0 # m
llm = "SATSY01-DLLM005"
ioc = "S20SY03-DBLM269"
chlist = [":CH1", ":CH2", ":CH3", ":CH4", ":CH5", ":CH6", ":CH7", ":CH8"]
z_start = caget(llm + ":Z-START-OP")
z_stop = caget(llm + ":Z-STOP-OP")
delta_pt = int(delta_m * 2047 / (z_stop - z_start))
print(delta_pt)
for ch in chlist:
roi_start = int(caget(llm + ch + "_ROI_START"))
roi_stop = int(caget(llm + ch + "_ROI_STOP"))
print(roi_start, roi_stop)
roi_start = roi_start + delta_pt
roi_stop = roi_stop + delta_pt
print(roi_start, roi_stop)
caput(llm + ch + "_ROI_START", roi_start)
caput(llm + ch + "_ROI_STOP", roi_stop)
print(ioc + ":SYSTEM-INIT.PROC", 1)
caput(ioc + ":SYSTEM-INIT.PROC", 1)

View File

@@ -0,0 +1,21 @@
# shift and scale the position of the start and end of the LLM GPAC waveform
# keep llm center unchanged, set step-size to default value
# delta is in m, scaling may be unphysical (change of signal speed in the fibber)
llmlist = ("SINEG01-DLLM335", "SINDI01-DLLM105", "S10CB09-DLLM110", "S20CB04-DLLM110",
"S30CB05-DLLM110", "S30CB13-DLLM110", "SARMA01-DLLM125", "SARUN15-DLLM075",
"SATSY01-DLLM005", "SATDI01-DLLM305", "SATUN09-DLLM035")
llm = "SATUN09-DLLM035"
zllm1 = 429.9
zllm2 = 502.3
zc = (zllm1 + zllm2) / 2
z1i = caget(llm + ":Z-START-OP")
z2i = caget(llm + ":Z-STOP-OP")
stepi = (z2i - z1i) / 2047
n = int((zc - z1i) / stepi)
stepf = 0.28464 # n = 1.4585 (Silica)
z1f = zc - n * stepf
z2f = zc + (2047 - n) * stepf
caput(llm + ":Z-START-OP", z1f)
caput(llm + ":Z-STOP-OP", z2f)