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
4a04270f
Commit
4a04270f
authored
3 years ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
78196a4f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
dartwrf/assim_synth_obs.py
+7
-5
7 additions, 5 deletions
dartwrf/assim_synth_obs.py
dartwrf/obsseq.py
+2
-3
2 additions, 3 deletions
dartwrf/obsseq.py
with
9 additions
and
8 deletions
dartwrf/assim_synth_obs.py
+
7
−
5
View file @
4a04270f
...
@@ -434,9 +434,8 @@ def is_assim_error_parametrized(obscfg):
...
@@ -434,9 +434,8 @@ def is_assim_error_parametrized(obscfg):
else
:
else
:
return
False
return
False
def
get_parametrized_error
(
obscfg
,
df_obs
):
def
get_parametrized_error
(
obscfg
):
"""
Calculate the parametrized error for an ObsRecord
"""
Calculate the parametrized error for an ObsConfig (one obs type)
This can be all observations or just a subset of all
Args
Args
obscfg ()
obscfg ()
...
@@ -449,6 +448,8 @@ def get_parametrized_error(obscfg, df_obs):
...
@@ -449,6 +448,8 @@ def get_parametrized_error(obscfg, df_obs):
# run obs operator (through filter program)
# run obs operator (through filter program)
# creates obs_seq.final containing truth & prior Hx
# creates obs_seq.final containing truth & prior Hx
run_Hx
(
time
,
obscfg
)
run_Hx
(
time
,
obscfg
)
osf
=
obsseq
.
ObsSeq
(
cluster
.
dartrundir
+
"
/obs_seq.final
"
)
df_obs
=
osf
.
df
if
hasattr
(
exp
,
"
superob_km
"
):
if
hasattr
(
exp
,
"
superob_km
"
):
print
(
"
superobbing to
"
,
exp
.
superob_km
,
"
km
"
)
print
(
"
superobbing to
"
,
exp
.
superob_km
,
"
km
"
)
...
@@ -554,8 +555,7 @@ if __name__ == "__main__":
...
@@ -554,8 +555,7 @@ if __name__ == "__main__":
mask_kind
=
oso
.
df
.
kind
==
kind
mask_kind
=
oso
.
df
.
kind
==
kind
if
is_assim_error_parametrized
(
obscfg
):
if
is_assim_error_parametrized
(
obscfg
):
assim_err
=
get_parametrized_error
(
obscfg
)
assim_err
=
get_parametrized_error
(
obscfg
,
oso
.
df
[
mask_kind
])
oso
.
df
[
mask_kind
]
=
assim_err
**
2
oso
.
df
[
mask_kind
]
=
assim_err
**
2
else
:
else
:
...
@@ -566,6 +566,8 @@ if __name__ == "__main__":
...
@@ -566,6 +566,8 @@ if __name__ == "__main__":
print
(
"
3) assimilate
"
)
print
(
"
3) assimilate
"
)
archive_osq_out
(
time
)
archive_osq_out
(
time
)
set_DART_nml
()
assimilate
()
assimilate
()
archive_filteroutput
(
time
)
archive_filteroutput
(
time
)
...
...
This diff is collapsed.
Click to expand it.
dartwrf/obsseq.py
+
2
−
3
View file @
4a04270f
...
@@ -379,7 +379,7 @@ class ObsSeq(object):
...
@@ -379,7 +379,7 @@ class ObsSeq(object):
x
,
y
,
z
,
z_coord
=
lines
[
line_loc
].
split
()
x
,
y
,
z
,
z_coord
=
lines
[
line_loc
].
split
()
out
[
"
loc3d
"
]
=
float
(
x
),
float
(
y
),
float
(
z
),
int
(
z_coord
)
out
[
"
loc3d
"
]
=
float
(
x
),
float
(
y
),
float
(
z
),
int
(
z_coord
)
out
[
"
kind
"
]
=
int
(
lines
[
line_kind
].
strip
())
out
[
"
kind
"
]
=
int
(
lines
[
line_kind
].
strip
())
out
[
"
metadata
"
]
=
lines
[
line_kind
+
1
:
-
3
]
out
[
"
metadata
"
]
=
lines
[
line_kind
+
1
:
-
2
]
out
[
"
time
"
]
=
tuple
(
lines
[
-
2
].
split
())
out
[
"
time
"
]
=
tuple
(
lines
[
-
2
].
split
())
out
[
"
variance
"
]
=
float
(
lines
[
-
1
].
strip
())
out
[
"
variance
"
]
=
float
(
lines
[
-
1
].
strip
())
return
out
return
out
...
@@ -406,8 +406,7 @@ class ObsSeq(object):
...
@@ -406,8 +406,7 @@ class ObsSeq(object):
return
list_of_obsdict
return
list_of_obsdict
def
to_pandas
(
self
):
def
to_pandas
(
self
):
"""
Create xr.Dataset containing observations
"""
Create pd.DataFrame with rows=observations
Variables = observation types
"""
"""
obs_dict_list
=
self
.
obs_to_dict
()
obs_dict_list
=
self
.
obs_to_dict
()
...
...
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