Rotating Coild Data Analysis for BO QF Magnets

Import libraries and Load measurement data


In [1]:
import numpy as np
import matplotlib
matplotlib.use('Qt5Agg')

%matplotlib notebook

import matplotlib.pyplot as plt
from lnls.rotcoil import *

In [2]:
# Define serial numbers, one for each magnet

serials = [
#     '002', # different folder structure!
#     '006', # (not used in BO)
    '007', '009', 
    '010', # magnetic center off (not used in BO)
    '011', '012', '013', '014', '015', '016', '017', '018', '019', '020',
    '021', # skew multipole, max excitation error
    '022', '023', '024', '025', '026', '027', '028', '029', '030',
    '031', '032',
    '033',  # different excitations at low currents
    '034', '035', '036', '037', '038', '039', '040',
    '041', '042', '043', '044', '045', '046', '047', '048', '049', '050',
    '051', '052', '053', '054', '055', '056', '057', '058', 
]

# Load all data
data = MagnetsAnalysis(RotCoilMeas_BOQuadQF, serials)
data.init()

# Print info
data.print_info()


index: 00, serial_number: 007, data sets: ['M2', 'M1', 'M3']
index: 01, serial_number: 009, data sets: ['M2', 'M1', 'M3']
index: 02, serial_number: 010, data sets: ['M2', 'M1', 'M6', 'M4', 'M5', 'M3']
index: 03, serial_number: 011, data sets: ['M2', 'M1', 'M3']
index: 04, serial_number: 012, data sets: ['M2', 'M1', 'M3']
index: 05, serial_number: 013, data sets: ['M2', 'M1', 'M3']
index: 06, serial_number: 014, data sets: ['M2', 'M1', 'M3']
index: 07, serial_number: 015, data sets: ['M2', 'M1', 'M3']
index: 08, serial_number: 016, data sets: ['M2', 'M1', 'M3']
index: 09, serial_number: 017, data sets: ['M2', 'M1', 'M3']
index: 10, serial_number: 018, data sets: ['M2', 'M1', 'M3']
index: 11, serial_number: 019, data sets: ['M2', 'M1', 'M3']
index: 12, serial_number: 020, data sets: ['M2', 'M1', 'M3']
index: 13, serial_number: 021, data sets: ['M2', 'M1', 'M3']
index: 14, serial_number: 022, data sets: ['M2', 'M1', 'M3']
index: 15, serial_number: 023, data sets: ['M2', 'M1', 'M3']
index: 16, serial_number: 024, data sets: ['M2', 'M1', 'M3']
index: 17, serial_number: 025, data sets: ['M2', 'M1', 'M3']
index: 18, serial_number: 026, data sets: ['M2', 'M1', 'M3']
index: 19, serial_number: 027, data sets: ['M2', 'M1', 'M3']
index: 20, serial_number: 028, data sets: ['M2', 'M1', 'M3']
index: 21, serial_number: 029, data sets: ['M2', 'M1', 'M3']
index: 22, serial_number: 030, data sets: ['M2', 'M1', 'M3']
index: 23, serial_number: 031, data sets: ['M2', 'M1', 'M3']
index: 24, serial_number: 032, data sets: ['M2', 'M1', 'M3']
index: 25, serial_number: 033, data sets: ['M2', 'M1', 'M3']
index: 26, serial_number: 034, data sets: ['M2', 'M1', 'M3']
index: 27, serial_number: 035, data sets: ['M2', 'M1', 'M3']
index: 28, serial_number: 036, data sets: ['M2', 'M1', 'M3']
index: 29, serial_number: 037, data sets: ['M2', 'M1', 'M3']
index: 30, serial_number: 038, data sets: ['M2', 'M1', 'M3']
index: 31, serial_number: 039, data sets: ['M2', 'M1', 'M3']
index: 32, serial_number: 040, data sets: ['M2', 'M1', 'M3']
index: 33, serial_number: 041, data sets: ['M2', 'M1', 'M3']
index: 34, serial_number: 042, data sets: ['M2', 'M1', 'M3']
index: 35, serial_number: 043, data sets: ['M2', 'M1', 'M3']
index: 36, serial_number: 044, data sets: ['M2', 'M1', 'M3']
index: 37, serial_number: 045, data sets: ['M2', 'M1', 'M3']
index: 38, serial_number: 046, data sets: ['M2', 'M1', 'M3']
index: 39, serial_number: 047, data sets: ['M2', 'M1', 'M3']
index: 40, serial_number: 048, data sets: ['M2', 'M1', 'M3']
index: 41, serial_number: 049, data sets: ['M2', 'M1', 'M3']
index: 42, serial_number: 050, data sets: ['M2', 'M1', 'M3']
index: 43, serial_number: 051, data sets: ['M2', 'M1', 'M3']
index: 44, serial_number: 052, data sets: ['M2', 'M1', 'M3']
index: 45, serial_number: 053, data sets: ['M1', 'M2', 'M3']
index: 46, serial_number: 054, data sets: ['M2', 'M1', 'M3']
index: 47, serial_number: 055, data sets: ['M2', 'M1', 'M3']
index: 48, serial_number: 056, data sets: ['M2', 'M1', 'M3']
index: 49, serial_number: 057, data sets: ['M2', 'M1', 'M3']
index: 50, serial_number: 058, data sets: ['M2', 'M1', 'M3']

