3 ================================================================================
5 ================================================================================
7 .. |eficas_new| image:: images/eficas_new.png
9 .. |eficas_save| image:: images/eficas_save.png
11 .. |eficas_yacs| image:: images/eficas_yacs.png
14 This section presents the usage of the ADAO module in SALOME. It is complemented
15 by advanced usage procedures the section :ref:`section_advanced`, and by
16 examples in the section :ref:`section_examples`.
18 Logical procedure to build an ADAO test case
19 --------------------------------------------
21 The construction of an ADAO case follows a simple approach to define the set of
22 input data, either static or dynamic data, and then generates a complete block
23 diagram used in YACS. Many variations exist for the definition of input data,
24 but the logical sequence remains unchanged.
26 First of all, the user is considered to know the input data needed to set up the
27 data assimilation study. These data can be in SALOME or not.
29 **Basically, the procedure of using ADAO involves the following steps:**
31 #. **Activate the ADAO module and use the editor GUI,**
32 #. **Build and modify the ADAO case and save it,**
33 #. **Export the ADAO case as a YACS scheme,**
34 #. **Modify and supplement the YACS scheme and save it,**
35 #. **Execute the YACS case and obtain the results.**
37 Each step will be detailed in the next section.
39 Detailed procedure to build an ADAO test case
40 ---------------------------------------------
42 Activate the ADAO module and use the editor GUI
43 +++++++++++++++++++++++++++++++++++++++++++++++
45 As always for a module, it has to be activated by choosing the appropriate
46 module button (or menu) in the toolbar of SALOME. A popup appears, allowing to
47 choose between creating a new study, or opening an already existing one:
50 .. image:: images/adao_activate.png
54 **Activating the module ADAO in SALOME**
56 Choosing the "*New*" button, an embedded case editor EFICAS [#]_ will be opened,
57 along with the standard "*Object browser*". You can then click on the "*New*"
58 button |eficas_new| (or choose the "*New*" entry in the "*ADAO*" main menu) to
59 create a new ADAO case, and you will see:
62 .. image:: images/adao_viewer.png
66 **The EFICAS editor for cases definition in module ADAO**
68 It is a good habit to save the ADAO case now, by pushing the "*Save*" button
69 |eficas_save| or by choosing the "*Save/Save as*" entry in the "*ADAO*" menu.
70 You will be prompted for a location in your file tree and a name, that will be
71 completed by a "*.comm*" extension used for JDC EFICAS files.
73 Build and modify the ADAO case and save it
74 ++++++++++++++++++++++++++++++++++++++++++
76 To build a case using EFICAS, you have to go through a series of steps, by
77 selecting a keyword and then filling in its value.
79 The structured editor indicates hierarchical types, values or keywords allowed.
80 Incomplete or incorrect keywords are identified by a visual error red flag.
81 Possible values are indicated for keywords defined with a limited list of
82 values, and adapted entries are given for the other keywords. All the mandatory
83 command or keyword are already present, and optionnal commands can be added.
85 A new case is set up with the minimal list of commands. No mandatory command can
86 be suppressed, but others can be added as allowed keywords for an
87 "*ASSIMILATION_STUDY*" command. As an example, one can add an
88 "*AlgorithmParameters*" keyword, as described in the last part of the section
89 :ref:`section_examples`.
91 At the end, when all fields or keywords have been correctly defined, each line
92 of the commands tree must have a green flag. This indicates that the whole case
93 is valid and completed.
95 .. _adao_jdcexample00:
96 .. image:: images/adao_jdcexample01.png
100 **Example of a valid ADAO case**
102 Finally, you have to save your ADAO case by pushing the "*Save*" button
103 |eficas_save| or by choosing the "*Save/Save as*" entry in the "*ADAO*" menu.
105 Export the ADAO case as a YACS scheme
106 +++++++++++++++++++++++++++++++++++++
108 When the ADAO case is completed, you have to export it as a YACS scheme [#]_ in
109 order to execute the data assimilation calculation. This can be easily done by
110 using the "*Export to YACS*" button |eficas_yacs|, or equivalently choose the
111 "*Export to YACS*" entry in the "*ADAO*" main menu, or in the contextual case
112 menu in the object browser.
114 .. _adao_exporttoyacs:
115 .. image:: images/adao_exporttoyacs.png
119 **"Export to YACS" submenu to generate the YACS scheme from the ADAO case**
121 This will lead to automatically generate an XML file for the YACS scheme, and
122 open YACS module on this file. The YACS file will be stored in the same
123 directory and with the same name as the ADAO saved case, only changing its
124 extension from "*.comm*" to "*.xml*". *Be careful, if the name already exist, it
125 will overwrite it without prompting for replacing the file*. In the same time,
126 an intermediary python file is also stored in the same place, with a "*.py*"
127 extension replacing the "*.comm*" one [#]_.
129 Modify and supplement the YACS scheme and save it
130 +++++++++++++++++++++++++++++++++++++++++++++++++
132 When the YACS scheme is generated and opened in SALOME through the YACS module
133 GUI, you can modify or supplement the scheme like any YACS scheme. It is
134 recommended to save the modified scheme with a new name, in order to preserve in
135 the case you re-export to YACS the ADAO case.
137 The main supplement needed in the YACS scheme is a postprocessing step. The
138 evaluation of the results has to be done in the physical context of the
139 simulation used by the data assimilation procedure.
141 The YACS scheme has an "*algoResults*" output port of the computation bloc,
142 which gives access to a "*pyobj*" containing all the results. These results can
143 be obtained by retrieving the named variables stored along the calculation. The
144 main is the "*Analysis*" one, that can be obtained by the python command (for
145 example in an in-line script node)::
147 Analysis = results.ADD.get("Analysis").valueserie(-1)
149 This is a complex object, similar to a list of values calculated at each step of
150 data assimilation calculation. In order to get the last data assimilation
151 analysis, one can use::
153 Xa = results.ADD.get("Analysis").valueserie(-1)
155 This ``Xa`` is a vector of values, that represents the solution of the data
156 assimilation evaluation problem, noted as :math:`\mathbf{x}^a` in the section
157 :ref:`section_theory`.
159 Such command can be used to print results, or to convert these ones to
160 structures that can be used in the native or external SALOME postprocessing. A
161 simple example is given in the section :ref:`section_examples`.
163 Execute the YACS case and obtain the results
164 ++++++++++++++++++++++++++++++++++++++++++++
166 The YACS scheme is now complete and can be executed. Parametrisation and
167 execution of a YACS case is fully compliant with the standard way to deal with a
168 YACS scheme, and is described in the *YACS module User's Guide*.
170 Results can be obtained, through the "*algoResults*" output port, using YACS
171 nodes to retrieve all the informations in the "*pyobj*" object, to transform
172 them, to convert them, to save part of them, etc.
174 The data assimilation results and complementary calculations can be retrieved
175 using the "*get*" method af the "*algoResults.ADD*" object. This method pick the
176 different output variables identified by their name. Indicating in parenthesis
177 their availability as automatic (for every algorithm) or optional (depending on
178 the algorithm), and their notation coming from section :ref:`section_theory`,
179 the main available output variables are the following:
181 #. "Analysis" (automatic): the control state evaluated by the data assimilation
182 procedure, noted as :math:`\mathbf{x}^a`.
183 #. "Innovation" (automatic): the difference between the observations and the
184 control state transformed by the observation operator, noted as
185 :math:`\mathbf{y}^o - \mathbf{H}\mathbf{x}^b`.
186 #. "OMB" (optional): the difference between the observations and the
187 background, similar to the innovation.
188 #. "BMA" (optional): the difference between the background and the analysis,
189 noted as :math:`\mathbf{x}^b - \mathbf{x}^a`.
190 #. "OMA" (optional): the difference between the observations and the analysis,
191 noted as :math:`\mathbf{y}^o - \mathbf{H}\mathbf{x}^a`.
193 Input variables are also available as output in order to gather all the
194 information at the end of the procedure.
196 All the variables are list of typed values, each item of the list
197 corresponding to the value of the variable at a time step or an iteration step
198 in the data assimilation optimization procedure. The variable value at a given
199 "*i*" step can be obtained by the method "*valueserie(i)*". The last one
200 (consisting in the solution of the evaluation problem) can be obtained using the
201 step "*-1*" as in a standard list.
203 Reference description of the commands and keywords available through the GUI
204 -----------------------------------------------------------------------------
206 Each command or keyword to be defined through the ADAO GUI has some properties.
207 The first property is to be a required command, an optional command or a keyword
208 describing a type. The second property is to be an "open" variable with a fixed
209 type but with any value allowed by the type, or a "restricted" variable, limited
210 to some specified values. The mathematical notations are explained in the
211 section :ref:`section_theory`.
213 The different type-style commands are:
216 *Type of an input*. This indicates a variable that has to be filled by a
217 dictionary, usually given as a script.
220 *Type of an input*. This indicates a variable that has to be filled by a
221 function, usually given as a script.
224 *Type of an input*. This indicates a variable that has to be filled by a
225 matrix, usually given either as a string or as a script.
228 *Type of an input*. This indicates a string, such as a name or a literal
229 representation of a matrix or vector, such as "1 2 ; 3 4".
232 *Type of an input*. This indicates a script given as an external file.
235 *Type of an input*. This indicates a variable that has to be filled by a
236 vector, usually given either as a string or as a script.
238 The different commands are the following:
241 *Required command*. This is the general command describing an ADAO case. It
242 hierarchicaly contains all the other commands.
245 *Required command*. This is a string to indicates the data assimilation
246 algorithm chosen. The choices are limited and available through the GUI.
247 There exists for example: "3DVAR", "Blue", "EnsembleBlue", "KalmanFilter".
249 :AlgorithmParameters:
250 *Optional command*. This command allows to add some optional parameters to
251 control the data assimilation algorithm calculation. It is defined as a
252 "*Dict*" type object.
255 *Required command*. This indicates the backgroud vector used for data
256 assimilation, previously noted as :math:`\mathbf{x}^b`. It is defined as a
257 "*Vector*" type object, that is, given either as a string or as a script.
260 *Required command*. This indicates the backgroud error covariance matrix,
261 previously noted as :math:`\mathbf{B}`.It is defined as a "*Matrix*" type
262 object, that is, given either as a string or as a script.
265 *Required command*. This let choose the level of trace and intermediary
266 debug informations.The choices are limited between 0 (for False) and 1 (for
267 True) and available through the GUI.
270 *Optional command*. This command allows to indicates the name and size of
271 physical variables that are bundled together in the control vector. This
272 information is dedicated to data processed inside of data assimilation
276 *Required command*. This indicates the observation vector used for data
277 assimilation, previously noted as :math:`\mathbf{y}^o`. It is defined as a
278 "*Vector*" type object, that is, given either as a string or as a script.
281 *Required command*. This indicates the observation error covariance matrix,
282 previously noted as :math:`\mathbf{R}`.It is defined as a "*Matrix*" type
283 object, that is, given either as a string or as a script.
285 :ObservationOperator:
286 *Required command*. This indicates the observation operator, previously
287 noted :math:`H`, which transforms the input parameters :math:`\mathbf{x}`
288 to results :math:`\mathbf{y}` to be compared to observations
289 :math:`\mathbf{y}^o`.
292 *Optional command*. This command allows to indicates the name and size of
293 physical variables that are bundled together in the output observation
294 vector. This information is dedicated to data processed inside of data
295 assimilation algorithm.
298 *Required command*. This is an open string to describe the study by a name
302 *Optional command*. If available, this repertory is used to find all the
303 script files that can be used to define some other commands by scripts.
306 *Optional command*. This commands allows to initialise some parameters or
307 data automatically before data assimilation algorithm processing.
310 *Optional command*. This commands allows to process some parameters or data
311 automatically after data assimilation algorithm processing. It is defined as
312 a script or a string, allowing to put simple code directly inside the ADAO
315 Examples of using these commands are available in the section
316 :ref:`section_examples` and in example files installed with ADAO module.
318 .. [#] For more information on EFICAS, see the *EFICAS module* available in SALOME GUI.
320 .. [#] For more information on YACS, see the *YACS module User's Guide* available in the main "*Help*" menu of SALOME GUI.
322 .. [#] This intermediary python file can be safely removed after YACS export, but can also be used as described in the section :ref:`section_advanced`.