Adding reference scripts

This commit is contained in:
2025-05-28 17:55:03 +02:00
committed by Sven
parent 897bf75127
commit d11a57f446
7 changed files with 144 additions and 77 deletions
+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)