Adding reference scripts
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user