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

snapshot...

parent dd471342
No related branches found
No related tags found
No related merge requests found
......@@ -274,6 +274,11 @@ def check_oblique(satzen, test_angle=70.0):
return True
def get_average(tile_2d):
tile = tile_2d.flatten()
return np.nanmean(tile)
def get_grid_values_all(h5f, grid_name, scale_factor_name='scale_factor', add_offset_name='add_offset',
fill_value_name='_FillValue', range_name='actual_range', fill_value=None):
hfds = h5f[grid_name]
......@@ -842,7 +847,7 @@ def write_icing_file(clvrx_str_time, output_dir, preds_dct, probs_dct, x, y, lon
h5f_out.close()
def write_icing_file_nc4(clvrx_str_time, output_dir, preds_dct, probs_dct,
def write_icing_file_nc4(clvrx_str_time, output_dir, preds_dct, probs_dct, bt_10_4,
x, y, lons, lats, elems, lines, satellite='GOES16', domain='CONUS',
has_time=False, use_nan=False, prob_thresh=0.5):
outfile_name = output_dir + 'icing_prediction_'+clvrx_str_time+'.nc'
......@@ -928,6 +933,11 @@ def write_icing_file_nc4(clvrx_str_time, output_dir, preds_dct, probs_dct,
icing_pred_ds.setncattr('missing', -1)
icing_pred_ds[:,] = max_lvl
bt_ds = rootgrp.createVariable('bt_10_4', 'f4', [dim_1_name, dim_0_name])
bt_ds.setncattr('coordinates', geo_coords)
bt_ds.setncattr('grid_mapping', 'Projection')
bt_ds[:,] = bt_10_4
lon_ds = rootgrp.createVariable('longitude', 'f4', [dim_1_name, dim_0_name])
lon_ds.units = 'degrees_east'
lon_ds[:,] = lons
......
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