Maximum Integrated Quadrupole


In [4]:
# gets integrated strength at maximum current for all magnets
data.main_intmpole_at_max_current('M2')


index:00, serial:007, idx:11, max_current:  +129.9842 [A], diff_spec: +13.33 [%]
index:01, serial:009, idx:11, max_current:  +130.0191 [A], diff_spec: +13.48 [%]
index:02, serial:010, idx:11, max_current:  +130.0032 [A], diff_spec: +13.20 [%]
index:03, serial:011, idx:11, max_current:  +129.9993 [A], diff_spec: +13.31 [%]
index:04, serial:012, idx:11, max_current:  +130.0081 [A], diff_spec: +13.40 [%]
index:05, serial:013, idx:11, max_current:  +130.0112 [A], diff_spec: +13.31 [%]
index:06, serial:014, idx:11, max_current:  +130.0035 [A], diff_spec: +13.18 [%]
index:07, serial:015, idx:11, max_current:  +130.0126 [A], diff_spec: +13.19 [%]
index:08, serial:016, idx:11, max_current:  +130.0188 [A], diff_spec: +13.34 [%]
index:09, serial:017, idx:11, max_current:  +129.9981 [A], diff_spec: +13.28 [%]
index:10, serial:018, idx:11, max_current:  +130.0175 [A], diff_spec: +13.36 [%]
index:11, serial:019, idx:11, max_current:  +130.0127 [A], diff_spec: +13.34 [%]
index:12, serial:020, idx:11, max_current:  +130.0030 [A], diff_spec: +13.39 [%]
index:13, serial:021, idx:11, max_current:  +130.0206 [A], diff_spec: +13.40 [%]
index:14, serial:022, idx:11, max_current:  +129.9993 [A], diff_spec: +13.50 [%]
index:15, serial:023, idx:11, max_current:  +129.9952 [A], diff_spec: +13.54 [%]
index:16, serial:024, idx:11, max_current:  +130.0077 [A], diff_spec: +13.48 [%]
index:17, serial:025, idx:11, max_current:  +130.0002 [A], diff_spec: +13.46 [%]
index:18, serial:026, idx:11, max_current:  +130.0013 [A], diff_spec: +13.54 [%]
index:19, serial:027, idx:11, max_current:  +130.0071 [A], diff_spec: +13.31 [%]
index:20, serial:028, idx:11, max_current:  +130.0257 [A], diff_spec: +13.36 [%]
index:21, serial:029, idx:11, max_current:  +130.0188 [A], diff_spec: +13.39 [%]
index:22, serial:030, idx:11, max_current:  +130.0227 [A], diff_spec: +13.44 [%]
index:23, serial:031, idx:11, max_current:  +130.0044 [A], diff_spec: +13.42 [%]
index:24, serial:032, idx:11, max_current:  +130.0120 [A], diff_spec: +13.44 [%]
index:25, serial:033, idx:11, max_current:  +130.0085 [A], diff_spec: +13.40 [%]
index:26, serial:034, idx:11, max_current:  +130.0267 [A], diff_spec: +13.42 [%]
index:27, serial:035, idx:11, max_current:  +130.0060 [A], diff_spec: +13.42 [%]
index:28, serial:036, idx:11, max_current:  +130.0248 [A], diff_spec: +13.50 [%]
index:29, serial:037, idx:11, max_current:  +130.0122 [A], diff_spec: +13.35 [%]
index:30, serial:038, idx:11, max_current:  +130.0097 [A], diff_spec: +13.33 [%]
index:31, serial:039, idx:11, max_current:  +130.0105 [A], diff_spec: +13.25 [%]
index:32, serial:040, idx:11, max_current:  +130.0270 [A], diff_spec: +13.30 [%]
index:33, serial:041, idx:11, max_current:  +130.0166 [A], diff_spec: +13.31 [%]
index:34, serial:042, idx:11, max_current:  +129.9266 [A], diff_spec: +13.49 [%]
index:35, serial:043, idx:11, max_current:  +130.0011 [A], diff_spec: +13.49 [%]
index:36, serial:044, idx:11, max_current:  +130.0010 [A], diff_spec: +13.55 [%]
index:37, serial:045, idx:11, max_current:  +129.9999 [A], diff_spec: +13.58 [%]
index:38, serial:046, idx:11, max_current:  +129.9999 [A], diff_spec: +13.40 [%]
index:39, serial:047, idx:11, max_current:  +130.0107 [A], diff_spec: +13.21 [%]
index:40, serial:048, idx:11, max_current:  +130.0059 [A], diff_spec: +13.49 [%]
index:41, serial:049, idx:11, max_current:  +129.9999 [A], diff_spec: +13.36 [%]
index:42, serial:050, idx:11, max_current:  +129.9987 [A], diff_spec: +13.35 [%]
index:43, serial:051, idx:11, max_current:  +130.0201 [A], diff_spec: +13.39 [%]
index:44, serial:052, idx:11, max_current:  +130.0114 [A], diff_spec: +13.30 [%]
index:45, serial:053, idx:11, max_current:  +130.0091 [A], diff_spec: +13.31 [%]
index:46, serial:054, idx:11, max_current:  +130.0136 [A], diff_spec: +13.38 [%]
index:47, serial:055, idx:11, max_current:  +130.0065 [A], diff_spec: +13.38 [%]
index:48, serial:056, idx:11, max_current:  +130.0136 [A], diff_spec: +13.37 [%]
index:49, serial:057, idx:11, max_current:  +130.0107 [A], diff_spec: +13.54 [%]
index:50, serial:058, idx:11, max_current:  +130.0073 [A], diff_spec: +13.54 [%]

In [5]:
# plot data comparison with spec
data.main_intmpole_at_max_current_plot(plt)
plt.show()


Magnetic Center


In [6]:
# Horizontal center for all magnets x currents
plt.figure()
data.magnetic_center_direction_plot('M2', 'X', plt)
plt.show()

# each magnet is represented by two curves: one rampup and one rampdown


Horizontal center at maximum current [um]: -12.66 ± 21.15

In [7]:
# Vertical center for all magnets y currents
plt.figure()
data.magnetic_center_direction_plot('M2', 'Y', plt)
plt.show()

# each magnet is represented by two curves: one rampup and one rampdown


Vertical center at maximum current [um]: +23.92 ± 17.59

In [9]:
# Horizontal and vertical positions of all magnets
plt.figure()
data.magnetic_center_plot('M2', plt)
# data.magnetic_center_plot('M3', plt)
plt.show()



In [10]:
# Transverse plane positions
plt.figure()
data.magnetic_center_transverse_plot('M2', plt)
plt.show()


Ramp Up


In [11]:
# Plot rampup integrated strength of main multipole and compare it to nominal values and maximum spec
plt.figure()
data.rampup_excitation_curve_plot('M2', plt)
plt.show()


Nominal Integrated Quadrupole [T]:
BO-Fam:MA-QF    : -3.773610

In [12]:
# Plot rampup dispersion amongst magnets
plt.figure()
data.rampup_excitation_curve_dispersion_plot('M2', plt)
plt.show()



In [13]:
# Print random integrated main strength for various currents
data.rampup_excitation_curve_rms_error_print('M2')


current:   +0.008 [A], rms_error:  5.8940 [%], max_error: 14.3630 [%]
current:   +2.007 [A], rms_error:  0.6013 [%], max_error:  1.3903 [%]
current:   +4.007 [A], rms_error:  0.3019 [%], max_error:  0.6552 [%]
current:   +6.005 [A], rms_error:  0.2013 [%], max_error:  0.4268 [%]
current:   +8.004 [A], rms_error:  0.1470 [%], max_error:  0.3180 [%]
current:  +10.002 [A], rms_error:  0.1288 [%], max_error:  0.4080 [%]
current:  +30.001 [A], rms_error:  0.0567 [%], max_error:  0.1250 [%]
current:  +50.004 [A], rms_error:  0.0533 [%], max_error:  0.1148 [%]
current:  +70.009 [A], rms_error:  0.0527 [%], max_error:  0.1173 [%]
current:  +90.009 [A], rms_error:  0.0556 [%], max_error:  0.1280 [%]
current: +110.010 [A], rms_error:  0.0676 [%], max_error:  0.1728 [%]
current: +130.008 [A], rms_error:  0.0860 [%], max_error:  0.1858 [%]

In [14]:
# Plot Integrated Quadrupole Error for maximum current
plt.figure()
data.rampup_excitation_curve_rms_error_plot(plt)
plt.show()


Hysteresis


In [15]:
# Absolute
plt.figure()
data.hysteresis_absolute_plot('M2', plt)
plt.show()



In [16]:
# Relative
plt.figure()
data.hysteresis_relative_plot('M2', plt)
plt.show()


Save Excitation Data Files


In [17]:
# save average excitation data to file

data.save_excdata_average('M2')

In [4]:
# save excitation data of all magnets to separate files
data.save_excdata_individuals('M2')

Multipoles


In [18]:
# Horizontal kick

plt.figure()
data.multipole_errors_kickx_plot('M2', plt)
plt.show()



In [19]:
# Vertical kick

# BD-021: big skew error!
plt.figure()
data.multipole_errors_kicky_plot('M2', plt)
plt.show()


Magnets Sorting


In [20]:
med = 'M2'
print('Rampup')
c, gl = data.tmpl.get_rampup(med)
for i in range(len(c)):
    print('{:02d}: I = {:8.4f} A => GL = {:+.4f} T'.format(i, c[i], gl[i]))


Rampup
00: I =  -0.0009 A => GL = -0.0088 T
01: I =   1.9982 A => GL = -0.0827 T
02: I =   3.9968 A => GL = -0.1568 T
03: I =   5.9945 A => GL = -0.2312 T
04: I =   7.9937 A => GL = -0.3057 T
05: I =   9.9916 A => GL = -0.3803 T
06: I =  29.9878 A => GL = -1.1311 T
07: I =  49.9883 A => GL = -1.8850 T
08: I =  69.9897 A => GL = -2.6370 T
09: I =  89.9878 A => GL = -3.3829 T
10: I = 109.9875 A => GL = -4.1173 T
11: I = 129.9842 A => GL = -4.8225 T

In [22]:
cidx = 10
print('Booster QF Quadrupoles Magnetic Center and Integrated Quadrupole')
print(80*'='+'\n')
print('As measured with rotcoil for I = {0:3.0f}A (nominal GL @ 3 GeV is ~100A)\n'.format(c[cidx]))
print('{0:7s} |{1:^29s} |{2:^29s} |{3:^29s} |'.format('Magnet', 'M1', 'M2', 'M3'))
print('{0:7s} |'.format(''), end='')
st = '{:>8s} {:>8s} {:>10s} |'.format('x0 [mm]', 'y0 [mm]', 'GL/I [T/mA]')
print(3*st)
for s in data:
    print('BQF-{} |'.format(s), end='')
    for med in ['M1', 'M2', 'M3']:
        x = data[s].get_magnetic_center_x(med)[cidx]
        y = data[s].get_magnetic_center_y(med)[cidx]
        c, gl = data[s].get_rampup(med)
        print('{:+8.1f} {:+8.1f} {:+10.4f}  |'.format(x, y, 1000*gl[cidx]/c[cidx]), end='')
    print()


Booster QF Quadrupoles Magnetic Center and Integrated Quadrupole
================================================================================

As measured with rotcoil for I = 110A (nominal GL @ 3 GeV is ~100A)

Magnet  |             M1               |             M2               |             M3               |
        | x0 [mm]  y0 [mm] GL/I [T/mA] | x0 [mm]  y0 [mm] GL/I [T/mA] | x0 [mm]  y0 [mm] GL/I [T/mA] |
