1 # -*- coding: utf-8 -*-
3 from numpy import array, ravel
4 from adao import adaoBuilder
5 case = adaoBuilder.New('')
6 case.setBackground( Vector = array([0., 1., 2.]), Stored=True )
7 case.setBackgroundError( ScalarSparseMatrix = 1. )
8 case.setObservation( Vector=array([10., 11., 12.]), Stored=True )
9 case.setObservationError( ScalarSparseMatrix = 1. )
10 case.setObservationOperator( Matrix=array([[1., 0., 0.],
13 case.setAlgorithmParameters(
16 'StoreSupplementaryCalculations': [
17 'APosterioriCovariance',
23 #-------------------------------------------------------------------------------
25 print("Interpolation entre deux états vectoriels, observation et ébauche")
26 print("-----------------------------------------------------------------")
28 print("Vecteur d'observation.........:", ravel(case.get('Observation')))
29 print("État d'ébauche a priori.......:", ravel(case.get('Background')))
31 print("État théorique attendu........:", ravel([5., 6., 7.]))
33 print("État obtenu par interpolation.:", ravel(case.get('Analysis')[-1]))
34 print("Covariance a posteriori.......:\n", case.get('APosterioriCovariance')[-1])