def setUp(self): self.model=cpymad.model('LHC (LSA)') self.model._cmd('option,-twiss_print')
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()
def create_model(self, modeldef): self._models.append( model(self.model_locator.get_model(modeldef))) self._am=self._models[-1] return self._am
def setUp(self): self.model=cpymad.model('lhc-beam4') self.model._cmd('option,-twiss_print')
def test_aperture(self): ''' Tests a specific aperture from LHC model ''' self.model=cpymad.model('lhc') aper,pars=self.model.aperture(madrange='ir2')
def setUp(self): self.model=cpymad.model('ilc-4.50m') self.model._cmd('option,-twiss_print')
def setUp(self): self.model=cpymad.model('clic') self.model._cmd('option,-twiss_print')
def setUp(self): self.model = cpymad.model("ilc") self.model._cmd("option,-twiss_print")