observationoperator.py 1.84 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
# model.py

"""
Author : peters 

Revision History:
File created on 30 Aug 2010.

"""

import os
import sys
import logging
import datetime

identifier      = 'GeneralObservationOperator'
version         = '0.0'

################### Begin Class ObservationOperator ###################
class ObservationOperator(object):
    """

    This is a class that defines an ObervationOperator. This object is used to control the sampling of
    a statevector in the ensemble Kalman filter framework. The methods of this class specify which (external) code
    is called to perform the sampling, and which files should be read for input and are written for output.

    The baseclasses consist mainly of empty mehtods that require an application specific application

    """

    def __init__(self):
        """ The instance of an ObservationOperator is application dependent """
34
35
36
37
38
39
40
41
42
43
44
        self.Identifier = self.getid()
        self.Version    = self.getversion()

        msg                 = 'Observation Operator object initialized: %s'%self.Identifier ; logging.info(msg)

    def getid(self):
        return identifier

    def getversion(self):
        return version

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67


    def __str__(self):
        return "This is a %s object, version %s"%(self.Identifier,self.Version)

    def Initialize(self,DaCycle):
        """ Perform all steps necessary to start the observation operator through a simple Run() call """

    def ValidateInput(self,DaCycle):
        """ Make sure that data needed for the ObservationOperator (such as observation input lists, or parameter files)
            are present.
        """
    def SaveData(self):
        """ Write the data that is needed for a restart or recovery of the Observation Operator to the save directory """



################### End Class ObservationOperator ###################



if __name__ == "__main__":
    pass