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
7054b187
Commit
7054b187
authored
4 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
7528ddaa
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
+14
-8
14 additions, 8 deletions
modules/aeolus/aeolus_amv.py
with
14 additions
and
8 deletions
modules/aeolus/aeolus_amv.py
+
14
−
8
View file @
7054b187
...
@@ -477,12 +477,18 @@ def run_best_fit_all():
...
@@ -477,12 +477,18 @@ def run_best_fit_all():
'
gfs.19112812_F012.h5
'
,
'
gfs.19112812_F012.h5
'
,
'
gfs.19112912_F012.h5
'
]
'
gfs.19112912_F012.h5
'
]
amvs_list
=
[]
bf_list
=
[]
raob_match_list
=
[]
bf_gfs_list
=
[]
for
k
,
file
in
enumerate
(
raob_files
):
for
k
,
file
in
enumerate
(
raob_files
):
raob_dct
,
ts
=
get_raob_dict_cdf
(
raob_dir
+
file
,
raob_dtsts
[
k
])
raob_dct
,
ts
=
get_raob_dict_cdf
(
raob_dir
+
file
,
raob_dtsts
[
k
])
m_d
=
match_amvs_to_raobs
(
raob_dct
,
ts
,
amv_files
=
amv_files
)
m_d
=
match_amvs_to_raobs
(
raob_dct
,
ts
,
amv_files
=
amv_files
)
amvs_list
,
bf_list
,
raob_match_list
,
bf_gfs_list
=
run_best_fit
(
m_d
,
raob_dct
,
gfs_dir
+
gfs_files
[
k
])
amvs_list
,
bf_list
,
raob_match_list
,
bf_gfs_list
=
run_best_fit
(
m_d
,
raob_dct
,
gfs_dir
+
gfs_files
[
k
],
analyze2
(
amvs_list
,
bf_list
,
raob_match_list
,
bf_gfs_list
)
amvs_list
=
amvs_list
,
bf_list
=
bf_list
,
raob_match_list
=
raob_match_list
,
bf_gfs_list
=
bf_gfs_list
)
# analyze2(amvs_list, bf_list, raob_match_list, bf_gfs_list)
prd_dct
=
get_product_at_locs
(
m_d
,
ts
,
prd_files
)
prd_dct
=
get_product_at_locs
(
m_d
,
ts
,
prd_files
)
analyze2
(
amvs_list
,
bf_list
,
raob_match_list
,
bf_gfs_list
)
def
get_product_at_locs
(
raob_to_amv_dct
,
ts
,
files
,
filepath
=
None
):
def
get_product_at_locs
(
raob_to_amv_dct
,
ts
,
files
,
filepath
=
None
):
...
@@ -560,19 +566,19 @@ def get_product_at_locs1x1(raob_to_amv_dct, ts, files, filepath=None):
...
@@ -560,19 +566,19 @@ def get_product_at_locs1x1(raob_to_amv_dct, ts, files, filepath=None):
return
m_dct
return
m_dct
def
run_best_fit
(
raob_to_amv_dct
,
raob_dct
,
gfs_filename
=
None
):
def
run_best_fit
(
raob_to_amv_dct
,
raob_dct
,
gfs_filename
=
None
,
amvs_list
=
[],
bf_list
=
[],
raob_match_list
=
[],
bf_gfs_list
=
[]
):
keys
=
list
(
raob_to_amv_dct
.
keys
())
keys
=
list
(
raob_to_amv_dct
.
keys
())
do_gfs_best_fit
=
False
do_gfs_best_fit
=
False
gfs_press
=
None
gfs_press
=
None
gfs_spd
=
None
gfs_spd
=
None
gfs_dir
=
None
gfs_dir
=
None
bf_gfs_list
=
None
#
bf_gfs_list = None
if
gfs_filename
is
not
None
:
if
gfs_filename
is
not
None
:
locs
=
np
.
array
(
keys
)
locs
=
np
.
array
(
keys
)
do_gfs_best_fit
=
True
do_gfs_best_fit
=
True
xr_dataset
=
xr
.
open_dataset
(
gfs_filename
)
xr_dataset
=
xr
.
open_dataset
(
gfs_filename
)
bf_gfs_list
=
[]
#
bf_gfs_list = []
gfs_press
=
xr_dataset
[
'
pressure levels
'
]
gfs_press
=
xr_dataset
[
'
pressure levels
'
]
gfs_press
=
gfs_press
.
values
gfs_press
=
gfs_press
.
values
gfs_press
=
gfs_press
[::
-
1
]
gfs_press
=
gfs_press
[::
-
1
]
...
@@ -585,9 +591,9 @@ def run_best_fit(raob_to_amv_dct, raob_dct, gfs_filename=None):
...
@@ -585,9 +591,9 @@ def run_best_fit(raob_to_amv_dct, raob_dct, gfs_filename=None):
gfs_spd
=
wspd
[:,
::
-
1
]
gfs_spd
=
wspd
[:,
::
-
1
]
gfs_dir
=
wdir
[:,
::
-
1
]
gfs_dir
=
wdir
[:,
::
-
1
]
amvs_list
=
[]
#
amvs_list = []
bf_list
=
[]
#
bf_list = []
raob_match_list
=
[]
#
raob_match_list = []
for
key_idx
,
key
in
enumerate
(
keys
):
for
key_idx
,
key
in
enumerate
(
keys
):
raob
=
raob_dct
.
get
(
key
)
raob
=
raob_dct
.
get
(
key
)
nlevs
=
raob
.
shape
[
0
]
nlevs
=
raob
.
shape
[
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