:mod:`ocelot.adaptors.elegant_lattice_converter` ================================================ .. py:module:: ocelot.adaptors.elegant_lattice_converter .. autoapi-nested-parse:: Elegant <--> Ocelot lattice converter Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: ocelot.adaptors.elegant_lattice_converter.ElegantLatticeConverter .. py:class:: ElegantLatticeConverter Main Elegant <--> Ocelot lattice converter class .. method:: init_convert_matrix(self) Init Elegant -> Ocelot convertion matrix in case of dict has list, e.g. 'VOLT':['v','1.0e-9'] it uses for translation different units e.g. eV to GeV in case, dict has list with len=3, e.g. 'R11': ['r', 0, 0] it uses as indices e.g. r[0, 0] .. method:: fix_convert_matrix(self) Init and fix Ocelot -> Elegant convertion matrix .. method:: calc_rpn(self, expression, constants={}, info='') Calculation of the expression written in reversed polish notation .. method:: convert_val(self, str, constants, info) Convert string input value to float or change input string value by value from constants array .. method:: elegant2ocelot(self, file_name) :filename - input Elegant lattice filename .. method:: replace_s_multiplications(self, line) Replace single multiplication of elements .. method:: replace_multiplications(self, line) Replace multiplication with brackets of elements .. method:: replace_cells(self, cell, elements_dict) Replace cells by elements .. method:: ocelot2elegant(self, lattice, file_name='lattice.lte') :lattice - Ocelot lattice objectl :filename - output Elegant lattice filename