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

snapshot...

parent 32dd2aa1
Branches
No related tags found
No related merge requests found
...@@ -1399,6 +1399,60 @@ def apply_qc_icing_pireps_exp2(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cl ...@@ -1399,6 +1399,60 @@ def apply_qc_icing_pireps_exp2(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cl
return mask, idxs, num_tested return mask, idxs, num_tested
def apply_qc_icing_pireps_new(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cld_opd, cld_mask, bt_11um, solzen, satzen, cld_top_temp, day_night='ANY', cloudy_frac=0.5):
closeness_top = 200.0 # meters
max_cld_depth = 1000.0
max_altitude = 4000.0
max_cld_altitude = 4000.0
num_obs = len(icing_alt)
cld_mask = cld_mask.reshape((num_obs, -1))
cld_top_hgt = cld_top_hgt.reshape((num_obs, -1))
cld_geo_dz = cld_geo_dz.reshape((num_obs, -1))
bt_11um = bt_11um.reshape((num_obs, -1))
cld_top_temp = cld_top_temp.reshape((num_obs, -1))
mask = []
idxs = []
num_tested = []
for i in range(num_obs):
if not check_oblique(satzen[i,]):
continue
if day_night == 'NIGHT' and not is_night(solzen[i,]):
continue
elif day_night == 'DAY' and not is_day(solzen[i,]):
continue
elif day_night == 'ANY':
pass
# keep_0 = np.logical_or(cld_mask[i,] == 2, cld_mask[i,] == 3) # cloudy
keep_0 = cld_mask[i, ] == 3 # Confident cloudy
keep_1 = np.invert(np.isnan(cld_top_hgt[i,]))
keep_2 = np.invert(np.isnan(bt_11um[i,]))
keep_3 = np.invert(np.isnan(cld_geo_dz[i,]))
keep = keep_0 & keep_1 & keep_2 & keep_3
num_keep = np.sum(keep)
if num_keep == 0:
continue
if num_keep / nx_x_ny < cloudy_frac: # At least this fraction cloudy
continue
cth_mean = np.nanmean(cld_top_hgt[i,])
if not (cth_mean > icing_alt[i,] > cth_mean - 1000.0):
continue
keep = np.where(keep, np.logical_and(cld_top_hgt[i,] > icing_alt[i,],
(cld_top_hgt[i,] - 3000.0) < icing_alt[i,]), False)
keep = np.where(keep, np.logical_and(cld_top_temp[i,] > 228.0, cld_top_temp[i,] < 274.0), False)
mask.append(keep)
idxs.append(i)
num_tested.append(num_keep)
return mask, idxs, num_tested
def apply_qc_no_icing_pireps(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cld_opd, cld_mask, bt_11um, solzen, satzen, cld_top_temp, day_night='ANY', cloudy_frac=0.5): def apply_qc_no_icing_pireps(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cld_opd, cld_mask, bt_11um, solzen, satzen, cld_top_temp, day_night='ANY', cloudy_frac=0.5):
if day_night == 'DAY': if day_night == 'DAY':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment