|
83 | 83 | opticsfile="acc-models-lhc/operation/optics/R2022a_A30cmC30cmA10mL200cm.madx", |
84 | 84 | stdout=False, |
85 | 85 | ) |
86 | | -df = twiss.get_twiss_tfs(madx) |
87 | | -ips = get_lhc_ips_positions(df) |
| 86 | +twiss_df = twiss.get_twiss_tfs(madx) |
| 87 | +ips = get_lhc_ips_positions(twiss_df) |
88 | 88 |
|
89 | 89 | with plt.rc_context(_SPHINX_GALLERY_PARAMS): |
90 | 90 | fig, ax = plt.subplots(figsize=(18, 10)) |
91 | | - ax.plot(df.S, df.BETX / 1e3, label=r"$\beta_x$") |
92 | | - ax.plot(df.S, df.BETY / 1e3, label=r"$\beta_y$") |
| 91 | + ax.plot(twiss_df.S, twiss_df.BETX / 1e3, label=r"$\beta_x$") |
| 92 | + ax.plot(twiss_df.S, twiss_df.BETY / 1e3, label=r"$\beta_y$") |
93 | 93 | draw_ip_locations(ips) |
94 | 94 | ax.set_xlabel("Longitudinal location [m]") |
95 | 95 | ax.set_ylabel(r"$\beta_{x,y}$ [km]") |
|
111 | 111 | # above becomes: |
112 | 112 |
|
113 | 113 | with lhc.LHCSetup(run=3, opticsfile="R2022a_A30cmC30cmA10mL200cm.madx", stdout=False) as madx: |
114 | | - df = twiss.get_twiss_tfs(madx) |
115 | | - ips = get_lhc_ips_positions(df) |
| 114 | + twiss_df = twiss.get_twiss_tfs(madx) |
| 115 | + ips = get_lhc_ips_positions(twiss_df) |
116 | 116 |
|
117 | 117 | with plt.rc_context(_SPHINX_GALLERY_PARAMS): |
118 | 118 | fig, ax = plt.subplots(figsize=(18, 10)) |
119 | | - ax.plot(df.S, df.BETX / 1e3, label=r"$\beta_x$") |
120 | | - ax.plot(df.S, df.BETY / 1e3, label=r"$\beta_y$") |
| 119 | + ax.plot(twiss_df.S, twiss_df.BETX / 1e3, label=r"$\beta_x$") |
| 120 | + ax.plot(twiss_df.S, twiss_df.BETY / 1e3, label=r"$\beta_y$") |
121 | 121 | draw_ip_locations(ips) |
122 | 122 | ax.set_xlabel("Longitudinal location [m]") |
123 | 123 | ax.set_ylabel(r"$\beta_{x,y}$ [km]") |
|
133 | 133 | # IP5 for two different optics. Here below for the 2022 proton injection optics: |
134 | 134 |
|
135 | 135 | with lhc.LHCSetup(run=3, opticsfile="R2022a_A11mC11mA10mL10m.madx", stdout=False) as madx: |
136 | | - df = twiss.get_twiss_tfs(madx) |
137 | | - ips = get_lhc_ips_positions(df) |
| 136 | + twiss_df = twiss.get_twiss_tfs(madx) |
| 137 | + ips = get_lhc_ips_positions(twiss_df) |
138 | 138 | limits = (ips["IP5"] - 500, ips["IP5"] + 500) |
139 | 139 |
|
140 | 140 | with plt.rc_context(_SPHINX_GALLERY_PARAMS): |
|
172 | 172 | madx.call("lhc/aperture.b1.madx") |
173 | 173 | madx.call("lhc/aper_tol.b1.madx") |
174 | 174 |
|
175 | | - df = twiss.get_twiss_tfs(madx) |
176 | | - ips = get_lhc_ips_positions(df) |
| 175 | + twiss_df = twiss.get_twiss_tfs(madx) |
| 176 | + ips = get_lhc_ips_positions(twiss_df) |
177 | 177 | limits = (ips["IP5"] - 350, ips["IP5"] + 350) |
178 | 178 |
|
179 | 179 | with plt.rc_context(_SPHINX_GALLERY_PARAMS): |
|
0 commit comments