Skip to content
Snippets Groups Projects
Commit 1e162531 authored by Gamelin Alexis's avatar Gamelin Alexis
Browse files

Small changes on energy_loss method

Modify the docstrings and add some precisions.
parent 5615ee30
No related branches found
No related tags found
No related merge requests found
......@@ -253,19 +253,19 @@ class WakePotential(Element):
return fig
def energy_loss(self, bunch, compare_to='theory'):
def energy_loss(self, bunch, compare_to='num'):
"""
Calculate the energy loss from the wake potential and can be compared
to a theoretical value or a numerical value.
Calculate the energy loss from the wake potential and compare it to a
reference value assuming a Gaussian bunch.
Parameters
----------
bunch : Bunch object
compare_to : {"theory", "num"}, optional
The method of calculating the reference energy loss. Use 'theory' for
a theorytecal value computed from the analytical loss factor [1],
or use 'num' for a numerical result obtained from loss_factor method
in Impedance class.
compare_to : str, {"theory", "num"}, optional
The method for calculating the reference energy loss. Use 'theory'
for the analytical loss factor of a resonator [1], or use 'num'
for a numerical result obtained from loss_factor method in
Impedance class.
Returns
-------
......@@ -275,7 +275,7 @@ class WakePotential(Element):
Reference
---------
[1] A. W. Chao and M. Tigner, "Handbook of Accelerator Physics and
Engineering", 3rd printing, pp.239
Engineering", 3rd printing, p.239
"""
......@@ -299,7 +299,7 @@ class WakePotential(Element):
delta_Eloss = (Eloss-Eloss_0) / Eloss_0 *100
column = ['Eloss', 'Eloss_ref', '% error']
column = ['Energy loss [eV]', 'Reference energy loss [eV]', 'Relative error [%]']
energy_loss_data = pd.DataFrame(np.reshape([Eloss, Eloss_0, delta_Eloss], (1,3)),
columns=column)
return energy_loss_data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment