Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DART-WRF
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DataAssimilation
DART-WRF
Commits
357c5a64
Commit
357c5a64
authored
Dec 29, 2021
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
update obsseq
parent
08cd16c2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
dartwrf/obsseq.py
+10
-4
10 additions, 4 deletions
dartwrf/obsseq.py
with
10 additions
and
4 deletions
dartwrf/obsseq.py
+
10
−
4
View file @
357c5a64
...
...
@@ -185,17 +185,23 @@ class ObsRecord(pd.DataFrame):
print
(
"
index y from
"
,
j
,
'
to
'
,
j
+
win_obs
)
print
(
"
obs indices box=
"
,
i_obs_grid
[
i
:
i
+
win_obs
,
j
:
j
+
win_obs
])
# average the subset
# metadata are assumed to be equal
# select the subset of pd.DataFrame
obs_box
=
self
.
iloc
[
i_obs_box
]
# average the subset
# metadata are assumed to be equal
obs_mean
=
obs_box
.
iloc
[
0
]
# despite its name, 'observations' is a single value
# average spread and other values
for
key
in
obs_box
:
if
key
in
[
'
loc3d
'
,
'
kind
'
,
'
metadata
'
,
'
time
'
]:
pass
elif
'
spread
'
in
key
:
# mean of std deviations
elif
'
spread
'
in
key
:
# stdev of mean of values = sqrt(mean of variances)
obs_mean
.
at
[
key
]
=
np
.
sqrt
((
obs_box
[
key
]
**
2
).
mean
())
elif
key
==
'
variance
'
:
# variance of mean = sum(variances)/n^2
obs_mean
.
at
[
key
]
=
obs_box
[
key
].
sum
()
/
obs_box
[
key
].
size
**
2
else
:
obs_mean
.
at
[
key
]
=
obs_box
[
key
].
mean
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment