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