Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DART-WRF-delete_byApril
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DataAssimilation
DART-WRF-delete_byApril
Commits
e3ed6393
Commit
e3ed6393
authored
3 years ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
bugfix obserr generate/assimilate
parent
a9d952f7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/assim_synth_obs.py
+14
-7
14 additions, 7 deletions
scripts/assim_synth_obs.py
with
14 additions
and
7 deletions
scripts/assim_synth_obs.py
+
14
−
7
View file @
e3ed6393
...
@@ -368,7 +368,10 @@ if __name__ == "__main__":
...
@@ -368,7 +368,10 @@ if __name__ == "__main__":
################################################
################################################
print
(
'
1) get the assimilation errors in a single vector
'
)
print
(
'
1) get the assimilation errors in a single vector
'
)
error_generate
=
[]
error_assimilate
=
[]
# to get the obs-error for assimilation,
# we need to get the true obs-space values for the parametrized variable
# and collect the obs-error for assimilation in a single vector/list
for
i
,
obscfg
in
enumerate
(
exp
.
observations
):
for
i
,
obscfg
in
enumerate
(
exp
.
observations
):
n_obs
=
obscfg
[
'
n_obs
'
]
n_obs
=
obscfg
[
'
n_obs
'
]
...
@@ -378,7 +381,7 @@ if __name__ == "__main__":
...
@@ -378,7 +381,7 @@ if __name__ == "__main__":
parametrized
=
obscfg
.
get
(
'
sat_channel
'
)
==
6
parametrized
=
obscfg
.
get
(
'
sat_channel
'
)
==
6
if
not
parametrized
:
if
not
parametrized
:
err_this_type
=
np
.
zeros
(
n_obs_3d
)
+
obscfg
[
'
error_
gener
ate
'
]
err_this_type
=
np
.
zeros
(
n_obs_3d
)
+
obscfg
[
'
error_
assimil
ate
'
]
else
:
# error parametrization for WV73
else
:
# error parametrization for WV73
# get observations for sat 6
# get observations for sat 6
...
@@ -391,10 +394,17 @@ if __name__ == "__main__":
...
@@ -391,10 +394,17 @@ if __name__ == "__main__":
Hx_prior
=
obs_operator_ensemble
(
istage
)
# files are already linked to DART directory
Hx_prior
=
obs_operator_ensemble
(
istage
)
# files are already linked to DART directory
err_this_type
=
calc_obserr_WV73
(
Hx_nat
,
Hx_prior
)
err_this_type
=
calc_obserr_WV73
(
Hx_nat
,
Hx_prior
)
error_
gener
ate
.
extend
(
err_this_type
)
# the obs-error we assume for
gener
ating observations
error_
assimil
ate
.
extend
(
err_this_type
)
# the obs-error we assume for
assimil
ating observations
################################################
################################################
print
(
'
2) generate observations
'
)
print
(
'
2) generate observations
'
)
# the obs-error we use for generating obs is user-defined
error_generate
=
[]
for
i
,
obscfg
in
enumerate
(
exp
.
observations
):
err_this_type
=
np
.
zeros
(
n_obs_3d
)
+
obscfg
[
'
error_generate
'
]
error_generate
.
extend
(
err_this_type
)
osq
.
create_obsseqin_alltypes
(
time
,
exp
.
observations
,
obs_errors
=
error_generate
,
osq
.
create_obsseqin_alltypes
(
time
,
exp
.
observations
,
obs_errors
=
error_generate
,
archive_obs_coords
=
archive_stage
+
'
/obs_coords.pkl
'
)
archive_obs_coords
=
archive_stage
+
'
/obs_coords.pkl
'
)
...
@@ -407,10 +417,7 @@ if __name__ == "__main__":
...
@@ -407,10 +417,7 @@ if __name__ == "__main__":
################################################
################################################
print
(
'
3) assimilate with observation-errors for assimilation
'
)
print
(
'
3) assimilate with observation-errors for assimilation
'
)
error_assimilate
=
[]
for
i
,
obscfg
in
enumerate
(
exp
.
observations
):
err_this_type
=
np
.
zeros
(
n_obs_3d
)
+
obscfg
[
'
error_assimilate
'
]
# the obs-error we assume for assimilation
error_assimilate
.
extend
(
err_this_type
)
replace_errors_obsseqout
(
cluster
.
dartrundir
+
'
/obs_seq.out
'
,
error_assimilate
)
replace_errors_obsseqout
(
cluster
.
dartrundir
+
'
/obs_seq.out
'
,
error_assimilate
)
t
=
time_module
.
time
()
t
=
time_module
.
time
()
...
...
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