Skip to content
Snippets Groups Projects
Commit 0566772d authored by tomrink's avatar tomrink
Browse files

minor

parent 4cfe6867
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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 GEOSNavigation
from util.geos_nav import get_navigation
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
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment