diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2019-02-15 16:09:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-15 16:09:34 +0000 |
commit | 5ff4c802b06b9e7c1fe557c324bd7041b331f4a8 (patch) | |
tree | d037755d6796311e171edb59b76636f2e2647e77 /Wrappers | |
parent | aecb2e7a494e53d6ef78daf0c158be385e29f03a (diff) | |
download | framework-5ff4c802b06b9e7c1fe557c324bd7041b331f4a8.tar.gz framework-5ff4c802b06b9e7c1fe557c324bd7041b331f4a8.tar.bz2 framework-5ff4c802b06b9e7c1fe557c324bd7041b331f4a8.tar.xz framework-5ff4c802b06b9e7c1fe557c324bd7041b331f4a8.zip |
add norm to DataContainer (#195)
Diffstat (limited to 'Wrappers')
-rw-r--r-- | Wrappers/Python/ccpi/framework.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Wrappers/Python/ccpi/framework.py b/Wrappers/Python/ccpi/framework.py index 9938fb7..318eb92 100644 --- a/Wrappers/Python/ccpi/framework.py +++ b/Wrappers/Python/ccpi/framework.py @@ -720,6 +720,10 @@ class DataContainer(object): ## reductions def sum(self, out=None, *args, **kwargs): return self.as_array().sum(*args, **kwargs) + def norm(self): + '''return the norm of the DataContainer''' + y = self.as_array() + return numpy.dot(y, y.conjugate()) class ImageData(DataContainer): '''DataContainer for holding 2D or 3D DataContainer''' |