Closed benjimin closed 4 years ago
I don't understand what problem you are trying to solve. The original code is pretty clear.
The speed is dominated by I/O, and also by the shadow search phase (depending on size and number of clouds). The memory usage is already very efficient, due to the use of RIOS for raster processing.
Could you elaborate on your concerns?
My concern is readability. I sometimes work with data that belongs to multiple categories (such as shadow on water) and debug suspected misclassifications, and I've occasionally needed to confirm the category precedence order. More than once in the past, I've looked up this section of the code to remind myself or verify which category gets reported if multiple apply. I found the original version to be convoluted, but unnecessarily so:
I propose this very minor change:
OK, fair enough. I have tested this using LC08_L1TP_091085_20180813_20180828_01_T1, which has some of all classes present, and it gives identical results.
Expressing this as unconvolutedly as possible. (Should also perform slightly faster, and use slightly less memory.)