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

minor...

parent b6245acc
Branches
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ import datetime ...@@ -12,6 +12,7 @@ import datetime
from datetime import timezone from datetime import timezone
import glob import glob
from skyfield import api, almanac from skyfield import api, almanac
import xarray as xr
goes_date_format = '%Y%j%H' goes_date_format = '%Y%j%H'
goes16_directory = '/arcdata/goes/grb/goes16' # /year/date/abi/L1b/RadC goes16_directory = '/arcdata/goes/grb/goes16' # /year/date/abi/L1b/RadC
...@@ -303,12 +304,24 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end ...@@ -303,12 +304,24 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end
create_file(outfile_l1b, data_dct, l1b_ds_list, l1b_ds_types, lon_c, lat_c, time_s, fl_alt_s, ice_int_s, unq_ids) create_file(outfile_l1b, data_dct, l1b_ds_list, l1b_ds_types, lon_c, lat_c, time_s, fl_alt_s, ice_int_s, unq_ids)
# ------------ This code will not be needed when we implement a Fully Connected CNN -----------------------------------
# Example GOES file to retrieve GEOS parameters in MetPy form (CONUS)
exmp_file = '/Users/tomrink/data/OR_ABI-L1b-RadC-M6C14_G16_s20193140811215_e20193140813588_c20193140814070.nc'
def make_for_full_domain_predict(clvrx_file, name_list=l1b_ds_list): def make_for_full_domain_predict(clvrx_file, name_list=l1b_ds_list):
w_x = 16 w_x = 16
w_y = 16 w_y = 16
xlen = 2500 xlen = 2500
ylen = 1500 ylen = 1500
exmpl_ds = xr.open_dataset(exmp_file)
mdat = exmpl_ds.metpy.parse_cf('Rad')
geos = mdat.metpy.cartopy_crs
#xlen = mdat.x
#ylen = mdat.y
exmpl_ds.close()
h5f = h5py.File(clvrx_file, 'r') h5f = h5py.File(clvrx_file, 'r')
grd_dct = {name: None for name in name_list} grd_dct = {name: None for name in name_list}
...@@ -331,11 +344,17 @@ def make_for_full_domain_predict(clvrx_file, name_list=l1b_ds_list): ...@@ -331,11 +344,17 @@ def make_for_full_domain_predict(clvrx_file, name_list=l1b_ds_list):
i_0 = 0 i_0 = 0
j_0 = 0 j_0 = 0
cc = []
ll = []
for didx, ds_name in enumerate(name_list): for didx, ds_name in enumerate(name_list):
for j in range(4, n_y-4, 1): for j in range(4, n_y-4, 1):
j_ul = j_0 + j * w_y j_ul = j_0 + j * w_y
for i in range(4, n_x-4, 1): for i in range(4, n_x-4, 1):
i_ul = i_0 + i * w_x i_ul = i_0 + i * w_x
if didx == 0:
ll.append(j_ul)
cc.append(i_ul)
grd_dct_n[ds_name].append(grd_dct[ds_name][j_ul:j_ul+w_y, i_ul:i_ul+w_x]) grd_dct_n[ds_name].append(grd_dct[ds_name][j_ul:j_ul+w_y, i_ul:i_ul+w_x])
grd_dct = {name: None for name in name_list} grd_dct = {name: None for name in name_list}
...@@ -344,7 +363,7 @@ def make_for_full_domain_predict(clvrx_file, name_list=l1b_ds_list): ...@@ -344,7 +363,7 @@ def make_for_full_domain_predict(clvrx_file, name_list=l1b_ds_list):
h5f.close() h5f.close()
return grd_dct, grd_dct[name_list[0]].shape[0] return grd_dct, ll, cc
def analyze(ice_dct, no_ice_dct): def analyze(ice_dct, no_ice_dct):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment