SF+ matching and support for ELegant lattice export

This commit is contained in:
reiche committed 2026-10-13 09:39:40 +02:00
1 parent 85b8e89917
commit 4e9a35b0e7
8 files changed
+818 -323

No files matched your search

+5
View File
@@ -84,6 +84,7 @@ class MatchMaker:
def match(self, om, variables = None, initCond=None, Injector=True, Athos = True, Aramis = False, Porthos = False, full =False):
self.matchresult.clear()
cwd = os.getcwd()
os.chdir(self.scriptdir)
@@ -97,6 +98,10 @@ class MatchMaker:
f = io.StringIO()
madx = CMadX(f)
madx.E0 = 2000
if initCond['energy']> 0:
madx.E0 = initCond['energy']
om.forceEnergyAt('SINLH02.MBND100', madx.E0 * 1e6)
print('Updating initial Energy to:',madx.E0)
om.setBranch(target, 'SINLH01')
madx.updateLattice(om, target) # write lattice
madx.commonHeader('SwissFEL', '#s/#e', None) # sets header