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
0566772d
Commit
0566772d
authored
3 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
minor
parent
4cfe6867
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/aeolus/geos_nav.py
+16
-0
16 additions, 0 deletions
modules/aeolus/geos_nav.py
modules/amv/aeolus.py
+3
-59
3 additions, 59 deletions
modules/amv/aeolus.py
modules/util/geos_nav.py
+16
-0
16 additions, 0 deletions
modules/util/geos_nav.py
with
35 additions
and
59 deletions
modules/aeolus/geos_nav.py
+
16
−
0
View file @
0566772d
...
...
@@ -158,3 +158,19 @@ class GEOSNavigation:
idxs
=
np
.
array
(
idxs
)
return
idxs
def
get_navigation
(
satellite
=
'
GOES16
'
,
domain
=
'
FD
'
):
nav
=
None
if
satellite
==
'
GOES16
'
:
if
domain
==
'
FD
'
:
nav
=
GEOSNavigation
()
elif
domain
==
'
CONUS
'
:
pass
elif
satellite
==
'
GOES17
'
:
if
domain
==
'
FD
'
:
nav
=
GEOSNavigation
(
sub_lon
=-
137.0
)
elif
domain
==
'
CONUS
'
:
pass
return
nav
\ No newline at end of file
This diff is collapsed.
Click to expand it.
modules/amv/aeolus.py
+
3
−
59
View file @
0566772d
...
...
@@ -8,11 +8,9 @@ import h5py
from
aeolus.aeolus_amv
import
get_aeolus_time_dict
from
aeolus.datasource
import
CLAVRx
from
util.lon_lat_grid
import
earth_to_indexs
from
util.geos_nav
import
GEOSN
avigation
from
util.geos_nav
import
get_n
avigation
from
util.util
import
bin_data_by
,
get_bin_ranges
import
math
# H08 range we'll use for now
H08_lon_range
=
[
64
,
216
]
# 0, 360
H08_lat_range
=
[
-
70
,
70
]
...
...
@@ -32,62 +30,8 @@ num_elems = 5424
num_lines
=
5424
# def time_dict_to_cld_layers(time_dict):
# time_dict_layers = {}
#
# keys = list(time_dict.keys())
# for key in keys:
# prof_s = time_dict[key]
# layers = []
# prof = prof_s[0]
#
# if len(prof) == 1:
# tup = prof[0]
# layers.append((tup[0], tup[1], tup[3], tup[4]))
# time_dict_layers[key] = layers
# continue
#
# top = -9999.9
# last_bot = -9999.9
# tup = None
# for i in range(len(prof)):
# tup = prof[i]
#
# if i == 0:
# top = tup[3]
# bot = tup[4]
# last_bot = bot
# else:
# if math.fabs(last_bot - tup[3]) > 10.0:
# layers.append((tup[0], tup[1], top, last_bot))
# top = tup[3]
# last_bot = tup[4]
#
# layers.append((tup[0], tup[1], top, tup[4]))
#
# time_dict_layers[key] = layers
#
# 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)
# cld_lyr_dct = time_dict_to_nd_2(c_d)
# return cld_lyr_dct
def
compare_aeolus_max_height
(
aeolus_dict
,
files_path
,
grid_value_name
=
'
cld_height_acha
'
,
one_cld_layer_only
=
False
,
highest_layer
=
False
):
nav
=
get_navigation
(
satellite
=
'
GOES16
'
,
domain
=
'
FD
'
)
clvrx_files
=
CLAVRx
(
files_path
)
num_files
=
len
(
clvrx_files
.
flist
)
...
...
@@ -162,7 +106,7 @@ def compare_aeolus_max_height(aeolus_dict, files_path, grid_value_name='cld_heig
h5f
.
close
()
continue
nn_idxs
=
earth_to_indexs
(
a_lons
[
f_idx
],
a_lats
[
f_idx
],
grd_vals
.
shape
[
0
])
nn_idxs
=
nav
.
earth_to_indexs
(
a_lons
[
f_idx
],
a_lats
[
f_idx
],
grd_vals
.
shape
[
0
])
if
len
(
nn_idxs
)
==
0
:
continue
on_earth
=
nn_idxs
!=
-
1
...
...
This diff is collapsed.
Click to expand it.
modules/util/geos_nav.py
+
16
−
0
View file @
0566772d
...
...
@@ -238,6 +238,22 @@ class GEOSNavigation:
return
geographic_lon
,
geographic_lat
def
get_navigation
(
satellite
=
'
GOES16
'
,
domain
=
'
FD
'
):
nav
=
None
if
satellite
==
'
GOES16
'
:
if
domain
==
'
FD
'
:
nav
=
GEOSNavigation
()
elif
domain
==
'
CONUS
'
:
pass
elif
satellite
==
'
GOES17
'
:
if
domain
==
'
FD
'
:
nav
=
GEOSNavigation
(
sub_lon
=-
137.0
)
elif
domain
==
'
CONUS
'
:
pass
return
nav
# def compute_scale_offset(lon_a, lat_a, col_a, line_a, lon_b, lat_b, col_b, line_b):
# lamda_a, theta_a = earth_to_sat(lon_a, lat_a)
# lamda_b, theta_b = earth_to_sat(lon_b, lat_b)
...
...
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