Skip to content
Snippets Groups Projects
main.py 1.01 KiB
Newer Older
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()