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 😇
# 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")
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.
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.0.0.tar.gz
(7.4 kB
view hashes)
Built Distribution
Close
Hashes for mad8_pandas-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61c1a26f30f8113968984dd44f6522fd1fc2d0f0e3e15d77028547930af4b8b5 |
|
MD5 | 6f66adc254bd5863563e873f8ac5567a |
|
BLAKE2b-256 | 56da2ff7699221ddb909c2108f6860802e3f5e49baf447050be83352693b5697 |