From: Jean-Philippe ARGAUD Date: Fri, 1 May 2020 09:48:39 +0000 (+0200) Subject: Minor documentation improvements X-Git-Tag: V9_5_0b~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3cbb4aaa64edc2fe165e917456f416e3817ee92c;p=modules%2Fadao.git Minor documentation improvements --- diff --git a/doc/en/ref_algorithm_ExtendedBlue.rst b/doc/en/ref_algorithm_ExtendedBlue.rst index 264fde8..df9b268 100644 --- a/doc/en/ref_algorithm_ExtendedBlue.rst +++ b/doc/en/ref_algorithm_ExtendedBlue.rst @@ -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 index 0000000..03ef1ca --- /dev/null +++ b/doc/en/scripts/simple_ExtendedBlue.py @@ -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 index 0000000..d319ffe --- /dev/null +++ b/doc/en/scripts/simple_ExtendedBlue.res @@ -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]] diff --git a/doc/fr/ref_algorithm_ExtendedBlue.rst b/doc/fr/ref_algorithm_ExtendedBlue.rst index 546cc69..08e5afe 100644 --- a/doc/fr/ref_algorithm_ExtendedBlue.rst +++ b/doc/fr/ref_algorithm_ExtendedBlue.rst @@ -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 index 0000000..fcb97fa --- /dev/null +++ b/doc/fr/scripts/simple_ExtendedBlue.py @@ -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 index 0000000..e57a93b --- /dev/null +++ b/doc/fr/scripts/simple_ExtendedBlue.res @@ -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]]