Skip to content

biaobin/xkinterface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

143 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

interface from Xiangkun Li

What is this repository for?

  • An interface script for Astra and Genesis
  • Version 1.0.0

How do I get set up?

Download the repository

git clone https://XiangkunLi@bitbucket.org/XiangkunLi/interface.git

Go 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 *

Tutorials with Jupyter notebook

  • For Astra related interface, see tutorials/astra/astra_demo.ipynb or 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.ipynb or here

  • For postprocessing of Genesis 1.3 simulations, see tutorials/genesis13/postG4_demo.ipynb or here

  • For optics optimization using ocelot, see tutorials/ocelot/README.md or here

NOTE: There are also local instructions.

About the Namelist/Generator1/Astra class

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_x or Zstop1
  • 1D array-like type, e.g., a tuple: (1, 2, 3), or a list [1, 2, 3], or an Numpy array: numpy.array([1, 2, 3]), used to define 1D variables, such as MaxE
  • 2D array-like type, could also be tuple or list or Numpy array, used to define special 2D variables such as D1 from the Dipole namelist

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.

Bugs and updates

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages