Skip to content

Commit 086e4c1

Browse files
Merge branch 'release/0.96.1'
2 parents 890ffd5 + c2b88e1 commit 086e4c1

File tree

21 files changed

+152851
-60709
lines changed

21 files changed

+152851
-60709
lines changed

test_data/hllhc14_no_errors_with_coupling_knobs/000_generate_line_jsons.py

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,26 @@
1010
import xpart as xp
1111
import xobjects as xo
1212

13-
mad_b1 = Madx()
13+
env = xt.load('lhcb1_seq.madx')
14+
line_b1 = env.lhcb1
15+
line_b1.set_particle_ref('proton', energy0=7000e9)
1416

15-
mad_b1.call("lhcb1_seq.madx")
16-
mad_b1.use('lhcb1')
17-
mad_b1.twiss()
18-
19-
line_b1 = xt.Line.from_madx_sequence(sequence=mad_b1.sequence.lhcb1,
20-
deferred_expressions=True, apply_madx_errors=True, install_apertures=True)
21-
line_b1.particle_ref = xp.Particles(mass0=xp.PROTON_MASS_EV, q0=1,
22-
gamma0=mad_b1.sequence.lhcb1.beam.gamma)
17+
# Set cavity frequency
18+
tt_cav = line_b1.get_table().rows.match(element_type='Cavity')
19+
for nn in tt_cav['name']:
20+
line_b1[nn].frequency = 400.79e6
2321

2422
with open('line_b1.json', 'w') as fid:
2523
json.dump(line_b1.to_dict(), fid, cls=xo.JEncoder)
2624

27-
mad_b4 = Madx()
28-
mad_b4.call("lhcb4_seq.madx")
29-
mad_b4.use('lhcb2')
30-
mad_b4.twiss()
31-
32-
line_b4 = xt.Line.from_madx_sequence(sequence=mad_b4.sequence.lhcb2,
33-
deferred_expressions=True, apply_madx_errors=True, install_apertures=True)
25+
env4 = xt.load('lhcb4_seq.madx')
26+
line_b4 = env4.lhcb2
27+
line_b4.set_particle_ref('proton', energy0=7000e9)
3428

35-
line_b4.particle_ref = xp.Particles(mass0=xp.PROTON_MASS_EV, q0=1,
36-
gamma0=mad_b4.sequence.lhcb2.beam.gamma)
29+
# Set cavity frequency
30+
tt_cav = line_b4.get_table().rows.match(element_type='Cavity')
31+
for nn in tt_cav['name']:
32+
line_b4[nn].frequency = 400.79e6
3733

3834
with open('line_b4.json', 'w') as fid:
3935
json.dump(line_b4.to_dict(), fid, cls=xo.JEncoder)
40-
41-
42-

test_data/hllhc14_no_errors_with_coupling_knobs/line_b1.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

test_data/hllhc14_no_errors_with_coupling_knobs/line_b4.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

test_data/sps_w_spacecharge/000_prepare_line.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,18 @@
2222
nemitt_x=2.5e-6
2323
nemitt_y=2.5e-6
2424

25-
mad = Madx()
26-
mad.call('sps_thin.seq')
27-
mad.use(seq_name)
25+
env = xt.load('sps_thin.seq')
26+
line = env.sps
27+
line.set_particle_ref('proton', energy0=26e9)
2828

29-
line = xt.Line.from_madx_sequence(
30-
mad.sequence[seq_name],
31-
install_apertures=True)
3229
# enable RF
3330
V_RF = 3e6
3431
line['acta.31637'].voltage = V_RF
3532
line['acta.31637'].lag = 180.
33+
line['acta.31637'].frequency = 200.266e6
3634

3735
# A test particle
38-
part = xp.Particles(gamma0=mad.sequence[seq_name].beam.gamma,
39-
mass0=xp.PROTON_MASS_EV)
40-
line.particle_ref = part.copy()
36+
part = line.particle_ref.copy()
4137
part.x += 2e-3
4238
part.y += 3e-3
4339
part.zeta += 20e-2

0 commit comments

Comments
 (0)