Commit 8a963896 authored by Peters, Wouter's avatar Peters, Wouter
Browse files

changed reporting of baseclass names

parent 2079c5a7
......@@ -24,12 +24,17 @@ class Observation(object):
""" an object that holds data + methods and attributes needed to manipulate observations for a DA cycle """
def __init__(self):
self.Identifier = identifier
self.Version = version
self.Identifier = self.getid()
self.Version = self.getversion()
self.Data = ObservationList([]) # Initialize with an empty list of obs
msg = '%s object initialized'%self.Identifier ; logging.debug(msg)
msg = '%s version: %s'%(self.Identifier,self.Version) ; logging.info(msg)
msg = 'Observation object initialized: %s'%self.Identifier ; logging.info(msg)
def getid(self):
return identifier
def getversion(self):
return identifier
def __str__(self):
""" Prints a list of Observation objects"""
......
......@@ -31,11 +31,18 @@ class ObservationOperator(object):
def __init__(self):
""" The instance of an ObservationOperator is application dependent """
self.Identifier = identifier # the identifier gives the model name
self.Version = version # the model version used
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
msg = '%s object initialized'%self.Identifier ; logging.debug(msg)
msg = '%s version: %s'%(self.Identifier,self.Version) ; logging.info(msg)
def __str__(self):
return "This is a %s object, version %s"%(self.Identifier,self.Version)
......
......@@ -28,11 +28,16 @@ class Optimizer(object):
"""
def __init__(self):
self.Identifier = identifier
self.Version = version
self.Identifier = self.getid()
self.Version = self.getversion()
msg = '%s object initialized'%self.Identifier ; logging.debug(msg)
msg = '%s version: %s'%(self.Identifier,self.Version) ; logging.info(msg)
msg = 'Optimizer object initialized: %s'%self.Identifier ; logging.info(msg)
def getid(self):
return identifier
def getversion(self):
return version
def Initialize(self, dims):
......
......@@ -70,11 +70,17 @@ class StateVector(object):
""" an object that holds data + methods and attributes needed to manipulate state vector values """
def __init__(self):
self.Identifier = identifier
self.Version = version
self.Identifier = self.getid()
self.Version = self.getversion()
msg = 'Statevector object initialized: %s'%self.Identifier ; logging.info(msg)
def getid(self):
return identifier
def getversion(self):
return version
msg = '%s object initialized'%self.Identifier ; logging.debug(msg)
msg = '%s version: %s'%(self.Identifier,self.Version) ; logging.info(msg)
def Initialize(self,dims):
......
......@@ -13,7 +13,7 @@ import sys
import logging
import datetime
identifier = 'CarbonTracker CO2'
identifier = 'CarbonTracker CO2 mixing ratios'
version = '0.0'
from da.baseclasses.obs import Observation
......@@ -23,6 +23,11 @@ from da.baseclasses.obs import Observation
class CtObservations(Observation):
""" an object that holds data + methods and attributes needed to manipulate mixing ratio values """
def getid(self):
return identifier
def getversion(self):
return identifier
def Initialize(self,DaSystem,sampledate):
sfname = DaSystem.da_settings['obs.input.fname']+'.%s'%(sampledate.strftime('%Y%m%d'),)+'.nc'
......
......@@ -15,7 +15,7 @@ import logging
import datetime
from da.baseclasses.optimizer import Optimizer
identifier = 'CarbonTracker CO2'
identifier = 'Ensemble Square Root Filter'
version = '0.0'
################### Begin Class CtOptimizer ###################
......@@ -27,6 +27,12 @@ class CtOptimizer(Optimizer):
All other methods are inherited from the base class Optimizer.
"""
def getid(self):
return identifier
def getversion(self):
return version
def SetLocalization(self,type='None'):
""" determine which localization to use """
......
......@@ -26,6 +26,12 @@ version = '0.0'
class CtStateVector(StateVector):
""" This is a StateVector object for CarbonTracker. It has a private method to make new ensemble members """
def getid(self):
return identifier
def getversion(self):
return version
def GetCovariance(self,DaSystem):
""" Make a new ensemble from specified matrices, the attribute lag refers to the position in the state vector.
Note that lag=1 means an index of 0 in python, hence the notation lag-1 in the indexing below.
......
......@@ -64,11 +64,16 @@ class TM5ObservationOperator(ObservationOperator):
def __init__(self):
""" The instance of an TMObservationOperator is application dependent """
self.Identifier = identifier # the identifier gives the model name
self.Version = version # the model version used
self.Identifier = self.getid() # the identifier gives the model name
self.Version = self.getversion() # the model version used
msg = '%s observation object initialized'%self.Identifier ; logging.debug(msg)
msg = '%s version: %s'%(self.Identifier,self.Version) ; logging.info(msg)
msg = 'Observation Operator object initialized: %s (%s)'%(self.Identifier, self.Version,) ; logging.info(msg)
def getid(self):
return identifier
def getversion(self):
return version
def Initialize(self, DaCycle):
"""
......
......@@ -34,6 +34,11 @@ Optimizer = CtOptimizer()
################### ENTER THE PIPELINE WITH THE OBJECTS PASSED BY THE USER ###############
##########################################################################################
print "\n ********************************************************************************************************"
print " *************************************** Entering Pipeline ******************************************"
print " ********************************************************************************************************\n"
Main(Samples,StateVector,ObsOperator,Optimizer)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment