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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DataAssimilation
DART-WRF
Commits
83034700
Commit
83034700
authored
2 years ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
read missing value as np.nan
parent
3f5f5767
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
dartwrf/obs/obsseq.py
+11
-1
11 additions, 1 deletion
dartwrf/obs/obsseq.py
with
11 additions
and
1 deletion
dartwrf/obs/obsseq.py
+
11
−
1
View file @
83034700
...
@@ -36,6 +36,8 @@ import os, warnings
...
@@ -36,6 +36,8 @@ import os, warnings
import
numpy
as
np
import
numpy
as
np
import
pandas
as
pd
import
pandas
as
pd
missing_value
=
-
888888.0
def
_plot_box
(
m
,
lat
,
lon
,
label
=
""
,
**
kwargs
):
def
_plot_box
(
m
,
lat
,
lon
,
label
=
""
,
**
kwargs
):
""""
Draw bounding box
""""
Draw bounding box
...
@@ -571,8 +573,16 @@ class ObsSeq(object):
...
@@ -571,8 +573,16 @@ class ObsSeq(object):
if
"
kind
"
in
line
:
# find obs kind
if
"
kind
"
in
line
:
# find obs kind
line_kind
=
i
+
1
line_kind
=
i
+
1
# read values like 'observations', 'truth', 'prior ensemble mean'
for
k
,
key
in
enumerate
(
self
.
keys_for_values
):
for
k
,
key
in
enumerate
(
self
.
keys_for_values
):
out
[
key
]
=
float
(
lines
[
1
+
k
].
strip
())
v
=
float
(
lines
[
1
+
k
].
strip
())
# value in obs_seq file
if
v
==
missing_value
:
# e.g. -888888.0
out
[
key
]
=
np
.
nan
else
:
out
[
key
]
=
v
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
)
...
...
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