Skip to content

ocelot.adaptors.elegant_lattice_converter -- remove initialization from elegant2ocelot and put to init() #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
iagapov opened this issue Jul 6, 2020 · 2 comments
Assignees

Comments

@iagapov
Copy link
Collaborator

iagapov commented Jul 6, 2020

do initialisation for the elegant converter like so:

def init(self):
self.init_convert_matrix()

then missing elements could be added:

from ocelot.adaptors.elegant_lattice_converter import *
conv = ElegantLatticeConverter()
conv.elegant_matrix['KQUAD'] = {'type': Quadrupole, 'params': {'L':'l', 'K1':'k1', "K2": "k2", 'TILT': 'tilt'}}
conv.elegant_matrix['KSEXT'] = {'type': Sextupole, 'params': {'L':'l', 'K2':'k2'}}
conv.elegant_matrix['KOCT'] = {'type': Octupole, 'params': {'L':'l', 'K3':'k3'}}

conv.elegant_matrix['CSBEND'] = {'type': SBend,'params':{'L': 'l', 'ANGLE': 'angle', "K1": "k1", "K2": "k2", "FINT": "fint",'E1': 'e1', 'E2': 'e2', "HGAP": ["gap", "2"], 'TILT': 'tilt'}}

read_cell = conv.elegant2ocelot('p4-cell.lte')
lattice = MagneticLattice(read_cell)

@sergey-tomin
Copy link
Collaborator

Submit a pull request with proposed changes

@iagapov
Copy link
Collaborator Author

iagapov commented Jul 7, 2020

just move
self.init_convert_matrix()

to init()
no need for pull request for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants