interface from Xiangkun Li
- An interface script for Astra and Genesis
- Version 1.0.0
Download the repository
git clone https://XiangkunLi@bitbucket.org/XiangkunLi/interface.gitGo to the folder where setup.py is and run
python setup.py install
# or
pip install .Using pip is preferred because the source file will be copied to the python library folder.
To load the modules, use
from interface import *-
For
Astrarelated interface, seetutorials/astra/astra_demo.ipynbor here. -
For more details on how to use it for parameter scan or global optimization, see
interface/tutorials/astra/README.md. -
For batch generating Genesis 1.3 input files, see
tutorials/genesis13/genesis13_demo.ipynbor here -
For postprocessing of Genesis 1.3 simulations, see
tutorials/genesis13/postG4_demo.ipynbor here -
For optics optimization using ocelot, see
tutorials/ocelot/README.mdor here
NOTE: There are also local instructions.
There are mainly three data types involved to use these classes:
- non-array type, e.g., int, float, double or boolean: used to define variables, such as
sig_xorZstop1 - 1D array-like type, e.g., a tuple: (1, 2, 3), or a list [1, 2, 3], or an
Numpyarray: numpy.array([1, 2, 3]), used to define 1D variables, such asMaxE - 2D array-like type, could also be tuple or list or
Numpyarray, used to define special 2D variables such asD1from theDipolenamelist
The fieldmaps are define with 1D array-like type, the elements of which are strings (str type).
Note that the quadrupoles and 3D fieldmaps seem not support the use of absolute paths.
02.10.2021
- Renamed Namelist.py to Namelists.p; renamed postG4.py to postGenesis13.py. The relevant importing in other files should be updated as well.