BQF-007 |   -12.2    +33.6   -37.4327  |   -12.4    +33.5   -37.4340  |   -12.1    +33.1   -37.4328  |
BQF-009 |   -14.3    +15.7   -37.4638  |   -14.3    +15.4   -37.4653  |   -14.4    +15.4   -37.4659  |
BQF-010 |  -129.9    -76.3   -37.3957  |  -130.2    -76.4   -37.3961  |  -130.3    -76.4   -37.3959  |
BQF-011 |    -1.5    +10.5   -37.4359  |    -2.0    +11.2   -37.4368  |    -2.2    +11.4   -37.4368  |
BQF-012 |   -21.6    +46.2   -37.4668  |   -21.0    +45.9   -37.4655  |   -21.1    +39.6   -37.4695  |
BQF-013 |    +0.5    +26.5   -37.4366  |    +0.1    +26.3   -37.4365  |    +0.6    +26.2   -37.4364  |
BQF-014 |    -6.7    +18.0   -37.3840  |    -6.9    +18.5   -37.3846  |    -7.5    +18.8   -37.3842  |
BQF-015 |    -6.9    +26.6   -37.3814  |    -7.0    +26.2   -37.3816  |    -7.0    +26.1   -37.3817  |
BQF-016 |   +10.1    +44.4   -37.4390  |   +10.2    +44.1   -37.4384  |   +10.3    +43.6   -37.4382  |
BQF-017 |   -26.4    +20.1   -37.4280  |   -26.5    +20.1   -37.4286  |   -26.6    +19.1   -37.4280  |
BQF-018 |   +12.1    +35.1   -37.4538  |   +12.0    +34.9   -37.4542  |   +11.9    +33.6   -37.4538  |
BQF-019 |   -11.1    +30.0   -37.4422  |   -11.0    +29.7   -37.4418  |   -10.7    +29.5   -37.4418  |
BQF-020 |   -12.8    +16.3   -37.4668  |   -12.9    +16.3   -37.4664  |    +1.2    +16.1   -37.4667  |
BQF-021 |    -3.2    +44.6   -37.4621  |    -3.6    +36.8   -37.4644  |    -3.6    +37.1   -37.4645  |
BQF-022 |   -13.3    +28.6   -37.4895  |   -14.2    +28.8   -37.4898  |   -14.4    +28.7   -37.4896  |
BQF-023 |   -24.2    +28.2   -37.4770  |   -24.6    +28.1   -37.4772  |   -24.8    +27.7   -37.4770  |
BQF-024 |    +3.6    +24.1   -37.4645  |    +3.2    +16.2   -37.4663  |    +3.0    +16.5   -37.4673  |
BQF-025 |   -44.2    +23.4   -37.4538  |   -44.4    +23.1   -37.4543  |   -44.3    +22.9   -37.4540  |
BQF-026 |   +14.6    +37.7   -37.4917  |   +14.1    +37.6   -37.4903  |   +13.9    +37.4   -37.4899  |
BQF-027 |   -18.8    +35.6   -37.4241  |   -18.8    +35.3   -37.4246  |   -18.6    +35.0   -37.4245  |
BQF-028 |   -20.7    +34.6   -37.4319  |   -21.0    +31.7   -37.4324  |   -21.0    +31.9   -37.4322  |
BQF-029 |    -1.5    +34.8   -37.4420  |    -2.0    +34.7   -37.4424  |    -2.2    +34.5   -37.4426  |
BQF-030 |   -21.0    +29.4   -37.4476  |   -17.5    +28.7   -37.4479  |   -17.6    +27.9   -37.4490  |
BQF-031 |    -0.8    +30.1   -37.4435  |    -1.1    +29.9   -37.4441  |    -1.3    +29.4   -37.4439  |
BQF-032 |   -36.3    +31.8   -37.4554  |   -37.2    +31.2   -37.4552  |   -37.2    +30.9   -37.4548  |
BQF-033 |    -7.9    +19.1   -37.4162  |    -8.0    +19.0   -37.4510  |    -8.4    +18.5   -37.4510  |
BQF-034 |   -10.4    +20.3   -37.4353  |   -11.7    +16.6   -37.4372  |   -11.7    +16.6   -37.4374  |
BQF-035 |   -18.0    +18.1   -37.4560  |   -18.6    +18.6   -37.4549  |   -18.4    +18.7   -37.4529  |
BQF-036 |   -10.1    +26.3   -37.4672  |   -10.3    +25.6   -37.4679  |   -10.4    +24.7   -37.4677  |
BQF-037 |    -5.3    +37.9   -37.4366  |    -5.1    +37.8   -37.4345  |    -5.2    +37.7   -37.4337  |
BQF-038 |    -5.7    +34.9   -37.4385  |    -5.9    +33.7   -37.4377  |    -6.0    +33.4   -37.4380  |
BQF-039 |    -8.2    +31.6   -37.4178  |    -8.5    +31.0   -37.4186  |    -8.7    +30.5   -37.4186  |
BQF-040 |    -2.0    +29.9   -37.4285  |    -2.7    +29.5   -37.4297  |    -3.0    +29.3   -37.4293  |
BQF-041 |   -13.3    +17.6   -37.4312  |   -13.5    +16.2   -37.4311  |    -6.7    +15.7   -37.4317  |
BQF-042 |   -18.2    +17.0   -37.4934  |   -19.2    +17.0   -37.4938  |   -19.3    +16.6   -37.4939  |
BQF-043 |    -1.1     +7.6   -37.4748  |    -1.4     +7.5   -37.4756  |    -1.7     +7.6   -37.4759  |
BQF-044 |   -39.4    +24.6   -37.4902  |   -39.5    +23.6   -37.4903  |   -33.7    +22.9   -37.4904  |
BQF-045 |   -28.4    +19.4   -37.4843  |   -28.5    +19.3   -37.4845  |   -28.7    +19.0   -37.4846  |
BQF-046 |   +13.1    +32.5   -37.4445  |   +13.1    +32.3   -37.4448  |   +14.2    +31.8   -37.4436  |
BQF-047 |   -23.2    +21.4   -37.3971  |   -23.3    +21.4   -37.3965  |   -23.2    +21.0   -37.3956  |
BQF-048 |   -15.7    +21.8   -37.4626  |   -16.9    +21.2   -37.4636  |   -17.1    +20.6   -37.4643  |
BQF-049 |   -13.7    +31.6   -37.4414  |   -13.9    +32.3   -37.4405  |   -14.1    +32.6   -37.4393  |
BQF-050 |   -30.5    +39.8   -37.4326  |   -30.3    +39.5   -37.4326  |   -29.9    +39.3   -37.4297  |
BQF-051 |   -10.4    +15.8   -37.4458  |   -10.8    +16.0   -37.4459  |   -10.9    +15.8   -37.4459  |
BQF-052 |   -14.2    +35.2   -37.4182  |   -12.6    +34.6   -37.4182  |   -12.6    +34.2   -37.4182  |
BQF-053 |    -7.4    +22.4   -37.4191  |    -7.8    +16.4   -37.4212  |    -7.9    +16.9   -37.4208  |
BQF-054 |    -1.9    +28.4   -37.4323  |    -2.0    +28.1   -37.4336  |    -2.2    +27.7   -37.4340  |
BQF-055 |   +10.3    +15.8   -37.4315  |   +10.6    +16.2   -37.4325  |   +10.2    +16.2   -37.4321  |
BQF-056 |   -32.1    +19.6   -37.4317  |   -26.8    +19.8   -37.4333  |   -27.6    +19.9   -37.4322  |
BQF-057 |    +2.9    +18.3   -37.4825  |    +2.5    +17.4   -37.4833  |    +2.4    +17.0   -37.4832  |
BQF-058 |    +6.2    +41.8   -37.4761  |    +6.2    +40.9   -37.4758  |    +6.2    +40.6   -37.4757  |

In [23]:
cidx = 2
print('Booster QF Quadrupoles Magnetic Center and Integrated Quadrupole')
print(80*'='+'\n')
print('As measured with rotcoil for I = {0:3.0f}A (nominal GL @ 3 GeV is ~100A)\n'.format(c[cidx]))
print('{0:7s} |{1:^29s} |{2:^29s} |{3:^29s} |'.format('Magnet', 'M1', 'M2', 'M3'))
print('{0:7s} |'.format(''), end='')
st = '{:>8s} {:>8s} {:>10s} |'.format('x0 [mm]', 'y0 [mm]', 'GL/I [T/mA]')
print(3*st)
for s in data:
    print('BQF-{} |'.format(s), end='')
    for med in ['M1', 'M2', 'M3']:
        x = data[s].get_magnetic_center_x(med)[cidx]
        y = data[s].get_magnetic_center_y(med)[cidx]
        c, gl = data[s].get_rampup(med)
        print('{:+8.1f} {:+8.1f} {:+10.4f}  |'.format(x, y, 1000*gl[cidx]/c[cidx]), end='')
    print()


Booster QF Quadrupoles Magnetic Center and Integrated Quadrupole
================================================================================

As measured with rotcoil for I =   4A (nominal GL @ 3 GeV is ~100A)

Magnet  |             M1               |             M2               |             M3               |
        | x0 [mm]  y0 [mm] GL/I [T/mA] | x0 [mm]  y0 [mm] GL/I [T/mA] | x0 [mm]  y0 [mm] GL/I [T/mA] |
