]> SALOME platform Git repositories - modules/adao.git/blob - src/tests/daSalome/test017_3DVAR_init_data.py
Salome HOME
f5b71775f8ecaf43dbd925a4d7bb44508f2acc44
[modules/adao.git] / src / tests / daSalome / test017_3DVAR_init_data.py
1 # Copyright (C) 2010-2013 EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19 # Author: André Ribes, andre.ribes@edf.fr, EDF R&D
20
21 import numpy
22
23 numpy.random.seed(1000)
24 dimension = 300
25
26 xt = numpy.matrix(numpy.arange(dimension)).T
27 Eo = numpy.matrix(numpy.zeros((dimension,))).T
28 Eb = numpy.matrix(numpy.random.normal(0.,1.,size=(dimension,))).T
29 H  = numpy.matrix(numpy.core.identity(dimension))
30 B = numpy.matrix(numpy.core.identity(dimension)).T
31 R = numpy.matrix(numpy.core.identity(dimension)).T
32
33 def FunctionH( X ):
34     return H * X
35
36 xb = xt + Eb
37 xb = xb.A1
38 yo = FunctionH( xt ) + Eo
39 yo = yo.A1
40
41 Background = xb
42 BackgroundError = B
43 Observation = yo
44 ObservationError = R