Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tom Rink
python
Commits
654bb9bc
Commit
654bb9bc
authored
4 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
275749ec
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
modules/aeolus/aeolus_amv.py
+74
-0
74 additions, 0 deletions
modules/aeolus/aeolus_amv.py
with
74 additions
and
0 deletions
modules/aeolus/aeolus_amv.py
+
74
−
0
View file @
654bb9bc
...
...
@@ -944,6 +944,80 @@ def analyze2(amvs_list, bf_list, raob_match_list, bf_gfs_list, amv_prod_list):
np
.
average
(
np
.
abs
(
bin_spd
[
i
])),
np
.
average
(
bin_spd
[
i
]),
np
.
average
(
np
.
abs
(
bin_dir
[
i
])),
np
.
average
(
bin_dir
[
i
])))
# Comparison to Level of Best Fits (LBF) GFS to RAOB ------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
vld_bf
=
bfs
[:,
3
]
==
0
vld_bf_gfs
=
bfs_gfs
[:,
3
]
==
0
keep_idxs
=
np
.
logical_and
(
vld_bf
,
vld_bf_gfs
)
amv_p
=
good_amvs
[
keep_idxs
,
pidx
]
bf_p
=
bfs
[
keep_idxs
,
2
]
bf_p_gfs
=
bfs_gfs
[
keep_idxs
,
2
]
diff
=
bf_p
-
bf_p_gfs
mad
=
np
.
average
(
np
.
abs
(
diff
))
bias
=
np
.
average
(
diff
)
print
(
'
********************************************************
'
)
print
(
'
Number of good best fits to GFS:
'
,
bf_p
.
shape
[
0
])
print
(
'
press, MAD: {0:.2f}
'
.
format
(
mad
))
print
(
'
press, bias: {0:.2f}
'
.
format
(
bias
))
pd_std
=
np
.
std
(
diff
)
pd_mean
=
np
.
mean
(
diff
)
print
(
'
press bias/rms: {0:.2f} {1:.2f}
'
.
format
(
pd_mean
,
np
.
sqrt
(
pd_mean
**
2
+
pd_std
**
2
)))
print
(
'
------------------------------------------
'
)
bin_pres
=
bin_data_by
(
diff
,
amv_p
,
bin_ranges
)
amv_spd
=
good_amvs
[
keep_idxs
,
sidx
]
amv_dir
=
good_amvs
[
keep_idxs
,
didx
]
bf_gfs_spd
,
bf_gfs_dir
=
spd_dir_from_uv
(
bfs_gfs
[
keep_idxs
,
0
],
bfs_gfs
[
keep_idxs
,
1
])
bf_spd
,
bf_dir
=
spd_dir_from_uv
(
bfs
[
keep_idxs
,
0
],
bfs
[
keep_idxs
,
1
])
diff
=
bf_spd
-
bf_gfs_spd
diff
=
diff
.
magnitude
spd_mad
=
np
.
average
(
np
.
abs
(
diff
))
spd_bias
=
np
.
average
(
diff
)
print
(
'
spd, MAD: {0:.2f}
'
.
format
(
spd_mad
))
print
(
'
spd, bias: {0:.2f}
'
.
format
(
spd_bias
))
spd_mean
=
np
.
mean
(
diff
)
spd_std
=
np
.
std
(
diff
)
print
(
'
spd MAD/bias/rms: {0:.2f} {1:.2f} {2:.2f}
'
.
format
(
np
.
average
(
np
.
abs
(
diff
)),
spd_mean
,
np
.
sqrt
(
spd_mean
**
2
+
spd_std
**
2
)))
print
(
'
-----------------
'
)
bin_spd
=
bin_data_by
(
diff
,
amv_p
,
bin_ranges
)
dir_diff
=
direction_difference
(
bf_dir
.
magnitude
,
bf_gfs_dir
.
magnitude
)
print
(
'
dir, MAD: {0:.2f}
'
.
format
(
np
.
average
(
np
.
abs
(
dir_diff
))))
print
(
'
dir bias: {0:.2f}
'
.
format
(
np
.
average
(
dir_diff
)))
print
(
'
-------------------------------------
'
)
bin_dir
=
bin_data_by
(
dir_diff
,
amv_p
,
bin_ranges
)
u_diffs
=
bfs
[
keep_idxs
,
0
]
-
bfs_gfs
[
keep_idxs
,
0
]
v_diffs
=
bfs
[
keep_idxs
,
1
]
-
bfs_gfs
[
keep_idxs
,
1
]
vd
=
np
.
sqrt
(
u_diffs
**
2
+
v_diffs
**
2
)
vd_mean
=
np
.
mean
(
vd
)
vd_std
=
np
.
std
(
vd
)
print
(
'
VD bias/rms: {0:.2f} {1:.2f}
'
.
format
(
vd_mean
,
np
.
sqrt
(
vd_mean
**
2
+
vd_std
**
2
)))
print
(
'
******************************************************
'
)
x_values
=
[]
num_pres
=
[]
num_spd
=
[]
num_dir
=
[]
print
(
'
level num cases hgt MAD/bias spd MAD/bias dir MAD/bias
'
)
print
(
'
-------------------------------------------------------------------
'
)
for
i
in
range
(
len
(
bin_ranges
)):
x_values
.
append
(
np
.
average
(
bin_ranges
[
i
]))
num_pres
.
append
(
bin_pres
[
i
].
shape
[
0
])
num_spd
.
append
(
bin_spd
[
i
].
shape
[
0
])
num_dir
.
append
(
bin_dir
[
i
].
shape
[
0
])
print
(
'
{0:d} {1:d} {2:.2f}/{3:.2f} {4:.2f}/{5:.2f} {6:.2f}/{7:.2f}
'
.
format
(
int
(
x_values
[
i
]),
num_pres
[
i
],
np
.
average
(
np
.
abs
(
bin_pres
[
i
])),
np
.
average
(
bin_pres
[
i
]),
np
.
average
(
np
.
abs
(
bin_spd
[
i
])),
np
.
average
(
bin_spd
[
i
]),
np
.
average
(
np
.
abs
(
bin_dir
[
i
])),
np
.
average
(
bin_dir
[
i
])))
return
bin_ranges
,
bin_pres
,
bin_spd
,
bin_dir
def
compare_amvs_bestfit
(
amvs_list
,
bfs_list
,
bin_size
=
200
):
amvs
=
np
.
concatenate
(
amvs_list
,
axis
=
1
)
amvs
=
np
.
transpose
(
amvs
,
axes
=
[
1
,
0
])
...
...
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