.. [Argaud09] Argaud J.-P., Bouriquet B., Hunt J., *Data Assimilation from Operational and Industrial Applications to Complex Systems*, Mathematics Today, pp.150-152, October 2009
+.. [GilBellosta15] Gil Bellosta C. J., *rPython: Package Allowing R to Call Python*, CRAN, 2015, https://cran.r-project.org/web/packages/rPython/ and http://rpython.r-forge.r-project.org/
+
.. [Bouttier99] Bouttier B., Courtier P., *Data assimilation concepts and methods*, Meteorological Training Course Lecture Series, ECMWF, 1999, http://www.ecmwf.int/sites/default/files/Data%20assimilation%20concepts%20and%20methods.pdf
.. [Bocquet04] Bocquet M., *Introduction aux principes et méthodes de l'assimilation de données en géophysique*, Lecture Notes, 2014, http://cerea.enpc.fr/HomePages/bocquet/Doc/assim-mb.pdf
.. [Kalnay03] Kalnay E., *Atmospheric Modeling, Data Assimilation and Predictability*, Cambridge University Press, 2003
-.. [Koenker00] Koenker R., Hallock K. F., *Quantile Regression: an Introduction*, 2000, available at http://www.econ.uiuc.edu/~roger/research/intro/intro.html
+.. [Koenker00] Koenker R., Hallock K. F., *Quantile Regression: an Introduction*, 2000, http://www.econ.uiuc.edu/~roger/research/intro/intro.html
.. [Koenker01] Koenker R., Hallock K. F., *Quantile Regression*, Journal of Economic Perspectives, 15(4), pp.143-156, 2001
.. [Powell] Powell M.J.D., *An efficient method for finding the minimum of a function of several variables without calculating derivatives*, Computer Journal, 7(2), pp.155-162, 1964
+.. [R] *The R Project for Statistical Computing*, http://www.r-project.org/
+
.. [Salome] *SALOME The Open Source Integration Platform for Numerical Simulation*, http://www.salome-platform.org/
.. [SalomeMeca] *Salome_Meca and Code_Aster, Analysis of Structures and Thermomechanics for Studies & Research*, http://www.code-aster.org/
**[DocR]** Textual Application Programming Interface for the user (API/TUI)
================================================================================
-.. warning::
-
- in its present version, this text programming interface (TUI) is experimental,
- and so changes can be required in forthcoming versions.
-
This section presents advanced usage of the ADAO module using its text
programming interface (API/TUI). This interface gives ability to create a
calculation object in a similar way than the case building obtained through the
:ref:`section_ref_output_variables` and to the individual documentations of
the algorithms.
+.. _subsection_tui_advanced:
+
More advanced examples of ADAO TUI calculation case
---------------------------------------------------
.. [Argaud09] Argaud J.-P., Bouriquet B., Hunt J., *Data Assimilation from Operational and Industrial Applications to Complex Systems*, Mathematics Today, pp.150-152, October 2009
+.. [GilBellosta15] Gil Bellosta C. J., *rPython: Package Allowing R to Call Python*, CRAN, 2015, https://cran.r-project.org/web/packages/rPython/ and http://rpython.r-forge.r-project.org/
+
.. [Bouttier99] Bouttier B., Courtier P., *Data assimilation concepts and methods*, Meteorological Training Course Lecture Series, ECMWF, 1999, http://www.ecmwf.int/sites/default/files/Data%20assimilation%20concepts%20and%20methods.pdf
.. [Bocquet04] Bocquet M., *Introduction aux principes et méthodes de l'assimilation de données en géophysique*, Lecture Notes, 2014, http://cerea.enpc.fr/HomePages/bocquet/Doc/assim-mb.pdf
.. [Kalnay03] Kalnay E., *Atmospheric Modeling, Data Assimilation and Predictability*, Cambridge University Press, 2003
-.. [Koenker00] Koenker R., Hallock K. F., *Quantile Regression: an Introduction*, 2000, available at http://www.econ.uiuc.edu/~roger/research/intro/intro.html
+.. [Koenker00] Koenker R., Hallock K. F., *Quantile Regression: an Introduction*, 2000, http://www.econ.uiuc.edu/~roger/research/intro/intro.html
.. [Koenker01] Koenker R., Hallock K. F., *Quantile Regression*, Journal of Economic Perspectives, 15(4), pp.143-156, 2001
.. [Powell] Powell M.J.D., *An efficient method for finding the minimum of a function of several variables without calculating derivatives*, Computer Journal, 7(2), pp.155-162, 1964
+.. [R] *The R Project for Statistical Computing*, http://www.r-project.org/
+
.. [Salome] *SALOME The Open Source Integration Platform for Numerical Simulation*, http://www.salome-platform.org/
.. [SalomeMeca] *Salome_Meca et Code_Aster, Analyse des Structures et Thermomécanique pour les Etudes et la Recherche*, http://www.code-aster.org/
**[DocR]** Interface de programmation textuelle pour l'utilisateur (API/TUI)
================================================================================
-.. warning::
-
- dans sa présente version, cette interface de programmation textuelle (TUI) est
- expérimentale, et reste donc susceptible de changements dans les prochaines
- versions.
-
Cette section présente des méthodes avancées d'usage du module ADAO à l'aide de
son interface de programmation textuelle (API/TUI). Cette interface permet de
créer un objet de calcul de manière similaire à la construction d'un cas par
fois aux :ref:`section_ref_output_variables` et aux documentations
individuelles des algorithmes.
+.. _subsection_tui_advanced:
+
Exemples plus avancés de cas de calcul TUI ADAO
-----------------------------------------------
def addJdcInSalome(self, jdcPath):
debug("addJdcInSalome is called " + str(jdcPath))
# On gere nous meme l'etude
- pass
#######
#
test6701
test6702
test6703
+ test6901
)
cp -R $(DIR)test6701 $(SALOMETESTDIR)
cp -R $(DIR)test6702 $(SALOMETESTDIR)
cp -R $(DIR)test6703 $(SALOMETESTDIR)
+ cp -R $(DIR)test6901 $(SALOMETESTDIR)
cp $(DIR)CTestTestfileInstall.cmake.in $(SALOMETESTDIR)/CTestTestfile.cmake
uninstall-local:
rm -rf $(SALOMETESTDIR)/test6701
rm -rf $(SALOMETESTDIR)/test6702
rm -rf $(SALOMETESTDIR)/test6703
+ rm -rf $(SALOMETESTDIR)/test6901
rm $(SALOMETESTDIR)/CTestTestfile.cmake
-#!/usr/bin/env python
#-*-coding:iso-8859-1-*-
-"""Test des versions de modules"""
+#
+# 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 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
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+"Test des versions de modules"
-# Versions Calibre9/Jessie
+# ==============================================================================
+#
+# Versions minimales Calibre9/Jessie
+# ----------------------------------
minimal_python_version = "2.7.9"
minimal_numpy_version = "1.8.2"
minimal_scipy_version = "0.14.0"
#
return 0
-#===============================================================================
+# ==============================================================================
if __name__ == "__main__":
-
- print '\nAUTODIAGNOSTIC\n==============\n'
-
+ print '\n AUTODIAGNOSTIC \n'
minimalVersion()
sys.exit(testSysteme())
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#FILE(GLOB ADAO_TEST1001_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
-
SET(TEST_NAMES
HelloWorld
)
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#FILE(GLOB ADAO_TEST1001_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
-
SET(TEST_NAMES
Doc_TUI_Exemple_01
)
# ==============================================================================
def test1():
-
+ """Exemple"""
from numpy import array, matrix
import adaoBuilder
case = adaoBuilder.New()
case.set( 'ObservationOperator', Matrix='1 0 0;0 2 0;0 0 3' )
case.set( 'Observer', Variable="Analysis", Template="ValuePrinter" )
case.execute()
+ #
+ return 0
# ==============================================================================
if __name__ == "__main__":
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#FILE(GLOB ADAO_TEST1001_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
-
SET(TEST_NAMES
Doc_TUI_Exemple_02
)
# ==============================================================================
def test1():
-
+ """Exemple"""
from numpy import array, matrix
import adaoBuilder
case = adaoBuilder.New()
return case.get("Analysis")[-1]
def test2():
-
+ """Exemple"""
from numpy import array, matrix
import adaoBuilder
case = adaoBuilder.New()
return case.get("Analysis")[-1]
def almost_equal_vectors(v1, v2):
+ """Comparaison de deux vecteurs"""
print "\nMaximum of differences between the two :",max(abs(v2 - v1))
return max(abs(v2 - v1)) < 1.e-15
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#FILE(GLOB ADAO_TEST1001_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
-
SET(TEST_NAMES
Doc_TUI_Exemple_03
)
"Verification d'un exemple de la documentation"
# ==============================================================================
-
#
# Construction artificielle d'un exemple de donnees utilisateur
# -------------------------------------------------------------
# ==============================================================================
def test1():
- "Test"
+ "Exemple"
import numpy
import adaoBuilder
#
print "Optimal state...................:",numpy.ravel(Xoptimum)
print "Simulation at optimal state.....:",numpy.ravel(FX_at_optimum)
print
+ #
+ return 0
# ==============================================================================
if __name__ == "__main__":
--- /dev/null
+# Copyright (C) 2008-2016 EDF R&D
+#
+# This file is part of SALOME ADAO module
+#
+# 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, or (at your option) any later version.
+#
+# 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
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(TEST_NAMES
+ Verification_des_Assimilation_Algorithms
+ )
+
+FOREACH(tfile ${TEST_NAMES})
+ SET(TEST_NAME ADAO_${tfile})
+ ADD_TEST(${TEST_NAME} python ${tfile}.py)
+ #ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py)
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
+ENDFOREACH()
--- /dev/null
+#-*-coding:iso-8859-1-*-
+#
+# 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 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
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+"Verification de la disponibilite de l'ensemble des algorithmes"
+
+# ==============================================================================
+import adaoBuilder, numpy
+def test1():
+ """Verification de la disponibilite de l'ensemble des algorithmes"""
+ for algo in ("3DVAR", "Blue", "ExtendedBlue", "LinearLeastSquares", "NonLinearLeastSquares", ):
+ print
+ msg = "Algorithme en test : %s"%algo
+ print msg+"\n"+"="*len(msg)
+ #
+ adaopy = adaoBuilder.New()
+ adaopy.setAlgorithmParameters(Algorithm=algo, Parameters={"EpsilonMinimumExponent":-10, })
+ adaopy.setBackground (Vector = [0,1,2])
+ adaopy.setBackgroundError (ScalarSparseMatrix = 1.)
+ adaopy.setObservation (Vector = [0.5,1.5,2.5])
+ adaopy.setObservationError (DiagonalSparseMatrix = "1 1 1")
+ adaopy.setObservationOperator(Matrix = "1 0 0;0 2 0;0 0 3")
+ adaopy.setObserver("Analysis",Template="ValuePrinter")
+ adaopy.execute()
+ del adaopy
+ #
+ for algo in ("ExtendedKalmanFilter", "KalmanFilter", "UnscentedKalmanFilter", "4DVAR"):
+ print
+ msg = "Algorithme en test : %s"%algo
+ print msg+"\n"+"="*len(msg)
+ #
+ adaopy = adaoBuilder.New()
+ adaopy.setAlgorithmParameters(Algorithm=algo, Parameters={"EpsilonMinimumExponent":-10, })
+ adaopy.setBackground (Vector = [0,1,2])
+ adaopy.setBackgroundError (ScalarSparseMatrix = 1.)
+ adaopy.setObservation (Vector = [0.5,1.5,2.5])
+ adaopy.setObservationError (DiagonalSparseMatrix = "1 1 1")
+ adaopy.setObservationOperator(Matrix = "1 0 0;0 1 0;0 0 1")
+ adaopy.setEvolutionModel (Matrix = "1 0 0;0 1 0;0 0 1")
+ adaopy.setEvolutionError (ScalarSparseMatrix = 1.)
+ adaopy.setObserver("Analysis",Template="ValuePrinter")
+ adaopy.execute()
+ del adaopy
+ #
+ for algo in ("ParticleSwarmOptimization", "QuantileRegression", ):
+ print
+ msg = "Algorithme en test : %s"%algo
+ print msg+"\n"+"="*len(msg)
+ #
+ adaopy = adaoBuilder.New()
+ adaopy.setAlgorithmParameters(Algorithm=algo, Parameters={"BoxBounds":3*[[-1,3]], "SetSeed":1000, })
+ adaopy.setBackground (Vector = [0,1,2])
+ adaopy.setBackgroundError (ScalarSparseMatrix = 1.)
+ adaopy.setObservation (Vector = [0.5,1.5,2.5])
+ adaopy.setObservationError (DiagonalSparseMatrix = "1 1 1")
+ adaopy.setObservationOperator(Matrix = "1 0 0;0 1 0;0 0 1")
+ adaopy.setEvolutionModel (Matrix = "1 0 0;0 1 0;0 0 1")
+ adaopy.setEvolutionError (ScalarSparseMatrix = 1.)
+ adaopy.setObserver("Analysis",Template="ValuePrinter")
+ adaopy.execute()
+ del adaopy
+ #
+ for algo in ("EnsembleBlue", ):
+ print
+ msg = "Algorithme en test : %s"%algo
+ print msg+"\n"+"="*len(msg)
+ #
+ adaopy = adaoBuilder.New()
+ adaopy.setAlgorithmParameters(Algorithm=algo, Parameters={"SetSeed":1000, })
+ adaopy.setBackground (VectorSerie = 100*[[0,1,2]])
+ adaopy.setBackgroundError (ScalarSparseMatrix = 1.)
+ adaopy.setObservation (Vector = [0.5,1.5,2.5])
+ adaopy.setObservationError (DiagonalSparseMatrix = "1 1 1")
+ adaopy.setObservationOperator(Matrix = "1 0 0;0 1 0;0 0 1")
+ adaopy.setEvolutionModel (Matrix = "1 0 0;0 1 0;0 0 1")
+ adaopy.setEvolutionError (ScalarSparseMatrix = 1.)
+ adaopy.setObserver("Analysis",Template="ValuePrinter")
+ adaopy.execute()
+ del adaopy
+ #
+ return 0
+
+#===============================================================================
+if __name__ == "__main__":
+ print '\n AUTODIAGNOSTIC \n'
+ test1()