From: André Ribes Date: Wed, 25 May 2011 12:51:33 +0000 (+0200) Subject: Ajout des exemples pour la V6_3 X-Git-Tag: V6_4_0rc3~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fd4f0ab228a3ab0a99d57a8a5c44f11656148f6e;p=modules%2Fadao.git Ajout des exemples pour la V6_3 --- diff --git a/Makefile.am b/Makefile.am index e3f2ab9..5ddf8d8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,7 @@ endif SUBDIRS += src if SALOME_MODULE -SUBDIRS += resources bin +SUBDIRS += resources bin samples endif if SPHINX_IS_OK diff --git a/adm_local/make_common_starter.am b/adm_local/make_common_starter.am index f09fedf..7120e40 100644 --- a/adm_local/make_common_starter.am +++ b/adm_local/make_common_starter.am @@ -17,6 +17,10 @@ testsdir = $(prefix)/tests testsdasalomedir = $(testsdir)/daSalome testsplateformedir = $(testsdir)/daComposant/Plateforme +# Directory for installing samples files +samplesdir = $(prefix)/share/salome/adao_samples +samplesdasalomedir = $(samplesdir)/daSalome + # Directories for installing admin files admlocaldir = $(prefix)/adm_local admlocalunixdir = $(admlocaldir)/unix diff --git a/configure.ac b/configure.ac index b7c5314..2d00208 100644 --- a/configure.ac +++ b/configure.ac @@ -118,13 +118,10 @@ AC_CONFIG_FILES([ src/daSalome/daGUI/daUtils/Makefile src/daSalome/daGUI/daGuiImpl/Makefile src/daSalome/daGUI/daEficasWrapper/Makefile - src/tests/Makefile - src/tests/daSalome/Makefile - src/tests/daSalome/test000_Blue_AnalysisFile.py - src/tests/daSalome/test017.comm - src/tests/daSalome/test_aster_zzzz159a_init_parameters.py - src/tests/daSalome/test_aster_zzzz159a_LBFGSB.comm - src/tests/daSalome/zzzz159a.export.esclave + samples/Makefile + samples/daSalome/Makefile + samples/daSalome/test003_ADAO_JDC_using_scripts.comm + samples/daSalome/test004_ADAO_JDC_using_scripts.comm bin/Makefile bin/qtEficas_adao_study.py doc/Makefile diff --git a/doc/conf.py b/doc/conf.py index f5e458b..02c6389 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -192,3 +192,5 @@ latex_documents = [ # If false, no module index is generated. #latex_use_modindex = True + +source_encoding = 'iso-8859-15' diff --git a/samples/Makefile.am b/samples/Makefile.am new file mode 100644 index 0000000..54b6585 --- /dev/null +++ b/samples/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = daSalome + diff --git a/samples/daSalome/Makefile.am b/samples/daSalome/Makefile.am new file mode 100644 index 0000000..d40dd24 --- /dev/null +++ b/samples/daSalome/Makefile.am @@ -0,0 +1,19 @@ +include $(top_srcdir)/adm_local/make_common_starter.am + +DATA_INST = \ + test001_ADAO_JDC_using_strings.comm \ + test002_ADAO_JDC_using_strings.comm \ + test003_ADAO_JDC_using_scripts.comm \ + test003_ADAO_scripts_for_JDC.py \ + test004_ADAO_JDC_using_scripts.comm \ + test004_ADAO_scripts_for_JDC.py + +samplesdasalome_DATA = ${DATA_INST} + +EXTRA_DIST = \ + test001_ADAO_JDC_using_strings.comm \ + test002_ADAO_JDC_using_strings.comm \ + test003_ADAO_JDC_using_scripts.comm.in \ + test003_ADAO_scripts_for_JDC.py \ + test004_ADAO_JDC_using_scripts.comm.in \ + test004_ADAO_scripts_for_JDC.py diff --git a/samples/daSalome/test001_ADAO_JDC_using_strings.comm b/samples/daSalome/test001_ADAO_JDC_using_strings.comm new file mode 100644 index 0000000..8455aa5 --- /dev/null +++ b/samples/daSalome/test001_ADAO_JDC_using_strings.comm @@ -0,0 +1,19 @@ + +ASSIMILATION_STUDY(Study_name='Test', + Debug=0, + Algorithm='Blue', + Background=_F(INPUT_TYPE='Vector', + data=_F(FROM='String', + STRING='0 0 0',),), + BackgroundError=_F(INPUT_TYPE='Matrix', + data=_F(FROM='String', + STRING='1 0 0 ; 0 1 0 ; 0 0 1',),), + Observation=_F(INPUT_TYPE='Vector', + data=_F(FROM='String', + STRING='1 1 1',),), + ObservationError=_F(INPUT_TYPE='Matrix', + data=_F(FROM='String', + STRING='1 0 0 ; 0 1 0 ; 0 0 1',),), + ObservationOperator=_F(INPUT_TYPE='Matrix', + data=_F(FROM='String', + STRING='1 0 0 ; 0 1 0 ; 0 0 1',),),); diff --git a/samples/daSalome/test002_ADAO_JDC_using_strings.comm b/samples/daSalome/test002_ADAO_JDC_using_strings.comm new file mode 100644 index 0000000..752fbf4 --- /dev/null +++ b/samples/daSalome/test002_ADAO_JDC_using_strings.comm @@ -0,0 +1,19 @@ + +ASSIMILATION_STUDY(Study_name='Test', + Debug=0, + Algorithm='3DVAR', + Background=_F(INPUT_TYPE='Vector', + data=_F(FROM='String', + STRING='0 0 0',),), + BackgroundError=_F(INPUT_TYPE='Matrix', + data=_F(FROM='String', + STRING='1 0 0 ; 0 1 0 ; 0 0 1',),), + Observation=_F(INPUT_TYPE='Vector', + data=_F(FROM='String', + STRING='1 1 1',),), + ObservationError=_F(INPUT_TYPE='Matrix', + data=_F(FROM='String', + STRING='1 0 0 ; 0 1 0 ; 0 0 1',),), + ObservationOperator=_F(INPUT_TYPE='Matrix', + data=_F(FROM='String', + STRING='1 0 0 ; 0 1 0 ; 0 0 1',),),); diff --git a/samples/daSalome/test003_ADAO_JDC_using_scripts.comm.in b/samples/daSalome/test003_ADAO_JDC_using_scripts.comm.in new file mode 100644 index 0000000..c015723 --- /dev/null +++ b/samples/daSalome/test003_ADAO_JDC_using_scripts.comm.in @@ -0,0 +1,20 @@ + +ASSIMILATION_STUDY(Study_name='Test', + Study_repertory='@prefix@/share/salome/adao_samples/daSalome', + Debug=0, + Algorithm='3DVAR', + Background=_F(INPUT_TYPE='Vector', + data=_F(FROM='Script', + SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),), + BackgroundError=_F(INPUT_TYPE='Matrix', + data=_F(FROM='Script', + SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),), + Observation=_F(INPUT_TYPE='Vector', + data=_F(FROM='Script', + SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),), + ObservationError=_F(INPUT_TYPE='Matrix', + data=_F(FROM='Script', + SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),), + ObservationOperator=_F(INPUT_TYPE='Matrix', + data=_F(FROM='Script', + SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),),); diff --git a/samples/daSalome/test003_ADAO_scripts_for_JDC.py b/samples/daSalome/test003_ADAO_scripts_for_JDC.py new file mode 100644 index 0000000..0b2a50c --- /dev/null +++ b/samples/daSalome/test003_ADAO_scripts_for_JDC.py @@ -0,0 +1,22 @@ +#-*-coding:iso-8859-1-*- +import numpy +# +# Definition of the Background as a vector +# ---------------------------------------- +Background = [0, 0, 0] +# +# Definition of the Observation as a vector +# ----------------------------------------- +Observation = "1 1 1" +# +# Definition of the Background Error covariance as a matrix +# --------------------------------------------------------- +BackgroundError = numpy.array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]) +# +# Definition of the Observation Error covariance as a matrix +# ---------------------------------------------------------- +ObservationError = numpy.matrix("1 0 0 ; 0 1 0 ; 0 0 1") +# +# Definition of the Observation Operator as a matrix +# -------------------------------------------------- +ObservationOperator = numpy.identity(3) diff --git a/samples/daSalome/test004_ADAO_JDC_using_scripts.comm.in b/samples/daSalome/test004_ADAO_JDC_using_scripts.comm.in new file mode 100644 index 0000000..a497a90 --- /dev/null +++ b/samples/daSalome/test004_ADAO_JDC_using_scripts.comm.in @@ -0,0 +1,29 @@ + +ASSIMILATION_STUDY(Study_name='Test', + Study_repertory='@prefix@/share/salome/adao_samples/daSalome', + Debug=0, + Algorithm='Blue', + Background=_F(INPUT_TYPE='Vector', + data=_F(FROM='Script', + SCRIPT_FILE='test004_ADAO_scripts_for_JDC.py',),), + BackgroundError=_F(INPUT_TYPE='Matrix', + data=_F(FROM='Script', + SCRIPT_FILE='test004_ADAO_scripts_for_JDC.py',),), + Observation=_F(INPUT_TYPE='Vector', + data=_F(FROM='Script', + SCRIPT_FILE='test004_ADAO_scripts_for_JDC.py',),), + ObservationError=_F(INPUT_TYPE='Matrix', + data=_F(FROM='Script', + SCRIPT_FILE='test004_ADAO_scripts_for_JDC.py',),), + ObservationOperator=_F(INPUT_TYPE='Matrix', + data=_F(FROM='Script', + SCRIPT_FILE='test004_ADAO_scripts_for_JDC.py',),), + UserPostAnalysis=_F(FROM='String', + STRING= +"""import numpy +Xa = ADD.get("Analysis").valueserie(-1) +print +print "Size of Analysis = %i"%len(Xa) +print "Min, mean, max = %8.3f, %8.3f, %8.3f"%(min(Xa),numpy.mean(Xa),max(Xa)) +print +""",),); diff --git a/samples/daSalome/test004_ADAO_scripts_for_JDC.py b/samples/daSalome/test004_ADAO_scripts_for_JDC.py new file mode 100644 index 0000000..e94a254 --- /dev/null +++ b/samples/daSalome/test004_ADAO_scripts_for_JDC.py @@ -0,0 +1,25 @@ +#-*-coding:iso-8859-1-*- +import numpy +# +n = 100 +# +# Definition of the Background as a vector +# ---------------------------------------- +Background = n * [0] +# +# Definition of the Observation as a vector +# ----------------------------------------- +Observation = n * "1 " +Observation = Observation.strip() +# +# Definition of the Background Error covariance as a matrix +# --------------------------------------------------------- +BackgroundError = numpy.identity(n) +# +# Definition of the Observation Error covariance as a matrix +# ---------------------------------------------------------- +ObservationError = numpy.identity(n) +# +# Definition of the Observation Operator as a matrix +# -------------------------------------------------- +ObservationOperator = numpy.identity(n) diff --git a/src/Makefile.am b/src/Makefile.am index 7212bbe..e1d8628 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = daComposant tests +SUBDIRS = daComposant if SALOME_MODULE SUBDIRS += daSalome daEficas diff --git a/src/examples/daSalome/test001_ADAO_JDC_using_strings.comm b/src/examples/daSalome/test001_ADAO_JDC_using_strings.comm deleted file mode 100644 index 8455aa5..0000000 --- a/src/examples/daSalome/test001_ADAO_JDC_using_strings.comm +++ /dev/null @@ -1,19 +0,0 @@ - -ASSIMILATION_STUDY(Study_name='Test', - Debug=0, - Algorithm='Blue', - Background=_F(INPUT_TYPE='Vector', - data=_F(FROM='String', - STRING='0 0 0',),), - BackgroundError=_F(INPUT_TYPE='Matrix', - data=_F(FROM='String', - STRING='1 0 0 ; 0 1 0 ; 0 0 1',),), - Observation=_F(INPUT_TYPE='Vector', - data=_F(FROM='String', - STRING='1 1 1',),), - ObservationError=_F(INPUT_TYPE='Matrix', - data=_F(FROM='String', - STRING='1 0 0 ; 0 1 0 ; 0 0 1',),), - ObservationOperator=_F(INPUT_TYPE='Matrix', - data=_F(FROM='String', - STRING='1 0 0 ; 0 1 0 ; 0 0 1',),),); diff --git a/src/examples/daSalome/test002_ADAO_JDC_using_strings.comm b/src/examples/daSalome/test002_ADAO_JDC_using_strings.comm deleted file mode 100644 index 752fbf4..0000000 --- a/src/examples/daSalome/test002_ADAO_JDC_using_strings.comm +++ /dev/null @@ -1,19 +0,0 @@ - -ASSIMILATION_STUDY(Study_name='Test', - Debug=0, - Algorithm='3DVAR', - Background=_F(INPUT_TYPE='Vector', - data=_F(FROM='String', - STRING='0 0 0',),), - BackgroundError=_F(INPUT_TYPE='Matrix', - data=_F(FROM='String', - STRING='1 0 0 ; 0 1 0 ; 0 0 1',),), - Observation=_F(INPUT_TYPE='Vector', - data=_F(FROM='String', - STRING='1 1 1',),), - ObservationError=_F(INPUT_TYPE='Matrix', - data=_F(FROM='String', - STRING='1 0 0 ; 0 1 0 ; 0 0 1',),), - ObservationOperator=_F(INPUT_TYPE='Matrix', - data=_F(FROM='String', - STRING='1 0 0 ; 0 1 0 ; 0 0 1',),),); diff --git a/src/examples/daSalome/test003_ADAO_JDC_using_scripts.comm.in b/src/examples/daSalome/test003_ADAO_JDC_using_scripts.comm.in deleted file mode 100644 index 5b26a32..0000000 --- a/src/examples/daSalome/test003_ADAO_JDC_using_scripts.comm.in +++ /dev/null @@ -1,20 +0,0 @@ - -ASSIMILATION_STUDY(Study_name='Test', - Study_repertory='@prefix@/examples/daSalome', - Debug=0, - Algorithm='3DVAR', - Background=_F(INPUT_TYPE='Vector', - data=_F(FROM='Script', - SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),), - BackgroundError=_F(INPUT_TYPE='Matrix', - data=_F(FROM='Script', - SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),), - Observation=_F(INPUT_TYPE='Vector', - data=_F(FROM='Script', - SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),), - ObservationError=_F(INPUT_TYPE='Matrix', - data=_F(FROM='Script', - SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),), - ObservationOperator=_F(INPUT_TYPE='Matrix', - data=_F(FROM='Script', - SCRIPT_FILE='test003_ADAO_scripts_for_JDC.py',),),); diff --git a/src/examples/daSalome/test003_ADAO_scripts_for_JDC.py b/src/examples/daSalome/test003_ADAO_scripts_for_JDC.py deleted file mode 100644 index 0b2a50c..0000000 --- a/src/examples/daSalome/test003_ADAO_scripts_for_JDC.py +++ /dev/null @@ -1,22 +0,0 @@ -#-*-coding:iso-8859-1-*- -import numpy -# -# Definition of the Background as a vector -# ---------------------------------------- -Background = [0, 0, 0] -# -# Definition of the Observation as a vector -# ----------------------------------------- -Observation = "1 1 1" -# -# Definition of the Background Error covariance as a matrix -# --------------------------------------------------------- -BackgroundError = numpy.array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]) -# -# Definition of the Observation Error covariance as a matrix -# ---------------------------------------------------------- -ObservationError = numpy.matrix("1 0 0 ; 0 1 0 ; 0 0 1") -# -# Definition of the Observation Operator as a matrix -# -------------------------------------------------- -ObservationOperator = numpy.identity(3) diff --git a/src/examples/daSalome/test004_ADAO_JDC_using_scripts.comm.in b/src/examples/daSalome/test004_ADAO_JDC_using_scripts.comm.in deleted file mode 100644 index 9ad99eb..0000000 --- a/src/examples/daSalome/test004_ADAO_JDC_using_scripts.comm.in +++ /dev/null @@ -1,29 +0,0 @@ - -ASSIMILATION_STUDY(Study_name='Test', - Study_repertory='@prefix@/examples/daSalome', - Debug=0, - Algorithm='Blue', - Background=_F(INPUT_TYPE='Vector', - data=_F(FROM='Script', - SCRIPT_FILE='test004_ADAO_scripts_for_JDC.py',),), - BackgroundError=_F(INPUT_TYPE='Matrix', - data=_F(FROM='Script', - SCRIPT_FILE='test004_ADAO_scripts_for_JDC.py',),), - Observation=_F(INPUT_TYPE='Vector', - data=_F(FROM='Script', - SCRIPT_FILE='test004_ADAO_scripts_for_JDC.py',),), - ObservationError=_F(INPUT_TYPE='Matrix', - data=_F(FROM='Script', - SCRIPT_FILE='test004_ADAO_scripts_for_JDC.py',),), - ObservationOperator=_F(INPUT_TYPE='Matrix', - data=_F(FROM='Script', - SCRIPT_FILE='test004_ADAO_scripts_for_JDC.py',),), - UserPostAnalysis=_F(FROM='String', - STRING= -"""import numpy -Xa = ADD.get("Analysis").valueserie(-1) -print -print "Size of Analysis = %i"%len(Xa) -print "Min, mean, max = %8.3f, %8.3f, %8.3f"%(min(Xa),numpy.mean(Xa),max(Xa)) -print -""",),); diff --git a/src/examples/daSalome/test004_ADAO_scripts_for_JDC.py b/src/examples/daSalome/test004_ADAO_scripts_for_JDC.py deleted file mode 100644 index e94a254..0000000 --- a/src/examples/daSalome/test004_ADAO_scripts_for_JDC.py +++ /dev/null @@ -1,25 +0,0 @@ -#-*-coding:iso-8859-1-*- -import numpy -# -n = 100 -# -# Definition of the Background as a vector -# ---------------------------------------- -Background = n * [0] -# -# Definition of the Observation as a vector -# ----------------------------------------- -Observation = n * "1 " -Observation = Observation.strip() -# -# Definition of the Background Error covariance as a matrix -# --------------------------------------------------------- -BackgroundError = numpy.identity(n) -# -# Definition of the Observation Error covariance as a matrix -# ---------------------------------------------------------- -ObservationError = numpy.identity(n) -# -# Definition of the Observation Operator as a matrix -# -------------------------------------------------- -ObservationOperator = numpy.identity(n)