Adding reference scripts

This commit is contained in:
reiche authored and Sven committed 2026-01-26 12:51:49 +01:00
1 parent 897bf75127
commit d11a57f446
7 files changed
+144 -77

No files matched your search

+7 -4
View File
@@ -246,8 +246,13 @@ class Model:
target = config['target']
if 'Script' in target.keys():
res,twiss,err = self.madx.callScript(script = target['Script'],sequence=sequence, start=start, end=end,var=var)
self.endMatching()
res,twiss,err = self.madx.callScript(script = target['Script'],sequence=sequence, start=start, end=end,init=itwiss,var=var)
self.updateModelFromMatching(res)
self.parent.reference.updateMatchPoint(ID, err)
if self.matchplot:
energy = self.calcEnergyProfile(twiss)
self.parent.plot.newData(twiss, energy)
return
ncon = 0
@@ -282,9 +287,7 @@ class Model:
res,twiss,err=self.madx.match(sequence=sequence, start=start, end=end,
init=itwiss, var=var, const=condilist,
preset=False,random=random)
self.endMatching()
def endMatching(self):
self.updateModelFromMatching(res)
if config['save'] == True:
self.parent.reference.saveTwiss(ID,twiss)