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
1c899fb6
Commit
1c899fb6
authored
4 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
8221677b
Branches
Branches containing commit
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
+38
-11
38 additions, 11 deletions
modules/aeolus/aeolus_amv.py
with
38 additions
and
11 deletions
modules/aeolus/aeolus_amv.py
+
38
−
11
View file @
1c899fb6
...
...
@@ -13,6 +13,7 @@ from metpy.units import units
from
util.gfs_reader
import
get_vert_profile_s
from
amv.intercompare
import
get_raob_dict_cdf
from
util.line_plot
import
do_plot
import
pickle
amv_file_duration
=
60
# minutes
...
...
@@ -1061,23 +1062,49 @@ def compare_amvs_bestfit(amvs_list, bfs_list, bin_size=200):
return
bin_ranges
,
bin_pres
,
bin_spd
,
bin_dir
def
make_plot
(
bin_ranges
,
bin_pres
,
bin_spd
,
bin_dir
):
def
make_plot
():
f
=
open
(
'
/Users/tomrink/amv_raob.pkl
'
,
'
rb
'
)
tup_r
=
pickle
.
load
(
f
)
f
.
close
()
f
=
open
(
'
/Users/tomrink/amv_gfs.pkl
'
,
'
rb
'
)
tup_g
=
pickle
.
load
(
f
)
f
.
close
()
bin_ranges
=
tup_r
[
0
]
# same for all
bin_pres_r
=
tup_r
[
1
]
bin_pres_g
=
tup_g
[
1
]
x_values
=
[]
num_pres
=
[]
num_pres_r
=
[]
num_pres_g
=
[]
num_spd
=
[]
num_dir
=
[]
pres_mad
=
[]
pres_bias
=
[]
pres_mad_r
=
[]
pres_bias_r
=
[]
pres_mad_g
=
[]
pres_bias_g
=
[]
num_r
=
0
num_g
=
0
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
])
pres_mad
.
append
(
np
.
average
(
np
.
abs
(
bin_pres
[
i
])))
pres_bias
.
append
(
np
.
average
(
bin_pres
[
i
]))
num_r
+=
bin_pres_r
[
i
].
shape
[
0
]
num_g
+=
bin_pres_g
[
i
].
shape
[
0
]
do_plot
(
x_values
,
[
pres_mad
,
pres_bias
],
[
'
mad
'
,
'
bias
'
],
[
'
blue
'
,
'
red
'
],
invert
=
True
,
flip
=
True
)
for
i
in
range
(
len
(
bin_ranges
)):
x_values
.
append
(
np
.
average
(
bin_ranges
[
i
]))
num_pres_r
.
append
((
bin_pres_r
[
i
].
shape
[
0
])
/
num_r
)
num_pres_g
.
append
((
bin_pres_g
[
i
].
shape
[
0
])
/
num_g
)
#num_spd.append(bin_spd[i].shape[0])
#num_dir.append(bin_dir[i].shape[0])
pres_mad_r
.
append
(
np
.
average
(
np
.
abs
(
bin_pres_r
[
i
])))
pres_bias_r
.
append
(
np
.
average
(
bin_pres_r
[
i
]))
pres_mad_g
.
append
(
np
.
average
(
np
.
abs
(
bin_pres_g
[
i
])))
pres_bias_g
.
append
(
np
.
average
(
bin_pres_g
[
i
]))
#do_plot(x_values, [pres_mad_r, pres_mad_g], ['RAOB', 'GFS'], ['blue', 'red'], title='ACHA - BestFit', x_axis_label='MAD', y_axis_label='hPa', invert=True, flip=True)
do_plot
(
x_values
,
[
pres_bias_r
,
pres_bias_g
],
[
'
RAOB
'
,
'
GFS
'
],
[
'
blue
'
,
'
red
'
],
title
=
'
ACHA - BestFit
'
,
x_axis_label
=
'
BIAS
'
,
y_axis_label
=
'
hPa
'
,
invert
=
True
,
flip
=
True
)
#do_plot(x_values, [num_pres_r, num_pres_g], ['RAOB:'+str(num_r), 'GFS:'+str(num_g)], ['blue', 'red'], x_axis_label='Normalized Count', y_axis_label='hPa', invert=True, flip=True)
# imports the S4 NOAA output
...
...
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