Skip to content

Commit

Permalink
Update loco.py
Browse files Browse the repository at this point in the history
  • Loading branch information
elafmusa authored Nov 13, 2024
1 parent c2fb2f9 commit b6b712a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pySC/correction/loco.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ def generating_quads_response_matrices(args):
dx = twiss.dispersion[:, 0]
dy = twiss.dispersion[:, 2]
dispersion_meas = np.column_stack((dx, dy))
C_measured = np.hstack((C_measured, ((dispersion_meas - dispersion_model) / correctors_kick).reshape(-1, 1)))
SC.set_magnet_setpoints(quad_index, -dk, skewness, order, method)
return np.hstack((C_measured - C_model, ((dispersion_meas - dispersion_model) / correctors_kick).reshape(-1, 1)))
return C_measured - C_model


def measure_closed_orbit_response_matrix(SC, bpm_ords, cm_ords, dkick=1e-5, includeDispersion=False):
Expand Down Expand Up @@ -307,4 +308,4 @@ def plot_dispersion_err(ring, twiss, elements_indexes):
dy = twiss_error.dispersion[:, 2] - twiss.dispersion[:, 2]

plot_data(twiss_error.s_pos, dx, "s_pos [m]", r'$\Delta \eta_x$ [m]', "Horizontal dispersion error")
plot_data(twiss_error.s_pos, dy, "s_pos [m]", r'$\Delta \eta_y$ [m]', "Vertical dispersion error")
plot_data(twiss_error.s_pos, dy, "s_pos [m]", r'$\Delta \eta_y$ [m]', "Vertical dispersion error")

0 comments on commit b6b712a

Please sign in to comment.