From 620bb9cafefb7e50519fa2c1d86ec53b52cdd847 Mon Sep 17 00:00:00 2001 From: PONS Date: Thu, 8 Oct 2026 14:39:36 +0200 Subject: [PATCH] Fix TL2 tests, usage of ThinMPolePass and corrected calibration factor --- tests/config/tl2/tl2.mat | Bin 69648 -> 68152 bytes tests/config/tl2/tl2.yml | 32 +++++++++++------------ tests/tuning_tools/test_transfer_line.py | 8 +++--- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/config/tl2/tl2.mat b/tests/config/tl2/tl2.mat index b871250f4aad43cb45c7b86cf12aea470f06e401..0d1a909d4df5e79e438be780169728693cc448af 100644 GIT binary patch delta 2652 zcmbQRfMv%NmI;OuAsM9#{>dc@3Kj~6CRT>VR;CsTMg~S^69aW7CU8uwWoO#Jxv@=- zgDHS%@;M$eM&HT3EGlxoi531uDXB#a3=9GJIhA?&xsC{?)6{-O)5$dgLX*olttKyE z(^26CN-_d52nYZ%h#!)Xndb}CoEnf=Tnyw-PMF#<`3zTrB2LAnIVG6|Kn;_9xnECi zU}j_dv)P`fmYEEf`H<`?C4#PE*z6}-$2j?p)1u97B5q71yQ)W=bXO4$tIf8y<&2x( zNIf7u0((?w=pgkIVkCzUC`Gl|lb)i8jl0cvoL-OHr;c=25fx^uCeLrMWCw@atEZd&eKc4%v$vJ9qT4Po@>jt&i!GP$hysOQU#2gr_H}7N^+=yiZ!=w zG|3LKJ6=x?P+((xIN6@3mt=>dc@3g!xiMpmY#Rz?O2Mg~S^69aW7CU8uwWoPQ(-`FO{ z!L)*DavYP{#&IM`j+ODWESM- zq%r`(+75OL-QFoACvmWj_j&4VnUPKlySHU z&6_~O*dT^&{-+uyj%*Alw8ZRi7(>W&#~e{Tx5tGz&&9gEW;X;o=rStIj?q}5VBEwCXntNzsZ=+X`7D2IhfvBGx^X=yU8CO zPMJI>^wH+B+4n?|9RyBCn@BJ$Xp0^DoFfVwiZUKf?icMvHVYI^&$g0ameLM8)XZ{i z=RFl<6G5&kyN|;}e$*_?Fj@b~n#r3V+OnsC!8L5ob9+pRVa-orMa<>R`j>!3%-?6n j(NY&MGruFn$ip9O*>j%%UitCTS)h@ojGJvf{SgNM*!Je! diff --git a/tests/config/tl2/tl2.yml b/tests/config/tl2/tl2.yml index 8509e34d..8fef60f8 100644 --- a/tests/config/tl2/tl2.yml +++ b/tests/config/tl2/tl2.yml @@ -88,7 +88,7 @@ devices: name: CH1 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/ch1/Current @@ -96,7 +96,7 @@ devices: name: CH2 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/ch2/Current @@ -104,7 +104,7 @@ devices: name: CH3 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/ch3/Current @@ -112,7 +112,7 @@ devices: name: CH4 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/ch4/Current @@ -120,7 +120,7 @@ devices: name: CH5 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/ch5/Current @@ -128,7 +128,7 @@ devices: name: CH6 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/ch6/Current @@ -136,7 +136,7 @@ devices: name: CH7 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/ch7/Current @@ -144,7 +144,7 @@ devices: name: CH8 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/ch8/Current @@ -153,7 +153,7 @@ devices: name: CV0 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/cv0/Current @@ -161,7 +161,7 @@ devices: name: CV1 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/cv1/Current @@ -169,7 +169,7 @@ devices: name: CV3 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/cv3/Current @@ -177,7 +177,7 @@ devices: name: CV4 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/cv4/Current @@ -185,7 +185,7 @@ devices: name: CV5 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/cv5/Current @@ -193,7 +193,7 @@ devices: name: CV6 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/cv6/Current @@ -201,7 +201,7 @@ devices: name: CV7 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/cv7/Current @@ -209,7 +209,7 @@ devices: name: CV8 model: class: pyaml.magnet.linear_model.LinearMagnetModel - calibration_factor: 161e-6 + calibration_factor: 3.222e-3 unit: 1/m hardware_unit: A powerconverter: tl2/ps-c1/cv8/Current diff --git a/tests/tuning_tools/test_transfer_line.py b/tests/tuning_tools/test_transfer_line.py index cd4dfe3e..7c5b422c 100644 --- a/tests/tuning_tools/test_transfer_line.py +++ b/tests/tuning_tools/test_transfer_line.py @@ -19,10 +19,10 @@ def test_transfer_line(): orm_v = mat[9:, 8:] assert numpy.allclose( - orm_h[8, :], [1.49746082, 3.11487458, 10.60522905, -0.84014865, -19.27774502, -14.92314963, 1.29287711, 1.60223207] + orm_h[8, :], [1.49217029, 3.11318219, 10.60494678, -0.82242986, -19.2814236, -14.92682822, 1.28503979, 1.60584401] ) assert numpy.allclose( - orm_v[8, :], [10.95115436, 10.56436269, 16.43975007, 32.48697172, 12.7218589, 10.31009581, 10.46821268, 2.60568252] + orm_v[8, :], [10.95203344, 10.56524176, 16.43659334, 32.50321299, 12.72373742, 10.3122307, 10.47365958, 2.61214668] ) tl2.design.tool.orm.save("tl2.json") @@ -37,11 +37,11 @@ def test_transfer_line(): vcorr.strengths.set(vcorr.strengths.get() + std_kick * numpy.random.normal(size=len(vcorr))) orbit = tl2.design.diagnostic.bpms.get("BPMS").positions - assert numpy.allclose(numpy.std(orbit.get(), axis=0), [1.78601145e-05, 3.57671504e-05]) + assert numpy.allclose(numpy.std(orbit.get(), axis=0), [1.78288459e-05, 3.57986943e-05]) tl2.design.tool.orbit.correct() tl2.design.tool.orbit.correct() - assert numpy.allclose(numpy.std(orbit.get(), axis=0), [7.50786048e-07, 7.26005222e-07]) + assert numpy.allclose(numpy.std(orbit.get(), axis=0), [7.51291713e-07, 7.24545959e-07]) assert numpy.allclose(orbit.get()[2], tl2.design.diagnostic.bpm.get("BPM_QD5").positions.get())