Skip to content

Commit b58d83b

Browse files
SebastienJolySebastienJoly
authored andcommitted
Fixed measured ORM to return to initial state despite corrector strength clipping.
1 parent ab02061 commit b58d83b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pySC/correction/loco.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import numpy as np
33
import multiprocessing
44
from pySC.lattice_properties.response_model import SCgetModelRM, SCgetModelDispersion
5-
from pySC.core.constants import SETTING_ADD, TRACK_ORB
5+
from pySC.core.constants import SETTING_ADD, SETTING_ABS, TRACK_ORB
66
from pySC.core.beam import bpm_reading
77
import matplotlib.pyplot as plt
88
from scipy.optimize import least_squares
@@ -71,9 +71,10 @@ def measure_closed_orbit_response_matrix(SC, bpm_ords, cm_ords, dkick=1e-5):
7171
cnt = 0
7272
for n_dim in range(2):
7373
for cm_ord in cm_ords[n_dim]:
74+
initial_cm_value = SC.get_cm_setpoints(cm_ord, skewness=bool(n_dim))
7475
SC.set_cm_setpoints(cm_ord, dkick, skewness=bool(n_dim), method=SETTING_ADD)
7576
closed_orbits1 = bpm_reading(SC, bpm_ords=bpm_ords)[0]
76-
SC.set_cm_setpoints(cm_ord, -dkick, skewness=bool(n_dim), method=SETTING_ADD)
77+
SC.set_cm_setpoints(cm_ord, initial_cm_value, skewness=bool(n_dim), method=SETTING_ABS)
7778
response_matrix[:, cnt] = np.ravel((closed_orbits1 - closed_orbits0) / dkick)
7879
cnt = cnt + 1
7980
return response_matrix

0 commit comments

Comments
 (0)