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
9cf45671
Commit
9cf45671
authored
2 years ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
docs
parent
4923d09d
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/obs/obsseq.py
+24
-16
24 additions, 16 deletions
dartwrf/obs/obsseq.py
with
24 additions
and
16 deletions
dartwrf/obs/obsseq.py
+
24
−
16
View file @
9cf45671
"""
Read, modify and save DART obs_seq.out/obs_seq.final files in DART format.
"""
Read, modify and save DART obs_seq.out/obs_seq.final files in DART format.
Examples:
Examples:
$ from dartwrf.obs.obsseq import ObsSeq
>>>
from
dartwrf.obs.obsseq
import
ObsSeq
$ obs = ObsSeq(
'
path/to/obs_seq.final
'
)
>>>
osf
=
ObsSeq
(
'
path/to/obs_seq.final
'
)
$ obs.df # pandas.DataFrame with all observations (rows)
pandas
.
DataFrame
with
all
observations
(
rows
)
>>>
osf
.
df
$ obs.df[
'
observations
'
] # observation values (np.array)
observations
truth
prior
ensemble
mean
posterior
ensemble
mean
...
kind
metadata
time
variance
$ obs.df[
'
truth
'
] # truth values (np.array)
0
0.292800
0.289466
0.360284
0.330799
...
262
[
visir
\
n
,
180.000000000000
45.00000
...
(
50400
,
148864
)
0.0009
$ obs.df[
'
prior ensemble spread
'
] # spread of prior ensemble (np.array)
1
0.292800
0.289466
0.398444
0.380152
...
262
[
visir
\
n
,
180.000000000000
45.00000
...
(
50400
,
148864
)
0.0009
$ obs.df[
'
variance
'
] # observation error variances (np.array)
2
0.310016
0.289466
0.355061
0.369988
...
262
[
visir
\
n
,
180.000000000000
45.00000
...
(
50400
,
148864
)
0.0009
3
0.297182
0.289466
0.305424
0.302489
...
262
[
visir
\
n
,
180.000000000000
45.00000
...
(
50400
,
148864
)
0.0009
$ obs.df.get_prior_Hx() # H(x_prior) for all ensemble members (np.array)
4
0.292800
0.293797
0.306238
0.303252
...
262
[
visir
\
n
,
180.000000000000
45.00000
...
(
50400
,
148864
)
0.0009
$ obs.df.get_posterior_Hx() # H(x_posterior) for all ensemble members (np.array)
..
...
...
...
...
...
...
...
...
...
956
0.762274
0.796486
0.664451
0.833559
...
262
[
visir
\
n
,
180.000000000000
45.00000
...
(
50400
,
148864
)
0.0009
$ obs.df.get_lon_lat() # longitude and latitude of observations (pd.DataFrame)
957
0.525743
0.500751
0.534391
0.653267
...
262
[
visir
\
n
,
180.000000000000
45.00000
...
(
50400
,
148864
)
0.0009
958
0.341627
0.348115
0.405534
0.447314
...
262
[
visir
\
n
,
180.000000000000
45.00000
...
(
50400
,
148864
)
0.0009
$ obs.to_dart(
'
path/to/obs_seq.final
'
) # write to file
959
0.826649
0.835491
0.374459
0.785951
...
262
[
visir
\
n
,
180.000000000000
45.00000
...
(
50400
,
148864
)
0.0009
960
0.320477
0.343154
0.303468
0.325203
...
262
[
visir
\
n
,
180.000000000000
45.00000
...
(
50400
,
148864
)
0.0009
[961 rows x 93 columns]
>>>
osf
.
df
.
get_prior_Hx
()
# H(x_prior) for all ensemble members (np.array)
>>>
osf
.
df
.
get_posterior_Hx
()
# H(x_posterior) for all ensemble members (np.array)
>>>
osf
.
to_dart
(
'
path/to/obs_seq.final
'
)
# write to file
Note
:
Note
:
Can
not
create
obs_seq
from
scratch
,
since
it
does
not
know
which
metadata
is
necessary
for
each
observation
type
Can
not
create
obs_seq
from
scratch
,
since
it
does
not
know
which
metadata
is
necessary
for
each
observation
type
...
...
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