From a8548b2890473b5d1834d151246a22d441fa059f Mon Sep 17 00:00:00 2001 From: Dave Grote Date: Thu, 4 May 2017 16:24:16 -0700 Subject: Minor fixes for Python interface --- Python/pywarpx/PGroup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Python/pywarpx/PGroup.py') diff --git a/Python/pywarpx/PGroup.py b/Python/pywarpx/PGroup.py index 92f6b4484..bb8ad11e2 100644 --- a/Python/pywarpx/PGroup.py +++ b/Python/pywarpx/PGroup.py @@ -55,6 +55,10 @@ class PGroup(object): def addspecies(self): pass + def getnpid(self): + # --- The -3 is because the comps include the velocites + return _labwarpx.warpx_nComps() - 3 + npid = property(getnpid) def getnps(self): return np.array([len(self.xp)], dtype='l') @@ -104,7 +108,7 @@ class PGroup(object): uxp = self.getuxp(js) uyp = self.getuyp(js) uzp = self.getuzp(js) - return sqrt(1. - (uxp**2 + uyp**2 + uzp**2)/warpxC.c**2) + return np.sqrt(1. - (uxp**2 + uyp**2 + uzp**2)/_libwarpx.clight**2) gaminv = property(getgaminv) def getex(self, js=0): -- cgit v1.2.3