]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Minor documentation improvements
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Fri, 1 May 2020 09:48:39 +0000 (11:48 +0200)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Fri, 1 May 2020 09:48:39 +0000 (11:48 +0200)
doc/en/ref_algorithm_ExtendedBlue.rst
doc/en/scripts/simple_ExtendedBlue.py [new file with mode: 0644]
doc/en/scripts/simple_ExtendedBlue.res [new file with mode: 0644]
doc/fr/ref_algorithm_ExtendedBlue.rst
doc/fr/scripts/simple_ExtendedBlue.py [new file with mode: 0644]
doc/fr/scripts/simple_ExtendedBlue.res [new file with mode: 0644]

index 264fde8c58d5ff6acae2ba9ce0144771519c6c13..df9b26884c18ff8f5a77da0dc6f6abe00b8ec793 100644 (file)
@@ -162,6 +162,15 @@ StoreSupplementaryCalculations
 
 .. include:: snippets/SimulationQuantiles.rst
 
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo09.rst
+
+.. literalinclude:: scripts/simple_ExtendedBlue.py
+
+.. include:: snippets/Header2Algo10.rst
+
+.. literalinclude:: scripts/simple_ExtendedBlue.res
+
 .. ------------------------------------ ..
 .. include:: snippets/Header2Algo06.rst
 
diff --git a/doc/en/scripts/simple_ExtendedBlue.py b/doc/en/scripts/simple_ExtendedBlue.py
new file mode 100644 (file)
index 0000000..03ef1ca
--- /dev/null
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+#
+from numpy import array, ravel
+from adao import adaoBuilder
+case = adaoBuilder.New('')
+case.setBackground( Vector = array([0., 1., 2.]), Stored=True )
+case.setBackgroundError( ScalarSparseMatrix = 1. )
+case.setObservation( Vector=array([10., 11., 12.]), Stored=True )
+case.setObservationError( ScalarSparseMatrix = 1. )
+case.setObservationOperator( Matrix=array([[1., 0., 0.],
+                                           [0., 1., 0.],
+                                           [0., 0., 1.]]), )
+case.setAlgorithmParameters(
+    Algorithm='ExtendedBlue',
+    Parameters={
+        'StoreSupplementaryCalculations': [
+            'APosterioriCovariance',
+            ],
+        },
+    )
+case.execute()
+#
+#-------------------------------------------------------------------------------
+#
+print("Interpolation between two vectors, of observation and background")
+print("----------------------------------------------------------------")
+print("")
+print("Observation vector............:", ravel(case.get('Observation')))
+print("A priori background vector....:", ravel(case.get('Background')))
+print("")
+print("Expected theoretical state....:", ravel([5., 6., 7.]))
+print("")
+print("Interpolation result..........:", ravel(case.get('Analysis')[-1]))
+print("A posteriori covariance.......:\n", case.get('APosterioriCovariance')[-1])
diff --git a/doc/en/scripts/simple_ExtendedBlue.res b/doc/en/scripts/simple_ExtendedBlue.res
new file mode 100644 (file)
index 0000000..d319ffe
--- /dev/null
@@ -0,0 +1,13 @@
+Interpolation between two vectors, of observation and background
+----------------------------------------------------------------
+
+Observation vector............: [10. 11. 12.]
+A priori background vector....: [0. 1. 2.]
+
+Expected theoretical state....: [5. 6. 7.]
+
+Interpolation result..........: [5. 6. 7.]
+A posteriori covariance.......:
+ [[0.5 0.  0. ]
+ [0.  0.5 0. ]
+ [0.  0.  0.5]]
index 546cc69e0efdab2be2bd1bfda6d59ed13f045fc7..08e5afe41bcdcfc91f4afa64fb26b438b71ed64c 100644 (file)
@@ -162,6 +162,15 @@ StoreSupplementaryCalculations
 
 .. include:: snippets/SimulationQuantiles.rst
 
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo09.rst
+
+.. literalinclude:: scripts/simple_ExtendedBlue.py
+
+.. include:: snippets/Header2Algo10.rst
+
+.. literalinclude:: scripts/simple_ExtendedBlue.res
+
 .. ------------------------------------ ..
 .. include:: snippets/Header2Algo06.rst
 
diff --git a/doc/fr/scripts/simple_ExtendedBlue.py b/doc/fr/scripts/simple_ExtendedBlue.py
new file mode 100644 (file)
index 0000000..fcb97fa
--- /dev/null
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+#
+from numpy import array, ravel
+from adao import adaoBuilder
+case = adaoBuilder.New('')
+case.setBackground( Vector = array([0., 1., 2.]), Stored=True )
+case.setBackgroundError( ScalarSparseMatrix = 1. )
+case.setObservation( Vector=array([10., 11., 12.]), Stored=True )
+case.setObservationError( ScalarSparseMatrix = 1. )
+case.setObservationOperator( Matrix=array([[1., 0., 0.],
+                                           [0., 1., 0.],
+                                           [0., 0., 1.]]), )
+case.setAlgorithmParameters(
+    Algorithm='ExtendedBlue',
+    Parameters={
+        'StoreSupplementaryCalculations': [
+            'APosterioriCovariance',
+            ],
+        },
+    )
+case.execute()
+#
+#-------------------------------------------------------------------------------
+#
+print("Interpolation entre deux états vectoriels, observation et ébauche")
+print("-----------------------------------------------------------------")
+print("")
+print("Vecteur observation...........:", ravel(case.get('Observation')))
+print("Vecteur ébauche a priori......:", ravel(case.get('Background')))
+print("")
+print("État théorique attendu........:", ravel([5., 6., 7.]))
+print("")
+print("Résultat par interpolation....:", ravel(case.get('Analysis')[-1]))
+print("Covariance a posteriori.......:\n", case.get('APosterioriCovariance')[-1])
diff --git a/doc/fr/scripts/simple_ExtendedBlue.res b/doc/fr/scripts/simple_ExtendedBlue.res
new file mode 100644 (file)
index 0000000..e57a93b
--- /dev/null
@@ -0,0 +1,13 @@
+Interpolation entre deux états vectoriels, observation et ébauche
+-----------------------------------------------------------------
+
+Vecteur observation...........: [10. 11. 12.]
+Vecteur ébauche a priori......: [0. 1. 2.]
+
+État théorique attendu........: [5. 6. 7.]
+
+Résultat par interpolation....: [5. 6. 7.]
+Covariance a posteriori.......:
+ [[0.5 0.  0. ]
+ [0.  0.5 0. ]
+ [0.  0.  0.5]]