Skip to main content

tool for loading any MADX table files like twiss tables etc..

Project description

Python Twiss Tool


This tool can be used to read any table produced by MAD-X, not only twiss tables.


Installation

clone the git directory and then run in a terminal

pip install twisstool

Usage

from twisstool import twiss

tw = twiss('madxTableFile.txt')

The created instance of twiss named tw contains (at least) two attributes:

  • header containing a list of the columns found in the file
  • data containing a pandas dataframe containing the data found in the columns
  • any global parameter found in the header

If one would want to plot $\beta_x$ as a function of $s$, one could do:
import matplotlib.pyplot as plt

plt.plot(tw.data['S'], tw.data['BETX'])
plt.show()

Or you can use the following:

tw.plot('S', 'BETX')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twisstool-1.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file twisstool-1.2-py3-none-any.whl.

File metadata

  • Download URL: twisstool-1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.14.2 setuptools/40.7.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.7

File hashes

Hashes for twisstool-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ecda823f7b54dd3e909e95c9c978db0b0c5ca4963569fd179643810e8618a43f
MD5 9fa2596cbb5dc0cded0be43827b47b04
BLAKE2b-256 92b45429458cef63b3d370a1da413866d70b0ae48b8fa883865ef2b47bf28118

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page