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
10b37368
Commit
10b37368
authored
2 years ago
by
lkugler
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://github.com/lkugler/DART-WRF
parents
24aaf6ec
fd80bc89
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
dartwrf/obsseq.py
+24
-7
24 additions, 7 deletions
dartwrf/obsseq.py
with
24 additions
and
7 deletions
dartwrf/obsseq.py
+
24
−
7
View file @
10b37368
...
@@ -136,6 +136,27 @@ class ObsRecord(pd.DataFrame):
...
@@ -136,6 +136,27 @@ class ObsRecord(pd.DataFrame):
# find indices of observations within pandas.DataFrame
# find indices of observations within pandas.DataFrame
return
self
.
iloc
[
self
.
i_obs_grid
[
i
,
j
,
k
].
ravel
()]
return
self
.
iloc
[
self
.
i_obs_grid
[
i
,
j
,
k
].
ravel
()]
def
determine_nlayers
(
self
):
nlayers
=
1
# first guess
if
len
(
exp
.
observations
)
==
1
:
# obscfg = exp.observations[0]
# if 'heights' in obscfg:
# nlayers = len(obscfg['heights'])
heights
=
[
loc_xyz
[
2
]
for
loc_xyz
in
self
[
'
loc3d
'
]]
heights
=
sorted
(
heights
)
h0
=
heights
[
0
]
for
i
,
h
in
enumerate
(
heights
):
if
h
!=
h0
:
break
obs_per_layer
=
i
# if it fails at 1, there is 1 obs per layer
nlayers
=
int
(
len
(
self
)
/
obs_per_layer
)
else
:
warnings
.
warn
(
'
I can only guess the number of layers from this file.
'
)
return
nlayers
def
superob
(
self
,
window_km
):
def
superob
(
self
,
window_km
):
"""
Select subset, average, overwrite existing obs with average
"""
Select subset, average, overwrite existing obs with average
...
@@ -191,14 +212,10 @@ class ObsRecord(pd.DataFrame):
...
@@ -191,14 +212,10 @@ class ObsRecord(pd.DataFrame):
print
(
"
window (#obs in x/y)=
"
,
win_obs
)
print
(
"
window (#obs in x/y)=
"
,
win_obs
)
# superob in case of multiple layers, only implemented for single obstype
# superob in case of multiple layers, only implemented for single obstype
nlayers
=
1
nlayers
=
self
.
determine_nlayers
()
if
len
(
exp
.
observations
)
==
1
:
obscfg
=
exp
.
observations
[
0
]
if
'
heights
'
in
obscfg
:
nlayers
=
len
(
obscfg
[
'
heights
'
])
self
.
nlayers
=
nlayers
i_obs_grid
=
self
.
index
.
values
# indices of observations (starting from 0)
# indices of observations (starting from 0)
i_obs_grid
=
self
.
index
.
values
# get the observation indices from obs_seq (list)
# get the observation indices from obs_seq (list)
# onto a cartesian grid (ix, iy, iz)
# onto a cartesian grid (ix, iy, iz)
...
...
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