load mad8 output with pandas
Project description
mad8-pandas
loading mad8 output with pandas
import pand8
df = pand8.read("TWISS_CL_T20.txt") # For example
# pandas stuff 😇
# Other bits...
# Fixing strangeness:
assert df.iloc[0].E == 0.0 # Wrong and annoying.
df = pand8.fix_initial_row_energy(df)
assert df.iloc[0].E != 0. # No longer wrong or annoying.
# Adding a few extra useful columns
import matplotlib.pyplot as plt
df = pand8.append_beam_size_columns(df, emitnx=1.4e-6, emitny=1.4e-6, espread_norm=1e-4)
df = pand8.append_twiss_gamma(df)
df.plot("SUML", "SIGMAX")
df.plot("SUML", "GAMX")
plt.show()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mad8-pandas-1.1.0.tar.gz
(7.6 kB
view hashes)
Built Distribution
Close
Hashes for mad8_pandas-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c1c27bebc11cc262f92b1aa21a0987fcbf61e154fe112ab637697cf52ca8e2a |
|
MD5 | d8a53c057c9a7168c20f7233aa628500 |
|
BLAKE2b-256 | 5bf9b9199837dc0b89bc9597253094b3dfb45aaadbdc3de5a5425639a9c5f893 |