Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pySC/correction/loco.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import multiprocessing
from pySC.lattice_properties.response_model import SCgetModelRM, SCgetModelDispersion
from pySC.core.constants import SETTING_ADD, TRACK_ORB
from pySC.core.constants import SETTING_ADD, SETTING_ABS, TRACK_ORB
from pySC.core.beam import bpm_reading
import matplotlib.pyplot as plt
from scipy.optimize import least_squares
Expand Down Expand Up @@ -71,9 +71,10 @@ def measure_closed_orbit_response_matrix(SC, bpm_ords, cm_ords, dkick=1e-5):
cnt = 0
for n_dim in range(2):
for cm_ord in cm_ords[n_dim]:
initial_cm_value = SC.get_cm_setpoints(cm_ord, skewness=bool(n_dim))
SC.set_cm_setpoints(cm_ord, dkick, skewness=bool(n_dim), method=SETTING_ADD)
closed_orbits1 = bpm_reading(SC, bpm_ords=bpm_ords)[0]
SC.set_cm_setpoints(cm_ord, -dkick, skewness=bool(n_dim), method=SETTING_ADD)
SC.set_cm_setpoints(cm_ord, initial_cm_value, skewness=bool(n_dim), method=SETTING_ABS)
response_matrix[:, cnt] = np.ravel((closed_orbits1 - closed_orbits0) / dkick)
cnt = cnt + 1
return response_matrix
Expand Down
4 changes: 2 additions & 2 deletions pySC/lattice_properties/response_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ def SCgetModelRING(SC: SimulatedCommissioning, includeAperture: bool =False) ->
ring = SC.IDEALRING.deepcopy()
for ord in range(len(SC.RING)):
if hasattr(SC.RING[ord], 'SetPointA') and hasattr(SC.RING[ord], 'SetPointB'):
ring[ord].PolynomA = SC.RING[ord].SetPointA
ring[ord].PolynomB = SC.RING[ord].SetPointB
ring[ord].PolynomA = copy.deepcopy(SC.RING[ord].SetPointA)
ring[ord].PolynomB = copy.deepcopy(SC.RING[ord].SetPointB)
ring[ord].PolynomA[0] = 0.0
ring[ord].PolynomB[0] = 0.0
if includeAperture:
Expand Down
Loading