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
Smith, Naomi
CTDAS
Commits
0cb8fda3
Commit
0cb8fda3
authored
Sep 08, 2015
by
ivar
Browse files
bug fix in residual calculation in serial_least_squares
parent
d21ba765
Changes
1
Hide whitespace changes
Inline
Side-by-side
da/stilt/optimizer.py
View file @
0cb8fda3
...
...
@@ -109,6 +109,8 @@ class CO2Optimizer(Optimizer):
logging
.
debug
(
'Skipping observation (%s,%i) because of flag value %d'
%
(
self
.
sitecode
[
n
],
self
.
obs_ids
[
n
],
self
.
flags
[
n
]))
continue
res
=
self
.
obs
[
n
]
-
self
.
Hx
[
n
]
logging
.
debug
(
'Proceeding to assimilate observation %s, %i'
%
(
self
.
sitecode
[
n
],
self
.
obs_ids
[
n
]))
...
...
@@ -120,11 +122,11 @@ class CO2Optimizer(Optimizer):
if
'surface'
in
self
.
sitecode
[
n
]:
self
.
KG
[
-
1
]
=
0.
self
.
KG
[
3078
]
=
0
logging
.
debug
(
"Surface observations do not update BC"
)
logging
.
debug
(
'BC KG value set to zero for %s'
%
(
self
.
sitecode
[
n
])
)
if
'aircraft'
in
self
.
sitecode
[
n
]:
self
.
KG
[
0
:
3078
]
=
0.
self
.
KG
[
3079
:
-
1
]
=
0.
logging
.
debug
(
"Aircraft observations do not update Fluxes"
)
logging
.
debug
(
'Flux KG values set to zero for %s'
%
(
self
.
sitecode
[
n
])
)
if
self
.
may_localize
[
n
]:
logging
.
debug
(
'Trying to localize observation %s, %i'
%
(
self
.
sitecode
[
n
],
self
.
obs_ids
[
n
]))
...
...
@@ -134,7 +136,13 @@ class CO2Optimizer(Optimizer):
alpha
=
np
.
double
(
1.0
)
/
(
np
.
double
(
1.0
)
+
np
.
sqrt
((
self
.
R
[
n
])
/
self
.
HPHR
[
n
]))
self
.
x
[:]
=
self
.
x
+
self
.
KG
[:]
*
res
logging
.
debug
(
'Residual %s'
%
res
)
logging
.
debug
(
'New self.KG BC1 %s'
%
self
.
KG
[
3078
])
logging
.
debug
(
'New self.KG BC2 %s'
%
self
.
KG
[
-
1
])
logging
.
debug
(
'New self.x BC1 %s'
%
self
.
x
[
3078
])
logging
.
debug
(
'New self.x BC2 %s'
%
self
.
x
[
-
1
])
for
r
in
range
(
self
.
nmembers
):
self
.
X_prime
[:,
r
]
=
self
.
X_prime
[:,
r
]
-
alpha
*
self
.
KG
[:]
*
(
self
.
HX_prime
[
n
,
r
])
...
...
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