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

snapshot...

parent 6e095870
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ import h5py ...@@ -10,6 +10,7 @@ import h5py
import re import re
import datetime import datetime
from datetime import timezone from datetime import timezone
import glob
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
...@@ -1129,4 +1130,41 @@ def box_extract(outfile='/Users/tomrink/box_out.h5', train_params=train_params_d ...@@ -1129,4 +1130,41 @@ def box_extract(outfile='/Users/tomrink/box_out.h5', train_params=train_params_d
h5f.close() h5f.close()
h5f_out.close() h5f_out.close()
h5f_expl.close() h5f_expl.close()
\ No newline at end of file
def run_mean_std():
ds_list = ['cld_height_acha', 'cld_geo_thick', 'cld_press_acha',
'supercooled_cloud_fraction', 'cld_temp_acha', 'cld_opd_acha',
'cld_reff_acha', 'cld_reff_dcomp', 'cld_reff_dcomp_1', 'cld_reff_dcomp_2', 'cld_reff_dcomp_3',
'cld_opd_dcomp', 'cld_opd_dcomp_1', 'cld_opd_dcomp_2', 'cld_opd_dcomp_3', 'cld_cwp_dcomp', 'iwc_dcomp',
'lwc_dcomp', 'cld_emiss_acha', 'conv_cloud_fraction']
mean_dct = {}
std_dct = {}
ice_flist = [f for f in glob.glob('/home/rink/data/icing/', 'icing*.h5')]
no_ice_flist = [f for f in glob.glob('/home/rink/data/icing/', 'no_icing*.h5')]
ice_h5f_lst = [h5py.File(f, 'r') for f in ice_flist]
no_ice_h5f_lst = [h5py.File(f, 'r') for f in no_ice_flist]
data = []
for dname in ds_list:
for ice_h5f, idx in enumerate(ice_h5f_lst):
no_ice_h5f = no_ice_h5f_lst[idx]
data.append(ice_h5f[dname][:,].flatten())
data.append(no_ice_h5f[dname][:,].flatten())
data = np.concatenate(data)
mean = np.mean(data)
data -= mean
std = np.std(data)
mean_dct[dname] = mean
std_dct[dname] = std
[h5f.close() for h5f in ice_h5f]
[h5f.close() for h5f in no_ice_h5f]
return mean_dct, std_dct
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