akalenda / PyFmask

Implements in Python Fmask algorithm for classifying clouds in remote sensing (satellite imagery)
MIT License
2 stars 3 forks source link

Values out of range #5

Open akalenda opened 7 years ago

akalenda commented 7 years ago

Sometimes pixels have zero-value in this or that band. This just means that it, in some way, had an error or missing data. These kinds of things just happen sometimes when your sensor array is orbiting the planet at high speed...

Currently we are not dropping these pixels, nor making them NaN. This results in radiance and reflectance values that are below zero, which is erroneous and may propagate to other errors.

A simple solution may be to convert the original bands from uint16 to float. Since their range is fairly small this should not result in any loss of data, nor loss of precision. Then replace the zeros with NaNs, e.g. df['band1'].where((df['band1'] = 0), numpy.nan)