Skip to content
Snippets Groups Projects
Commit 5bb8d3b1 authored by Paolo Veglio's avatar Paolo Veglio
Browse files

tried to add qa_bits and test_bits into one function. Still exploring solutions for this

parent b778489a
No related branches found
No related tags found
No related merge requests found
...@@ -54,12 +54,19 @@ class CloudTests(object): ...@@ -54,12 +54,19 @@ class CloudTests(object):
band: str, band: str,
cmin: np.ndarray, cmin: np.ndarray,
test_name: str = '11um_Test') -> np.ndarray: test_name: str = '11um_Test') -> np.ndarray:
confidence = np.ones(self.data[band].shape) confidence = np.ones(self.data[band].shape)
qa_bit = np.zeros(self.data[band].shape)
test_bit = np.zeros(self.data[band].shape)
threshold = self.thresholds[self.scene_name][test_name] threshold = self.thresholds[self.scene_name][test_name]
if (threshold['perform'] is True and self.pixels_in_scene is True): if (threshold['perform'] is True and self.pixels_in_scene is True):
qa_bit[self.scene_idx] = 1
print(f'Testing "{self.scene_name}"\n') print(f'Testing "{self.scene_name}"\n')
rad = self.data[band].values[self.scene_idx] rad = self.data[band].values[self.scene_idx]
idx = np.nonzero((self.data[band].values >= threshold['thr'][1]) &
(self.data[self.scene_name] == 1))
test_bit[idx] = 1
confidence[self.scene_idx] = conf.conf_test_new(rad, threshold['thr']) confidence[self.scene_idx] = conf.conf_test_new(rad, threshold['thr'])
cmin = np.fmin(cmin, confidence) cmin = np.fmin(cmin, confidence)
......
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