Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tsurata, Aki
CTDAS
Commits
8a963896
Commit
8a963896
authored
Sep 16, 2010
by
Peters, Wouter
Browse files
changed reporting of baseclass names
parent
2079c5a7
Changes
9
Hide whitespace changes
Inline
Side-by-side
da/baseclasses/obs.py
View file @
8a963896
...
...
@@ -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
.
get
version
()
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"""
...
...
da/baseclasses/observationoperator.py
View file @
8a963896
...
...
@@ -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
)
...
...
da/baseclasses/optimizer.py
View file @
8a963896
...
...
@@ -28,11 +28,16 @@ class Optimizer(object):
"""
def
__init__
(
self
):
self
.
Identifier
=
identifier
self
.
Version
=
version
self
.
Identifier
=
self
.
getid
()
self
.
Version
=
self
.
get
version
()
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
):
...
...
da/baseclasses/statevector.py
View file @
8a963896
...
...
@@ -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
):
...
...
da/ct/obs.py
View file @
8a963896
...
...
@@ -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'
...
...
da/ct/optimizer.py
View file @
8a963896
...
...
@@ -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 """
...
...
da/ct/statevector.py
View file @
8a963896
...
...
@@ -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.
...
...
da/tm5/observationoperator.py
View file @
8a963896
...
...
@@ -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
.
get
version
()
# 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
):
"""
...
...
das.py
View file @
8a963896
...
...
@@ -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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment