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
2b70cb26
Commit
2b70cb26
authored
Jul 28, 2010
by
Peters, Wouter
Browse files
try making a package from the code
parent
dd098b72
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
ct_tools.py
View file @
2b70cb26
This diff is collapsed.
Click to expand it.
tools_da.py
View file @
2b70cb26
...
...
@@ -222,7 +222,9 @@ def PrepareObs(CycleInfo,type='forecast'):
the observations will depend on the specific application, the final result of this step is an output
file called "observations.nc" which carries the x,y,z,t, dt information of each observation """
if
CycleInfo
.
da_settings
[
'da.system'
]
==
'CarbonTracker'
:
import
ct_tools
as
da_system
if
CycleInfo
.
da_settings
[
'da.system'
]
==
'CarbonTracker'
:
import
ct_tools
as
da_system
import
ct_observation_tools
as
obs
msg
=
"Using %s as DA system"
%
da_system
.
identifier
;
logging
.
debug
(
msg
)
...
...
@@ -234,7 +236,7 @@ def PrepareObs(CycleInfo,type='forecast'):
CycleInfo
.
da_settings
[
'da.system.info'
]
=
rc_da_system
Samples
=
da_system
.
PrepareObs
(
CycleInfo
,
type
=
type
)
Samples
=
obs
.
PrepareObs
(
CycleInfo
,
type
=
type
)
return
Samples
...
...
@@ -247,7 +249,7 @@ def PrepareState(CycleInfo):
"""
if
CycleInfo
.
da_settings
[
'da.system'
]
==
'CarbonTracker'
:
import
ct_tools
as
da_system
if
CycleInfo
.
da_settings
[
'da.system'
]
==
'CarbonTracker'
:
import
ct_
statevector_
tools
as
da_system
StateVector
=
da_system
.
PrepareState
(
CycleInfo
)
...
...
@@ -334,11 +336,13 @@ def ReadModelSamples(StateVector):
def
Optimize
(
CycleInfo
,
StateVector
):
""" Perform least-squares minimization"""
if
CycleInfo
.
da_settings
[
'da.system'
]
==
'CarbonTracker'
:
import
ct_tools
as
da_system
if
CycleInfo
.
da_settings
[
'da.system'
]
==
'CarbonTracker'
:
import
ct_tools
as
da_system
import
ct_optimizer_tools
as
opt
DaSystem
=
da_system
.
DaInfo
(
CycleInfo
.
da_settings
[
'da.system.rc'
])
optimizer
=
da_system
.
CtOptimizer
(
CycleInfo
,
DaSystem
)
optimizer
=
opt
.
CtOptimizer
(
CycleInfo
,
DaSystem
)
def
CleanUpCycle
(
CycleInfo
):
"""
...
...
Write
Preview
Markdown
is supported
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