SCRIPTWITHSWITCH_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')], fr="En attente d'un nom de fichier script, avec ou sans le chemin complet pour le trouver, contenant un switch pour les calculs direct, tangent et adjoint", ang="Waiting for a script file name, with or without the full path to find it, containing a switch for direct, tangent and adjoint computations"),
),
TEMPLATE_DATA = BLOC (condition = " FROM in ( 'Template', ) ",
- Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver")),
+ Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver", "AnalysisSeriePrinter", "AnalysisSerieSaver", "AnalysisSeriePrinterAndSaver")),
AnalysisPrinter = BLOC (condition = " Template == 'AnalysisPrinter' ",
- ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\\nxa=numpy.ravel(ADD.get('Analysis')[-1])\\nprint('Analysis:',xa)" ),
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print('# Post-analysis')\\nimport numpy\\nxa=ADD.get('Analysis')[-1]\\nprint('Analysis:',xa)" ),
),
AnalysisSaver = BLOC (condition = " Template == 'AnalysisSaver' ",
- ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\\nxa=numpy.ravel(ADD.get('Analysis')[-1])\\nf='/tmp/analysis.txt'\\nprint('Analysis saved in \\"%s\\"'%f)\\nnumpy.savetxt(f,xa)" ),
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print('# Post-analysis')\\nimport numpy\\nxa=ADD.get('Analysis')[-1]\\nf='/tmp/analysis.txt'\\nprint('Analysis saved in \\"%s\\"'%f)\\nnumpy.savetxt(f,xa)" ),
),
AnalysisPrinterAndSaver = BLOC (condition = " Template == 'AnalysisPrinterAndSaver' ",
- ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\\nxa=numpy.ravel(ADD.get('Analysis')[-1])\\nprint 'Analysis:',xa\\nf='/tmp/analysis.txt'\\nprint('Analysis saved in \\"%s\\"'%f)\\nnumpy.savetxt(f,xa)" ),
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print('# Post-analysis')\\nimport numpy\\nxa=ADD.get('Analysis')[-1]\\nprint 'Analysis:',xa\\nf='/tmp/analysis.txt'\\nprint('Analysis saved in \\"%s\\"'%f)\\nnumpy.savetxt(f,xa)" ),
+ ),
+ AnalysisSeriePrinter = BLOC (condition = " Template == 'AnalysisSeriePrinter' ",
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print('# Post-analysis')\\nimport numpy\\nxa=ADD.get('Analysis')\\nprint('Analysis:',xa)" ),
+ ),
+ AnalysisSerieSaver = BLOC (condition = " Template == 'AnalysisSerieSaver' ",
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print('# Post-analysis')\\nimport numpy\\nxa=ADD.get('Analysis')\\nf='/tmp/analysis.txt'\\nprint('Analysis saved in \\"%s\\"'%f)\\nnumpy.savetxt(f,xa)" ),
+ ),
+ AnalysisSeriePrinterAndSaver = BLOC (condition = " Template == 'AnalysisSeriePrinterAndSaver' ",
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print('# Post-analysis')\\nimport numpy\\nxa=ADD.get('Analysis')\\nprint 'Analysis:',xa\\nf='/tmp/analysis.txt'\\nprint('Analysis saved in \\"%s\\"'%f)\\nnumpy.savetxt(f,xa)" ),
),
),
)
sub-section "*Information and variables available at the end of the
algorithm*"): [
"Analysis",
+ "CurrentOptimum",
"CurrentState",
"Innovation",
"SimulatedObservationAtBackground",
.. include:: snippets/Analysis.rst
+.. include:: snippets/CurrentOptimum.rst
+
.. include:: snippets/CurrentState.rst
.. include:: snippets/Innovation.rst
A set of post-processing commands is a special Python script, which is
automatically activated at the end of the estimation calculations in ADAO. Any
-Python commands, which a user can add after a TUI calculation in ADAO, can be
+Python commands, which a user can add after a GUI calculation in ADAO, can be
part of this post-processing. Several command set templates are available by
default,essentially to give the simplest possible example of recording these
series.
To be usable in an automatic way, it is required that any call of the ADAO
calculation case, to recover a variable, is done only with the reserved name
-"*ADD*". As an example, here is a very simple script (similar to the
+"*ADD*". As an example, here is a very simple script (very similar to the
"*ValuePrinter*" template), usable to display the value of the optimal
estimate::
- print('# Post-analysis')
import numpy
xa = numpy.ravel(ADD.get('Analysis')[-1])
- print('Analysis',xa)
+ print(' === Analysis =',xa)
If the command "*ADD.get(...)*", used to obtain a result variable, does not use
the reserved name "*ADD*" for the calculation case, then the call will lead to
print('# Post-analysis')
import numpy
- xa=numpy.ravel(ADD.get('Analysis')[-1])
+ xa=ADD.get('Analysis')[-1]
print('Analysis',xa)
.. index:: single: AnalysisSaver (Observer)
print('# Post-analysis')
import numpy
- xa=numpy.ravel(ADD.get('Analysis')[-1])
+ xa=ADD.get('Analysis')[-1]
f='/tmp/analysis.txt'
print('Analysis saved in "%s"'%f)
numpy.savetxt(f,xa)
print('# Post-analysis')
import numpy
- xa=numpy.ravel(ADD.get('Analysis')[-1])
+ xa=ADD.get('Analysis')[-1]
+ print 'Analysis',xa
+ f='/tmp/analysis.txt'
+ print('Analysis saved in "%s"'%f)
+ numpy.savetxt(f,xa)
+
+.. index:: single: AnalysisSeriePrinter (Observer)
+
+Modèle **AnalysisSeriePrinter**
+...............................
+
+Print on standard output the optimal value series.
+
+::
+
+ print('# Post-analysis')
+ import numpy
+ xa=ADD.get('Analysis')
+ print('Analysis',xa)
+
+.. index:: single: AnalysisSerieSaver (Observer)
+
+Modèle **AnalysisSerieSaver**
+.............................
+
+Save the optimal value series in a file of the '/tmp' directory named 'analysis.txt'.
+
+::
+
+ print('# Post-analysis')
+ import numpy
+ xa=ADD.get('Analysis')
+ f='/tmp/analysis.txt'
+ print('Analysis saved in "%s"'%f)
+ numpy.savetxt(f,xa)
+
+.. index:: single: AnalysisSeriePrinterAndSaver (Observer)
+
+Modèle **AnalysisSeriePrinterAndSaver**
+.......................................
+
+Print on standard output and, in the same time save in a file of the '/tmp' directory, the optimal value series.
+
+::
+
+ print('# Post-analysis')
+ import numpy
+ xa=ADD.get('Analysis')
print 'Analysis',xa
f='/tmp/analysis.txt'
print('Analysis saved in "%s"'%f)
de cette documentation par algorithme spécifique, dans la sous-partie
"*Informations et variables disponibles à la fin de l'algorithme*") : [
"Analysis",
+ "CurrentOptimum",
"CurrentState",
"Innovation",
"SimulatedObservationAtBackground",
.. include:: snippets/Analysis.rst
+.. include:: snippets/CurrentOptimum.rst
+
.. include:: snippets/CurrentState.rst
.. include:: snippets/Innovation.rst
Une série de commandes de post-traitement est un script Python spécial, qui est
automatiquement activée à la fin des calculs d'estimation dans ADAO. Toutes les
commandes Python, qu'un utilisateur peut ajouter après un calcul ADAO en
-interface graphique TUI, peuvent faire partie de ce post-traitement. Plusieurs
+interface graphique GUI, peuvent faire partie de ce post-traitement. Plusieurs
modèles de série de commandes sont disponibles par défaut, essentiellement pour
donner un exemple le plus simple possible d'enregistrement de ces séries.
Pour être utilisable de manière automatique, il est requis tout appel du cas de
calcul ADAO, pour récupérer une variable, se fasse uniquement avec le nom
-réservé "*ADD*". A titre d'exemple, voici un script très simple (similaire au
-modèle "*ValuePrinter*"), utilisable pour afficher la valeur de l'estimation
+réservé "*ADD*". A titre d'exemple, voici un script très simple (très similaire
+au modèle "*ValuePrinter*"), utilisable pour afficher la valeur de l'estimation
optimale :
::
- print('# Post-analysis')
import numpy
xa = numpy.ravel(ADD.get('Analysis')[-1])
- print('Analysis',xa)
+ print(' === Analysis =',xa)
Si la commande "*ADD.get(...)*", utilisée pour l'obtention d'une variable
résultat, n'utilise pas le nom réservé "*ADD*" pour le cas de calcul, alors
print('# Post-analysis')
import numpy
- xa=numpy.ravel(ADD.get('Analysis')[-1])
+ xa=ADD.get('Analysis')[-1]
print('Analysis',xa)
.. index:: single: AnalysisSaver (Observer)
print('# Post-analysis')
import numpy
- xa=numpy.ravel(ADD.get('Analysis')[-1])
+ xa=ADD.get('Analysis')[-1]
f='/tmp/analysis.txt'
print('Analysis saved in "%s"'%f)
numpy.savetxt(f,xa)
print('# Post-analysis')
import numpy
- xa=numpy.ravel(ADD.get('Analysis')[-1])
+ xa=ADD.get('Analysis')[-1]
+ print 'Analysis',xa
+ f='/tmp/analysis.txt'
+ print('Analysis saved in "%s"'%f)
+ numpy.savetxt(f,xa)
+
+.. index:: single: AnalysisSeriePrinter (Observer)
+
+Modèle **AnalysisSeriePrinter**
+...............................
+
+Imprime sur la sortie standard la série des valeurs optimales.
+
+::
+
+ print('# Post-analysis')
+ import numpy
+ xa=ADD.get('Analysis')
+ print('Analysis',xa)
+
+.. index:: single: AnalysisSerieSaver (Observer)
+
+Modèle **AnalysisSerieSaver**
+.............................
+
+Enregistre la série des valeurs optimales dans un fichier du répertoire '/tmp' nommé 'analysis.txt'.
+
+::
+
+ print('# Post-analysis')
+ import numpy
+ xa=ADD.get('Analysis')
+ f='/tmp/analysis.txt'
+ print('Analysis saved in "%s"'%f)
+ numpy.savetxt(f,xa)
+
+.. index:: single: AnalysisSeriePrinterAndSaver (Observer)
+
+Modèle **AnalysisSeriePrinterAndSaver**
+.......................................
+
+Imprime sur la sortie standard et, en même temps enregistre dans un fichier du répertoire '/tmp', la série des valeurs optimales.
+
+::
+
+ print('# Post-analysis')
+ import numpy
+ xa=ADD.get('Analysis')
print 'Analysis',xa
f='/tmp/analysis.txt'
print('Analysis saved in "%s"'%f)
class OneMatrix(Persistence):
"""
- Classe de stockage d'une matrice de valeurs (numpy.matrix) par pas.
+ Classe de stockage d'une matrice de valeurs homogènes par pas.
"""
def __init__(self, name="", unit="", basetype = numpy.matrix):
Persistence.__init__(self, name, unit, basetype)