#-*-coding:iso-8859-1-*-
#
-# Copyright (C) 2008-2009 EDF R&D
+# Copyright (C) 2008-2016 EDF R&D
#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-__doc__ = """
- Calcul d'une RMS
-"""
-__author__ = "Jean-Philippe ARGAUD - Juillet 2008"
-
-import sys ; sys.path.insert(0, "../daCore")
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
-import math
-import numpy
-import Persistence
-from BasicObjects import Diagnostic
+import math, numpy
+from daCore import BasicObjects, Persistence
# ==============================================================================
-class ElementaryDiagnostic(Diagnostic,Persistence.OneScalar):
+class ElementaryDiagnostic(BasicObjects.Diagnostic,Persistence.OneScalar):
+ """
+ Calcul d'une RMS
+ """
def __init__(self, name = "", unit = "", basetype = None, parameters = {}):
- Diagnostic.__init__(self, name, parameters)
+ BasicObjects.Diagnostic.__init__(self, name, parameters)
Persistence.OneScalar.__init__( self, name, unit, basetype = float)
def _formula(self, V1, V2):
vect2 = [0,0,0,0,0,0,0,0,0,0]
D.calculate(vect1,vect2)
print " Les valeurs de RMS attendues sont les suivantes : [1.0, 1.0, 1.0, 3.0, 0.53162016515553656, 0.73784217096601323]"
- print " Les RMS obtenues................................:", D.valueserie()
- print " La moyenne......................................:", D.stepmean()
+ print " Les RMS obtenues................................:", D[:]
+ print " La moyenne......................................:", D.mean()
print