Uses MAD-X PTC to convert a MAD-X lattice to a Python object
Project description
madx-ptc-utils
Converts MAD-X sequences into callable python functions using the built in PTC functions in MAD-X.
Instructions
First have a .madx file that contains a sequence and beam info you want to convert to python (mylattice.madx).
Run the command
create-ptc-files path/to/mylattice.madx --ptc-order PTC_ORDER --ptc-dim PTC_DIM
A folder will be created in ./out which contains the PTC data for the map.
From you python code have the import statement from python_from_ptc import python_from_ptc.
Pass the path of the PTC folder in ./out to the function to get a callable python function.
PTC does not support all elements. Some of these elements can be removed without
affecting the PTC lattice. To comment them out use the rm-keyword command. For example
if you wanted to remove quadrupoles from mylattice.madx
rm-keyword path/to/mylattice.madx quadrupole
Any number of keywords can be given after the filename.
Note
It is sometimes best to run the program in the directory of the lattice file if it contains calls to other files.
create-ptc-files only supports 4-D and 6-D lattices. 4-D supports up to a PTC order of 19 while 6-D supports up to PTC order 9.
rm-keyword will NOT discriminate elements that affect the PTC data, use carefully.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file madx_ptc_utils-0.1.4.tar.gz.
File metadata
- Download URL: madx_ptc_utils-0.1.4.tar.gz
- Upload date:
- Size: 31.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe8276e76eee2c9d6c9733531cb3ce78af823e0ac59cb972463d87f4cba86e9e
|
|
| MD5 |
6622ef0f5360c212f662ddb847d05960
|
|
| BLAKE2b-256 |
81b73cb621a422f70cb90ac0a54bb6c55660af4749f56f0ac663a97fd70c9d21
|
File details
Details for the file madx_ptc_utils-0.1.4-py3-none-any.whl.
File metadata
- Download URL: madx_ptc_utils-0.1.4-py3-none-any.whl
- Upload date:
- Size: 32.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ad7fb3eac535ae9a159bc4fee181ed4b289707b557aeb46bab9cd252c83c640
|
|
| MD5 |
fc74886d5094a9dd688520a613f61e71
|
|
| BLAKE2b-256 |
df3b12802cc2cc72c0bd366d8dbf664a719f32da3f40c26b0ada53c4e2195a21
|