Esempio n. 1
0
 def setUp(self):
     self.model=cpymad.model('LHC (LSA)')
     self.model._cmd('option,-twiss_print')
Esempio n. 2
0
from matplotlib import pyplot as plt
from cern import cpymad as pm

# this one line does it "all":
# - starts madx
# - loads model lhc, default parameters
# - runs twiss on default sequence
# - returns the twiss table as a python lookup dictionary
# - since "reference count" for the model instance reaches zero,
#   madx process is terminated
tw=pm.model('lhc').twiss()[0]

# to prove it:
plt.plot(tw.s,tw.betx)
plt.show()
Esempio n. 3
0
 def create_model(self, modeldef):
     self._models.append(
         model(self.model_locator.get_model(modeldef)))
     self._am=self._models[-1]
     return self._am
Esempio n. 4
0
 def setUp(self):
     self.model=cpymad.model('lhc-beam4')
     self.model._cmd('option,-twiss_print')
Esempio n. 5
0
 def test_aperture(self):
     '''
      Tests a specific aperture from LHC model
     '''
     self.model=cpymad.model('lhc')
     aper,pars=self.model.aperture(madrange='ir2')
Esempio n. 6
0
 def setUp(self):
     self.model=cpymad.model('ilc-4.50m')
     self.model._cmd('option,-twiss_print')
Esempio n. 7
0
 def setUp(self):
     self.model=cpymad.model('clic')
     self.model._cmd('option,-twiss_print')
Esempio n. 8
0
 def setUp(self):
     self.model = cpymad.model("ilc")
     self.model._cmd("option,-twiss_print")