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

snapshot...

parent c7dd306b
Branches
No related tags found
No related merge requests found
...@@ -3,7 +3,8 @@ import numpy as np ...@@ -3,7 +3,8 @@ import numpy as np
import pickle import pickle
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import os import os
from util.util import get_time_tuple_utc, GenericException, add_time_range_to_filename, is_night, is_day, get_grid_values_all from util.util import get_time_tuple_utc, GenericException, add_time_range_to_filename, is_night, is_day, \
get_grid_values_all, check_oblique
from aeolus.datasource import CLAVRx, GOESL1B from aeolus.datasource import CLAVRx, GOESL1B
from util.geos_nav import GEOSNavigation from util.geos_nav import GEOSNavigation
import h5py import h5py
...@@ -705,6 +706,7 @@ def run_qc(filename, filename_l1b, day_night='ANY', pass_thresh_frac=0.20, icing ...@@ -705,6 +706,7 @@ def run_qc(filename, filename_l1b, day_night='ANY', pass_thresh_frac=0.20, icing
cld_mask = f['cloud_mask'][:, y_a:y_b, x_a:x_b] cld_mask = f['cloud_mask'][:, y_a:y_b, x_a:x_b]
sol_zen = f['solar_zenith_angle'][:, y_a:y_b, x_a:x_b] sol_zen = f['solar_zenith_angle'][:, y_a:y_b, x_a:x_b]
sat_zen = f['sensor_zenith_angle'][:, y_a:y_b, x_a:x_b]
f_l1b = h5py.File(filename_l1b, 'r') f_l1b = h5py.File(filename_l1b, 'r')
bt_11um = f_l1b['temp_11_0um_nom'][:, y_a:y_b, x_a:x_b] bt_11um = f_l1b['temp_11_0um_nom'][:, y_a:y_b, x_a:x_b]
...@@ -712,9 +714,9 @@ def run_qc(filename, filename_l1b, day_night='ANY', pass_thresh_frac=0.20, icing ...@@ -712,9 +714,9 @@ def run_qc(filename, filename_l1b, day_night='ANY', pass_thresh_frac=0.20, icing
print('num pireps all: ', len(icing_alt)) print('num pireps all: ', len(icing_alt))
if icing: if icing:
mask, idxs, num_tested = apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask, bt_11um, sol_zen, day_night=day_night) mask, idxs, num_tested = apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask, bt_11um, sol_zen, sat_zen, day_night=day_night)
else: else:
mask, idxs, num_tested = apply_qc_no_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask, bt_11um, sol_zen, day_night=day_night) mask, idxs, num_tested = apply_qc_no_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask, bt_11um, sol_zen, sat_zen, day_night=day_night)
print('num pireps, day_night: ', len(mask), day_night) print('num pireps, day_night: ', len(mask), day_night)
keep_idxs = [] keep_idxs = []
...@@ -761,7 +763,7 @@ def run_qc(filename, filename_l1b, day_night='ANY', pass_thresh_frac=0.20, icing ...@@ -761,7 +763,7 @@ def run_qc(filename, filename_l1b, day_night='ANY', pass_thresh_frac=0.20, icing
f_l1b.close() f_l1b.close()
def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask, bt_11um, solzen, day_night='ANY'): def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask, bt_11um, solzen, satzen, day_night='ANY'):
opd_thick_threshold = 2 opd_thick_threshold = 2
if day_night == 'DAY': if day_night == 'DAY':
opd_thick_threshold = 20 opd_thick_threshold = 20
...@@ -777,6 +779,8 @@ def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask, ...@@ -777,6 +779,8 @@ def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask,
idxs = [] idxs = []
num_tested = [] num_tested = []
for i in range(num_obs): for i in range(num_obs):
if not check_oblique(satzen[i,]):
continue
if day_night == 'NIGHT': if day_night == 'NIGHT':
if is_day(solzen[i,]): if is_day(solzen[i,]):
continue continue
...@@ -815,7 +819,7 @@ def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask, ...@@ -815,7 +819,7 @@ def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask,
return mask, idxs, num_tested return mask, idxs, num_tested
def apply_qc_no_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask, bt_11um, solzen, day_night='ANY'): def apply_qc_no_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask, bt_11um, solzen, satzen, day_night='ANY'):
opd_thick_threshold = 2 opd_thick_threshold = 2
if day_night == 'DAY': if day_night == 'DAY':
opd_thick_threshold = 20 opd_thick_threshold = 20
...@@ -831,6 +835,8 @@ def apply_qc_no_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mas ...@@ -831,6 +835,8 @@ def apply_qc_no_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mas
idxs = [] idxs = []
num_tested = [] num_tested = []
for i in range(num_obs): for i in range(num_obs):
if not check_oblique(satzen[i,]):
continue
if day_night == 'NIGHT': if day_night == 'NIGHT':
if is_day(solzen[i,]): if is_day(solzen[i,]):
continue continue
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment