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

snapshot...

parent 4b0d58e0
No related branches found
No related tags found
No related merge requests found
...@@ -562,13 +562,22 @@ def make_for_full_domain_predict(h5f, name_list=None, satellite='GOES16', domain ...@@ -562,13 +562,22 @@ def make_for_full_domain_predict(h5f, name_list=None, satellite='GOES16', domain
# ------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------
def write_icing_file(clvrx_str_time, preds, x, y, lons, lats): def write_icing_file(clvrx_str_time, preds_dct, probs_dct, x, y, lons, lats):
outfile_name = homedir + 'icing_prediction_'+clvrx_str_time+'.h5' outfile_name = homedir + 'icing_prediction_'+clvrx_str_time+'.h5'
h5f_out = h5py.File(outfile_name, 'w') h5f_out = h5py.File(outfile_name, 'w')
icing_pred_ds = h5f_out.create_dataset('icing_prediction', data=preds, dtype='i2') flt_lvls = list(preds_dct.keys())
icing_pred_ds.attrs.create('coordinates', data='y x') for flvl in flt_lvls:
icing_pred_ds.attrs.create('grid_mapping', data='Projection') preds = preds_dct[flvl]
icing_pred_ds = h5f_out.create_dataset('icing_prediction_level_'+flvl, data=preds, dtype='i2')
icing_pred_ds.attrs.create('coordinates', data='y x')
icing_pred_ds.attrs.create('grid_mapping', data='Projection')
for flvl in flt_lvls:
probs = probs_dct[flvl]
icing_pred_ds = h5f_out.create_dataset('icing_probability_level_'+flvl, data=probs, dtype='f4')
icing_pred_ds.attrs.create('coordinates', data='y x')
icing_pred_ds.attrs.create('grid_mapping', data='Projection')
lon_ds = h5f_out.create_dataset('longitude', data=lons, dtype='f4') lon_ds = h5f_out.create_dataset('longitude', data=lons, dtype='f4')
lon_ds.attrs.create('units', data='degrees_east') lon_ds.attrs.create('units', data='degrees_east')
......
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