In all launching command Shell files examples, we choose to start and stop the
SALOME application server in the same script. It is not mandatory, but it is
-useful to avoid stalling SALOME sessions.
+useful to avoid stalling SALOME sessions.
The simplest example consist in only launching the given YACS sheme, which was
previously generated by the user in the graphical interface. In this case, after
xmlLoader = loader.YACSLoader()
xmlLoader.registerProcCataLoader()
try:
- catalogAd = r.loadCatalog("proc", "<ADAO YACS xml scheme>")
+ catalogAd = r.loadCatalog("proc", "<ADAO YACS xml scheme>")
+ r.addCatalog(catalogAd)
except:
- pass
- r.addCatalog(catalogAd)
+ pass
try:
p = xmlLoader.load("<ADAO YACS xml scheme>")
Moreover, the package "*rPython*" has to be available, it can be installed by
the user if required by the following R command::
- #-*-coding:iso-8859-1-*-
#
# IMPORTANT: to be run in R interpreter
# -------------------------------------
In the R interpreter, one can run the following commands, directly coming from
the simple example::
- #-*-coding:iso-8859-1-*-
#
# IMPORTANT: to be run in R interpreter
# -------------------------------------
observation and observation operator. We get in the end the optimal state also
in a R variable. The other lines are identical. The example thus becomes::
- #-*-coding:iso-8859-1-*-
#
# IMPORTANT: to be run in R interpreter
# -------------------------------------
.. index:: single: Observer Template
Some special internal optimization variables, used during calculations, can be
-monitored during the ADAO calculation. These variables can be printed,
-plotted, saved, etc. This can be done using "*observer*", that are scripts,
-each associated with one variable.
+monitored during the ADAO calculation. These variables can be printed, plotted,
+saved, etc. This can be done using "*observer*", that are commands gathered in
+scripts, each associated with one variable.
Some templates are available when editing the ADAO case in graphical editor.
These simple scripts can be customized by the user, either at the embedded
edition stage, or at the edition stage before execution, to improve the tuning
of the ADAO calculation.
-To implement these "*observer*" efficiently, one can look to the
+To implement these "*observer*" efficiently, one can look to the
:ref:`ref_observers_requirements`.
Getting more information when running a calculation
logging.getLogger().setLevel(logging.DEBUG)
The standard logging module default level is "*WARNING*", the default level in
-the ADAO module is "*INFO*".
+the ADAO module is "*INFO*".
It is also recommended to include some logging or debug mechanisms in the
simulation code, and use them in conjunction with the two previous methods. But
.. [Bouttier99] Bouttier B., Courtier P., *Data assimilation concepts and methods*, Meteorological Training Course Lecture Series, ECMWF, 1999
-.. [Bocquet04] Bocquet M., *Introduction aux principes et méthodes de l'assimilation de données en géophysique*, Lecture Notes, 2014
+.. [Bocquet04] Bocquet M., *Introduction aux principes et méthodes de l'assimilation de données en géophysique*, Lecture Notes, 2014
.. [Buchinsky98] Buchinsky M., *Recent Advances in Quantile Regression Models: A Practical Guidline for Empirical Research*, Journal of Human Resources, 33(1), pp.88-126, 1998
source_suffix = '.rst'
# The encoding of source files.
-#source_encoding = 'utf-8'
+source_encoding = 'utf-8'
# The master toctree document.
master_doc = 'index'
# If false, no module index is generated.
#latex_use_modindex = True
-source_encoding = 'iso-8859-15'
-
# -- Options for Epub output ---------------------------------------------------
# Bibliographic Dublin Core info.
* *ADAO, a SALOME module for Data Assimilation and Optimization*,
http://www.salome-platform.org/
- * *ADAO, un module SALOME pour l'Assimilation de Données et l'Aide à
+ * *ADAO, un module SALOME pour l'Assimilation de Données et l'Aide à
l'Optimisation*, http://www.salome-platform.org/
* *SALOME The Open Source Integration Platform for Numerical Simulation*,
For instance, we give some script lines that allow to get the number of
iterations of the optimization and the optimal value, and its size::
- print
- print " Number of iterations :", len(case.get("CostFunctionJ"))
+ print("")
+ print(" Number of iterations : %i"%len(case.get("CostFunctionJ")))
Xa = case.get("Analysis")
- print " Optimal analysis :", Xa[-1]
- print " Size of the analysis :", len(Xa[-1])
- print
+ print(" Optimal analysis : %s"%(Xa[-1],))
+ print(" Size of the analysis : %i"%len(Xa[-1]))
+ print("")
These lines can be very simply added to the initial example of ADAO TUI
calculation case given in :ref:`subsection_tui_example`.
.. index:: single: setObserver
**setObserver** (*Variable, Template, String, Script, Info*)
- This command allows to set an *observer* on the current or final calculation
- variable. Reference should be made to the description of the
- ':ref:`ref_observers_requirements` for their list and content, and to the
- :ref:`section_reference` to know what are the observable quantities. One
- defines as "*String*" the *observer* body, using a string including if
- necessary line breaks. It is recommended to use the patterns available by
- the argument "*Template*". In the case of a definition as "*Script*", the
- file must contain only the body of the function, as described in the
- :ref:`ref_observers_requirements`.
+ This command allows to set an *observer* on the current or final
+ calculation variable. Reference should be made to the description of the
+ ':ref:`ref_observers_requirements` for their list and content, and to the
+ :ref:`section_reference` to know what are the observable quantities. One
+ defines as "*String*" the *observer* body, using a string including if
+ necessary line breaks. It is recommended to use the patterns available by
+ the argument "*Template*". In the case of a definition as "*Script*", the
+ file must contain only the body of the function, as described in the
+ :ref:`ref_observers_requirements`. The "*Info*" variable contains an
+ information string or can be void.
Perform the calculation
+++++++++++++++++++++++
Xoptimum = case.get("Analysis")[-1]
FX_at_optimum = case.get("SimulatedObservationAtOptimum")[-1]
J_values = case.get("CostFunctionJ")[:]
- print
- print "Number of internal iterations...: %i"%len(J_values)
- print "Initial state...................:",numpy.ravel(Xbackground)
- print "Optimal state...................:",numpy.ravel(Xoptimum)
- print "Simulation at optimal state.....:",numpy.ravel(FX_at_optimum)
- print
+ print("")
+ print("Number of internal iterations...: %i"%len(J_values))
+ print("Initial state...................: %s"%(numpy.ravel(Xbackground),))
+ print("Optimal state...................: %s"%(numpy.ravel(Xoptimum),))
+ print("Simulation at optimal state.....: %s"%(numpy.ravel(FX_at_optimum),))
+ print("")
The command set execution gives the following result::