diff --git a/sen2chain/tiles.py b/sen2chain/tiles.py index ffdc583d3b4368068c580e87a967e2ff57e96442..51361c8ffb57ebf3cc1ae4e70604c42933b1cecd 100644 --- a/sen2chain/tiles.py +++ b/sen2chain/tiles.py @@ -561,6 +561,14 @@ class Tile: "cloud_cover": cloud_cover, } self.__dict__[indice] = self._products["indices"][indice] + + # create empty lists for indices not produced, so that Tile.indice_name_absent returns an empty list instead of error "Tile has no argument named indice_name_absent" + lower = [] + for indice in IndicesCollection.list: + lower.append(indice.lower()) + indices_absent = list(set(lower).difference(list(self._products["indices"].keys()))) + for i in indices_absent: + self.__dict__[i] = [] @staticmethod def is_tile_name_valid(tile_name: str) -> bool: