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
42487408
Commit
42487408
authored
4 years ago
by
rink
Browse files
Options
Downloads
Patches
Plain Diff
add distance from aeolus prof loc to each amv loc
parent
b5d5dc0a
No related branches found
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
+9
-3
9 additions, 3 deletions
modules/aeolus/aeolus_amv.py
with
9 additions
and
3 deletions
modules/aeolus/aeolus_amv.py
+
9
−
3
View file @
42487408
...
...
@@ -4,6 +4,7 @@ import glob
import
numpy
as
np
from
netCDF4
import
Dataset
,
Dimension
,
Variable
from
aeolus.geos_nav
import
GEOSNavigation
from
util.util
import
haversine_np
amv_file_duration
=
60
# minutes
...
...
@@ -210,6 +211,10 @@ def get_aeolus_time_dict_s(filenames, lon360=False, do_sort=True):
return
t_dct
def
run_amv_aeolus_best_fit
(
match_dict
):
return
None
def
get_search_box
(
nav
,
lon
,
lat
):
cc
,
ll
=
nav
.
earth_to_lc
(
lon
,
lat
)
if
cc
is
None
:
...
...
@@ -301,7 +306,8 @@ def match_amvs_to_aelous(aeolus_dict, amv_files_path, amv_source='OPS', band='14
num_amvs
=
np
.
sum
(
in_box
)
if
num_amvs
==
0
:
continue
match_dict
[
key
]
=
(
amv_lons
[
in_box
],
amv_lats
[
in_box
],
amv_pres
[
in_box
],
amv_spd
[
in_box
],
amv_dir
[
in_box
])
dist
=
haversine_np
(
lon
,
lat
,
amv_lons
[
in_box
],
amv_lats
[
in_box
])
match_dict
[
key
]
=
(
amv_lons
[
in_box
],
amv_lats
[
in_box
],
amv_pres
[
in_box
],
amv_spd
[
in_box
],
amv_dir
[
in_box
],
dist
)
return
match_dict
...
...
@@ -319,7 +325,7 @@ def create_file(filename, aeolus_to_amv_dct, aeolus_dct):
namvs
=
0
nlevs
=
0
for
key
in
keys
:
lons
,
lats
,
pres
,
spd
,
dir
=
aeolus_to_amv_dct
.
get
(
key
)
lons
,
lats
,
pres
,
spd
,
dir
,
_
=
aeolus_to_amv_dct
.
get
(
key
)
num_amvs
.
append
(
len
(
lons
))
namvs
+=
len
(
lons
)
...
...
@@ -369,7 +375,7 @@ def create_file(filename, aeolus_to_amv_dct, aeolus_dct):
i_b
=
i_a
+
namvs
i_d
=
i_c
+
nlevs
lons
,
lats
,
pres
,
spd
,
dir
=
aeolus_to_amv_dct
.
get
(
key
)
lons
,
lats
,
pres
,
spd
,
dir
,
_
=
aeolus_to_amv_dct
.
get
(
key
)
amv_lon
[
i_a
:
i_b
]
=
lons
[:]
amv_lat
[
i_a
:
i_b
]
=
lats
[:]
amv_spd
[
i_a
:
i_b
]
=
spd
[:]
...
...
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