The pymad package contains all parts of the general API. The abstract classes are placed in cern.pymad.abc. In additions we have some tools which are used by both implementations, found in cern.pymad.tools
Created on 15 Aug 2011
@author: kfuchsbe
The abstract class for a model-service.
Create a model instance from a model definition.
Arguments: modeldef – the model definition from which to create the model as an
object or just its name. If a name is given, then the modeldefinition is first searched in the available model definitions.
Created on 15 Aug 2011
Module author: Kajetan Fuchsberger <Kajetan.Fuchsberger@cern.ch>
A collection of tools which can be useful to the end user are documented here.
Simple function which loads a tfs file:
from cern import pymad
table,summary=pymad.tfs('file.tfs')
You can then access e.g. the horizontal beta in several equivalent ways:
table.betx
table.BETX
table['betx']
table['BETX']
All these four methods will return the same object. Naming scheme follows the convention from Mad-X.
It is possible to get the list of available keys:
table.keys()
summary.keys()