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
e9aa3b90
Commit
e9aa3b90
authored
3 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
minor
parent
631916d5
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
+21
-36
21 additions, 36 deletions
modules/aeolus/aeolus_amv.py
with
21 additions
and
36 deletions
modules/aeolus/aeolus_amv.py
+
21
−
36
View file @
e9aa3b90
...
...
@@ -1284,7 +1284,7 @@ def get_aeolus_time_dict(filename, lon360=False, do_sort=True):
# make each profile at a timestamp a numpy array
def
time_dict_to_nd
(
time_dict
):
def
time_dict_to_nd
_0
(
time_dict
):
keys
=
list
(
time_dict
.
keys
())
for
key
in
keys
:
vals
=
time_dict
[
key
]
...
...
@@ -1295,16 +1295,25 @@ def time_dict_to_nd(time_dict):
return
time_dict
# # make each profile at a timestamp a numpy array
# def time_dict_to_nd(time_dict):
# keys = list(time_dict.keys())
# for key in keys:
# vals = time_dict[key]
# if vals is not None:
# for i in range(len(vals)):
# nda = np.array(vals[i])
# vals[i] = nda
#
# return time_dict
def
time_dict_to_nd
(
time_dict
):
keys
=
list
(
time_dict
.
keys
())
for
key
in
keys
:
prof_s
=
time_dict
[
key
]
if
prof_s
is
not
None
:
for
i
in
range
(
len
(
prof_s
)):
nda
=
np
.
stack
(
prof_s
[
i
])
prof_s
[
i
]
=
nda
return
time_dict
def
time_dict_to_nd_2
(
time_dict
):
keys
=
list
(
time_dict
.
keys
())
for
key
in
keys
:
vals
=
time_dict
[
key
]
if
vals
is
not
None
:
time_dict
[
key
]
=
np
.
stack
(
vals
)
return
time_dict
def
concat
(
t_dct_0
,
t_dct_1
):
keys_0
=
list
(
t_dct_0
.
keys
())
...
...
@@ -1393,16 +1402,6 @@ def time_dict_to_cld_layers(time_dict):
return
time_dict_layers
def
time_dict_to_nd_2
(
time_dict
):
keys
=
list
(
time_dict
.
keys
())
for
key
in
keys
:
vals
=
time_dict
[
key
]
if
vals
is
not
None
:
time_dict
[
key
]
=
np
.
stack
(
vals
)
return
time_dict
def
get_cloud_layers_dict
(
filename
,
lon360
=
False
):
a_d
=
get_aeolus_time_dict
(
filename
,
lon360
=
lon360
)
c_d
=
time_dict_to_cld_layers
(
a_d
)
...
...
@@ -1417,20 +1416,6 @@ def get_cloud_layers_dict_s(aeolus_files_dir, lon360=False):
return
cld_lyr_dct
# def run_amv_aeolus_best_fit(match_dict, aeolus_dict):
# keys = list(match_dict.keys())
#
# for key in keys:
# profs = aeolus_dict.get(key)
# layers = profs[0]
# if layers is None:
# continue
# lat = layers[0, 0]
# lon = layers[0, 1]
#
# return None
def
get_search_box
(
nav
,
lon
,
lat
):
cc
,
ll
=
nav
.
earth_to_lc
(
lon
,
lat
)
if
cc
is
None
:
...
...
@@ -1631,7 +1616,7 @@ def create_amv_to_aeolus_match_file(aeolus_files_dir, amv_files_dir, outfile=Non
a_d
=
get_cloud_layers_dict_s
(
aeolus_files_dir
)
else
:
a_d
=
get_aeolus_time_dict_s
(
aeolus_files_dir
,
chan
=
chan
)
a_d
=
time_dict_to_nd
(
a_d
)
a_d
=
time_dict_to_nd
_0
(
a_d
)
amv_files
=
None
if
amv_source
==
'
CARR
'
:
...
...
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