in granule_ingester/granule_ingester/processors/EmptyTileFilter.py [0:0]
def process(self, tile, *args, **kwargs):
tile_type = tile.tile.WhichOneof("tile_type")
logger.debug(f'processing granule: {tile.summary.granule}')
tile_data = getattr(tile.tile, tile_type)
data = from_shaped_array(tile_data.variable_data)
# Only supply data if there is actual values in the tile
if data.size - numpy.count_nonzero(numpy.isnan(data)) > 0:
return tile
else:
logger.warning("Discarding tile from {} because it is empty".format(tile.summary.granule))
return None