Dynamic Threshold Cloud-Masking Algorithm in Python and Matlab