BQF-007 |   -19.4    +73.8   -39.1930  |   -23.7    +72.1   -39.2199  |   -24.9    +64.0   -39.2280  |
BQF-009 |   -20.6    +21.9   -39.1750  |   -20.1    +18.2   -39.1881  |   -19.3    +19.0   -39.1913  |
BQF-010 |  -124.4    -52.1   -39.2987  |  -123.8    -49.4   -39.3053  |  -124.2    -53.3   -39.3105  |
BQF-011 |    +4.2    -20.3   -39.1905  |    +2.1    -16.2   -39.2045  |    +2.0    -19.2   -39.2126  |
BQF-012 |   -62.6    +37.9   -39.4883  |   -38.5    +39.3   -39.4855  |   -38.1    +29.1   -39.4525  |
BQF-013 |   -10.9    +13.8   -39.2678  |    -7.2    +19.5   -39.2776  |    -8.3    +13.6   -39.2809  |
BQF-014 |   -26.9     +1.9   -39.2900  |   -28.9     +1.1   -39.3086  |   -22.0     +1.3   -39.3152  |
BQF-015 |   -24.6    -16.2   -39.4028  |   -23.9    -15.3   -39.4108  |   -24.4     -9.5   -39.4133  |
BQF-016 |    -2.9    +42.8   -39.3615  |    -4.1    +40.1   -39.3685  |    -3.2    +40.8   -39.3697  |
BQF-017 |   -17.8    +14.4   -39.2856  |   -18.9    +23.7   -39.2915  |   -18.3    +19.9   -39.2930  |
BQF-018 |    -9.2    +39.3   -39.3085  |   -11.5    +36.9   -39.3174  |   -12.1    +42.3   -39.3109  |
BQF-019 |   -25.0    +26.3   -39.2351  |   -25.6    +24.0   -39.2351  |   -27.2    +29.1   -39.2481  |
BQF-020 |   -13.6    +67.7   -39.3365  |   -11.6    +65.3   -39.3469  |    +3.2    +65.0   -39.1903  |
BQF-021 |   -21.6    +51.8   -39.3786  |   -19.2    +47.7   -39.3761  |   -17.6    +42.1   -39.3733  |
BQF-022 |   -23.1    -12.3   -39.4878  |   -20.0     -6.8   -39.4773  |   -17.3     -2.3   -39.4870  |
BQF-023 |   -40.5    +82.7   -39.1740  |   -39.9    +86.8   -39.2064  |   -37.3    +78.0   -39.2108  |
BQF-024 |    -6.2    +40.7   -39.5028  |    -7.0    +36.0   -39.4607  |    -7.7    +40.8   -39.5106  |
BQF-025 |   -52.1    +32.0   -39.1964  |   -50.6    +35.2   -39.2146  |   -52.9    +38.0   -39.2190  |
BQF-026 |    -3.9    +27.6   -39.3821  |    -4.0    +30.2   -39.3892  |    -5.5    +36.6   -39.3952  |
BQF-027 |   -33.3    +19.1   -39.3809  |   -34.9    +18.6   -39.3906  |   -32.8    +22.8   -39.3823  |
BQF-028 |   -53.5    +44.0   -39.2560  |   -52.8    +38.0   -39.2599  |   -52.3    +36.0   -39.2700  |
BQF-029 |   -19.3    +61.3   -39.1464  |   -18.8    +65.3   -39.1587  |   -18.4    +61.8   -39.1651  |
BQF-030 |   -58.6    +40.9   -39.2140  |   -54.4    +42.6   -39.2337  |   -57.7    +42.9   -39.2318  |
BQF-031 |   -21.0     +8.4   -39.0977  |   -18.1     +8.2   -39.1160  |   -18.0    +11.5   -39.1175  |
BQF-032 |   -45.5    +42.2   -39.1804  |   -44.9    +36.9   -39.1904  |   -44.9    +42.1   -39.1983  |
BQF-033 |   -18.1    +27.7   -36.9757  |   -11.0    +47.1   -39.1903  |   -13.1    +44.1   -39.1956  |
BQF-034 |   -52.3    +21.6   -39.1590  |   -46.7    +29.1   -39.1783  |   -47.6    +15.9   -39.1869  |
BQF-035 |   -20.5    +18.4   -39.0963  |   -20.4    +24.3   -39.1237  |   -21.7    +26.7   -39.1216  |
BQF-036 |   -28.9    +54.0   -39.1485  |   -32.4    +52.7   -39.1697  |   -30.8    +51.3   -39.1672  |
BQF-037 |    -3.5   +106.1   -39.0904  |    -4.0   +114.2   -39.1184  |    -5.4   +111.8   -39.1167  |
BQF-038 |   -30.5    +48.9   -39.1660  |   -32.2    +48.4   -39.1800  |   -33.2    +43.5   -39.1905  |
BQF-039 |   -18.6    +51.9   -39.1999  |   -21.2    +45.5   -39.2164  |   -22.9    +49.6   -39.2151  |
BQF-040 |   -17.2    +48.3   -39.1160  |   -16.7    +53.4   -39.1444  |   -18.2    +48.3   -39.1439  |
BQF-041 |   -37.7    +28.5   -39.1475  |   -40.8    +31.5   -39.1729  |   -34.9    +21.2   -39.1763  |
BQF-042 |   -49.0    +57.7   -39.1781  |   -45.4    +47.0   -39.2099  |   -47.3    +50.0   -39.2143  |
BQF-043 |   -16.5    +34.7   -39.1957  |   -14.4    +38.4   -39.2044  |   -16.0    +31.6   -39.2070  |
BQF-044 |   -68.1     +9.2   -39.1643  |   -65.1     +5.5   -39.1809  |   -66.4    +10.7   -39.1838  |
BQF-045 |   -39.5    +41.9   -39.0463  |   -38.0    +43.0   -39.0697  |   -38.4    +48.7   -39.0816  |
BQF-046 |   -23.8    +52.3   -39.2911  |   -22.4    +62.2   -39.3007  |    +8.5    +51.5   -39.2947  |
BQF-047 |   -55.1    +18.9   -39.2543  |   -56.9    +30.2   -39.2616  |   -58.0    +24.2   -39.2561  |
BQF-048 |   -52.8     +5.8   -39.1922  |   -46.8     +9.2   -39.2077  |   -47.2     +2.0   -39.2045  |
BQF-049 |    -3.4    +23.8   -39.3786  |    -5.3    +20.1   -39.3868  |    -5.6    +27.4   -39.3704  |
BQF-050 |   -78.2    +42.9   -39.1819  |   -79.0    +37.9   -39.1868  |   -82.1    +41.7   -39.1815  |
BQF-051 |   -30.1     -8.9   -39.2654  |   -29.4     -2.3   -39.2717  |   -31.8     -5.5   -39.2703  |
BQF-052 |   -23.7    +46.2   -39.1657  |   -25.9    +42.9   -39.1817  |   -26.5    +48.4   -39.1795  |
BQF-053 |   -33.8    +56.3   -39.1737  |   -33.2    +55.9   -39.2014  |   -33.2    +56.4   -39.1899  |
BQF-054 |   -22.2    +17.5   -39.0826  |   -21.2    +23.1   -39.1079  |   -21.3    +13.0   -39.1118  |
BQF-055 |   -39.2     -2.3   -39.0207  |   -37.6     +0.8   -39.0786  |   -37.1     +4.3   -39.0512  |
BQF-056 |   -26.3    +15.5   -39.0661  |   -18.9    +16.4   -39.0849  |   -21.1    +18.2   -39.0801  |
BQF-057 |   -14.6    -26.7   -39.0945  |    -8.1    -31.0   -39.1253  |    -9.4    -20.2   -39.1343  |
BQF-058 |    -5.6    +52.8   -39.2144  |    -6.3    +55.2   -39.2164  |    -5.5    +56.6   -39.2160  |

In [24]:
cidx = 2
med = 'M2'
current_avg = np.zeros(len(data))
current_std = np.zeros(len(data))
gl = np.zeros(len(data))
for i, s in enumerate(data):
    current_avg[i] = data[s].get_currents_avg(med)[cidx]
    current_std[i] = data[s].get_currents_std(med)[cidx]
    gl[i] = data[s].get_intmpole_normal_avg(med, data[s].main_harmonic)[cidx]
    
plt.figure()
plt.plot(current_avg/current_avg.mean()-1, label='I_avg')
plt.plot(gl/gl.mean()-1, label='GL_avg')
plt.plot(current_std, label='I_std')
plt.legend(loc='best')
plt.grid(True)
plt.show()



In [25]:
cidx = 2
med = 'M3'
current_avg = np.zeros(len(data))
current_std = np.zeros(len(data))
gl = np.zeros(len(data))
for i, s in enumerate(data):
    current_avg[i] = data[s].get_currents_avg(med)[cidx]
    current_std[i] = data[s].get_currents_std(med)[cidx]
    gl[i] = data[s].get_intmpole_normal_avg(med, data[s].main_harmonic)[cidx]
    
plt.figure()
plt.plot(current_avg/current_avg.mean()-1, label='I_avg')
plt.plot(gl/gl.mean()-1, label='GL_avg')
plt.plot(current_std, label='I_std')
plt.legend(loc='best')
plt.grid(True)
plt.show()



In [26]:
cidx = 2
med = 'M1'
current_avg = np.zeros(len(data))
current_std = np.zeros(len(data))
gl = np.zeros(len(data))
for i, s in enumerate(data):
    current_avg[i] = data[s].get_currents_avg(med)[cidx]
    current_std[i] = data[s].get_currents_std(med)[cidx]
    gl[i] = data[s].get_intmpole_normal_avg(med, data[s].main_harmonic)[cidx]
    
plt.figure()
plt.plot(current_avg/current_avg.mean()-1, label='I_avg')
plt.plot(gl/gl.mean()-1, label='GL_avg')
plt.plot(current_std, label='I_std')
plt.legend(loc='best')
plt.grid(True)
plt.show()