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

snapshot...

parent b98b04a3
Branches
No related tags found
No related merge requests found
...@@ -870,11 +870,13 @@ def process(ice_dct, no_ice_dct, neg_ice_dct, t_delta=600): ...@@ -870,11 +870,13 @@ def process(ice_dct, no_ice_dct, neg_ice_dct, t_delta=600):
def analyze2(filename, filename_l1b): def analyze2(filename, filename_l1b):
f = h5py.File(filename, 'r') f = h5py.File(filename, 'r')
f_l1b = h5py.File(filename_l1b, 'r') f_l1b = h5py.File(filename_l1b, 'r')
iint = f['icing_intensity'][:] iint = f['icing_intensity'][:]
icing_alt = f['flight_altitude'][:] icing_alt = f['flight_altitude'][:]
cld_top_hgt = f['cld_height_acha'][:, :, :] cld_top_hgt = f['cld_height_acha'][:, :, :]
cld_top_tmp = f['cld_temp_acha'][:, :, :] cld_top_tmp = f['cld_temp_acha'][:, :, :]
sc_cld_frac = f['supercooled_cloud_fraction'][:, :, :] sc_cld_frac = f['supercooled_cloud_fraction'][:, :, :]
cld_mask = f['cloud_mask'][:, :, :]
cld_reff = f['cld_reff_dcomp'][:, :, :] cld_reff = f['cld_reff_dcomp'][:, :, :]
cld_emiss = f['cld_emiss_acha'][:, :, :] cld_emiss = f['cld_emiss_acha'][:, :, :]
# cld_phase = f['cloud_phase'][:, :, :] # cld_phase = f['cloud_phase'][:, :, :]
...@@ -887,32 +889,40 @@ def analyze2(filename, filename_l1b): ...@@ -887,32 +889,40 @@ def analyze2(filename, filename_l1b):
ctt = np.reshape(cld_top_tmp, [iint.size, -1]) ctt = np.reshape(cld_top_tmp, [iint.size, -1])
scf = np.reshape(sc_cld_frac, [iint.size, -1]) scf = np.reshape(sc_cld_frac, [iint.size, -1])
bt = np.reshape(bt_10_4, [iint.size, -1]) bt = np.reshape(bt_10_4, [iint.size, -1])
# cth = np.nanmedian(cth, axis=1) cmsk = np.where(cld_mask > 1, 1, 0)
# ctt = np.nanmedian(ctt, axis=1) cmsk = np.reshape(cmsk, [iint.size, -1])
cld_frac = np.sum(cmsk, axis=1) / 256
cth = np.nanmedian(cth, axis=1)
ctt = np.nanmedian(ctt, axis=1)
scf = np.nanmedian(scf, axis=1) scf = np.nanmedian(scf, axis=1)
bt = np.nanmedian(bt, axis=1) bt = np.nanmedian(bt, axis=1)
cth = np.nanmax(cth, axis=1) # cth = np.nanmax(cth, axis=1)
ctt = np.nanmax(ctt, axis=1) # ctt = np.nanmax(ctt, axis=1)
# scf = np.nanmax(scf, axis=1) # scf = np.nanmax(scf, axis=1)
# cth = np.nanmin(cth, axis=1) # cth = np.nanmin(cth, axis=1)
# ctt = np.nanmin(ctt, axis=1) # ctt = np.nanmin(ctt, axis=1)
# scf = np.nanmin(scf, axis=1) # scf = np.nanmin(scf, axis=1)
print(cth.shape, ctt.shape)
keep_0 = icing_alt < 15000.0 keep_0 = icing_alt < 5000.0
keep_1 = cth < 6000.0 keep_1 = cth < 6000.0
keep_2 = ctt < 274.5 keep_2 = ctt < 274.5
keep_3 = np.logical_and(icing_alt > cth - 1000.0, icing_alt < cth + 1000.0) keep_3 = np.logical_and(icing_alt > cth - 1000.0, icing_alt < cth + 1000.0)
# keep = keep_0 & keep_1 & keep_2 & keep_3 # keep = keep_0 & keep_1 & keep_2 & keep_3
# keep = keep_0 & keep_1 & keep_2 # keep = keep_0 & keep_1 & keep_2
keep = keep_0 & keep_2 # keep = keep_0 & keep_2
icing_alt = icing_alt[keep] keep = keep_0
iint = iint[keep] iint = iint[keep]
icing_alt = icing_alt[keep]
cth = cth[keep] cth = cth[keep]
ctt = ctt[keep] ctt = ctt[keep]
scf = scf[keep] scf = scf[keep]
bt = bt[keep] bt = bt[keep]
print(iint.shape, cth.shape) cfrac = cld_frac[keep]
icing_alt += np.random.normal(scale=100, size=icing_alt.size)
iint = np.where(iint == -1, 0, iint) iint = np.where(iint == -1, 0, iint)
iint = np.where(iint != 0, 1, iint) iint = np.where(iint != 0, 1, iint)
no_ice = iint == 0 no_ice = iint == 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment