Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import tests
import ruamel_yaml as yml
import numpy as np
def main():
rad1 = [[255, 260, 265, 248, 223],
[278, 285, 270, 268, 256],
[275, 273, 266, 254, 259]]
rad2 = [[270, 273, 271, 268, 265],
[277, 286, 275, 277, 269],
[280, 281, 272, 270, 267]]
thresh_file = '/home/pveglio/mvcm_leo/thresholds/new_thresholds.mvcm.snpp.v1.0.0.yaml'
with open(thresh_file) as f:
text = f.read()
rad1 = np.array(rad1)
rad2 = np.array(rad2)
confidence = np.zeros((2, rad1.shape[0], rad1.shape[1]))
thresholds = yml.safe_load(text)
thr_11um = thresholds['Daytime_Ocean']
thr_11_4diff = thresholds['Daytime_Ocean']
confidence[0, :, :] = tests.test_11um(rad1, thr_11um['bt11'])
confidence[1, :, :] = tests.test_11_4diff(rad1, rad2, thr_11_4diff['test11_4lo'])
print(f'Confidence[0,:,:]: \n {confidence[0, :, :]}')
print(f'Confidence[1,:,:]: \n {confidence[1, :, :]}')
return confidence
if __name__ == "__main__":
main()