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
30bf31fe
Commit
30bf31fe
authored
4 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
new methods
parent
e9aa3b90
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
+53
-1
53 additions, 1 deletion
modules/aeolus/aeolus_amv.py
with
53 additions
and
1 deletion
modules/aeolus/aeolus_amv.py
+
53
−
1
View file @
30bf31fe
...
...
@@ -4,7 +4,7 @@ import glob
import
numpy
as
np
import
xarray
as
xr
from
netCDF4
import
Dataset
from
aeolus.geos_nav
import
GEOSNavigation
from
aeolus.geos_nav
import
GEOSNavigation
,
get_navigation
from
aeolus.datasource
import
get_datasource
from
util.util
import
haversine_np
,
LatLonTuple
,
GenericException
from
amv.intercompare
import
best_fit
,
bin_data_by
,
get_press_bin_ranges
,
spd_dir_from_uv
,
uv_from_spd_dir
,
\
...
...
@@ -1416,6 +1416,58 @@ def get_cloud_layers_dict_s(aeolus_files_dir, lon360=False):
return
cld_lyr_dct
def
match_aeolus_to_clavrx
(
aeolus_dict
,
clvrx_files
):
nav
=
get_navigation
()
#clvrx_params = clvrx_files.get_parameters()
clrvx_params
=
[
'
cld_height_acha
'
,
'
cld_press_acha
'
,
'
cld_temp_acha
'
]
match_dict
=
{}
keys
=
list
(
aeolus_dict
.
keys
())
last_f_idx
=
-
1
cnt
=
0
param_nd
=
None
for
key
in
keys
:
fname
,
ftime
,
f_idx
=
clvrx_files
.
get_file_containing_time
(
key
)
if
f_idx
is
None
:
continue
prof_s
=
aeolus_dict
.
get
(
key
)
if
prof_s
is
None
:
continue
if
f_idx
!=
last_f_idx
:
last_f_idx
=
f_idx
ds
=
Dataset
(
fname
)
param_s
=
[]
for
param
in
amv_params
:
param_s
.
append
(
ds
[
param
][:,:])
param_nd
=
np
.
vstack
(
param_s
)
ds
.
close
()
for
prof
in
prof_s
:
lat
=
prof
[
0
,
0
]
lon
=
prof
[
0
,
1
]
cc
,
ll
=
nav
.
earth_to_lc
(
lon
,
lat
)
if
cc
<
0
:
continue
# c_rng, l_rng = get_search_box(nav, lon, lat)
# if c_rng is None:
# continue
param_nd
=
param_nd
[:,
cc
-
6
:
cc
+
7
,
ll
-
6
:
ll
+
7
]
match_dict
[
cnt
]
=
(
key
,
cc
,
ll
,
f_idx
,
prof
,
param_nd
)
cnt
+=
1
return
match_dict
def
get_search_box
(
nav
,
lon
,
lat
):
cc
,
ll
=
nav
.
earth_to_lc
(
lon
,
lat
)
if
cc
is
None
:
...
...
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