From 1e162531abe8e751c8ed03c751da79afe94efd9a Mon Sep 17 00:00:00 2001
From: Gamelin Alexis <gamelin@synchrotron-soleil.fr>
Date: Wed, 14 Oct 2020 10:20:57 +0200
Subject: [PATCH] Small changes on energy_loss method

Modify the docstrings and add some precisions.
---
 tracking/wakepotential.py | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tracking/wakepotential.py b/tracking/wakepotential.py
index 7aeea5c..f9197bc 100644
--- a/tracking/wakepotential.py
+++ b/tracking/wakepotential.py
@@ -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
-- 
GitLab