1 #-*-coding:iso-8859-1-*-
3 from daCore.AssimilationStudy import AssimilationStudy
5 class daError(Exception):
6 def __init__(self, value):
9 return repr(self.value)
13 def __init__(self, name, algorithm):
15 self.ADD = AssimilationStudy(name)
16 self.ADD.setControls()
17 self.algorithm = algorithm
20 self.ADD.setAlgorithm(choice=self.algorithm)
22 def getAssimilationStudy(self):
26 # Methods to initialize AssimilationStudy
28 def setBackgroundType(self, Type):
31 self.BackgroundType = Type
33 raise daError("[daStudy::setBackgroundType] Type is unkown : " + Type + " Types are : Vector")
35 def setBackground(self, Background):
39 except AttributeError:
40 raise daError("[daStudy::setBackground] Type is not defined !")
42 if self.BackgroundType == "Vector":
43 self.ADD.setBackground(asVector = Background)
45 def setBackgroundError(self, BackgroundError):
47 self.ADD.setBackgroundError(asCovariance = BackgroundError)
49 def setObservationType(self, Type):
52 self.ObservationType = Type
54 raise daError("[daStudy::setObservationType] Type is unkown : " + Type + " Types are : Vector")
56 def setObservation(self, Observation):
60 except AttributeError:
61 raise daError("[daStudy::setObservation] Type is not defined !")
63 if self.ObservationType == "Vector":
64 self.ADD.setObservation(asVector = Observation)
66 def setObservationError(self, ObservationError):
68 self.ADD.setObservationError(asCovariance = ObservationError)
70 def setObservationOperatorType(self, Type):
73 self.ObservationOperatorType = Type
75 raise daError("[daStudy::setObservationOperatorType] Type is unkown : " + Type + " Types are : Matrix")
77 def setObservationOperator(self, ObservationOperator):
80 self.ObservationOperatorType
81 except AttributeError:
82 raise daError("[daStudy::setObservationOperator] Type is not defined !")
84 if self.ObservationOperatorType == "Matrix":
85 self.ADD.setObservationOperator(asMatrix = ObservationOperator)