Workaround for int layers in Treshold

This commit is contained in:
Florent Guiotte 2018-09-21 15:49:40 +02:00
parent fb0a423015
commit e84027a043

View File

@ -26,6 +26,9 @@ class Treshold(Filter):
# This filter each raster independently
self.logger.info('Filtering')
# Workaround for int layers, as int cannot be nan
data = data.astype(np.float64)
treshold_filter = data > self.treshold
repeat_count = treshold_filter.sum(axis=(0, 1))
data[treshold_filter] = np.nan