sertit / eoreader

Remote-sensing opensource python library reading optical and SAR sensors, loading and stacking bands, clouds, DEM and spectral indices in a sensor-agnostic way.
https://eoreader.readthedocs.io/en/latest/
Apache License 2.0
271 stars 22 forks source link

S2 product StopIteration #142

Closed jteulade closed 1 month ago

jteulade commented 1 month ago

With the following product s3://sertit-projects-archives/projects/2021/CNES_MandatNational/Etude_incendies_ONF_SERTIT/Ariege/feux_ariege_sertit/Burnout/ref_20161028/bands I have the following error:

Traceback (most recent call last):
  File "E:\JTeulade\repositories\stac\scripts\find_valid_product.py", line 33, in <module>
    path_products = get_path_products(PATH_TO_CRAWL)
  File "E:\JTeulade\repositories\stac\libs\sertit-utils\sertit\s3.py", line 99, in s3_env_wrapper
    return function(*_args, **_kwargs)
  File "E:\JTeulade\repositories\stac\stac\product.py", line 63, in get_path_products
    if all(d not in full_path.parts for d in BLACKLIST_DIRECTORIES) and check_product_and_fill_path(
  File "E:\JTeulade\repositories\stac\stac\product.py", line 103, in check_product_and_fill_path
    prod =  Reader().open(path_to_check, remove_tmp=True)
  File "e:\jteulade\repositories\eoreader\eoreader\reader.py", line 537, in open
    prod = self._open_path(
  File "e:\jteulade\repositories\eoreader\eoreader\reader.py", line 699, in _open_path
    prod = create_product(
  File "e:\jteulade\repositories\eoreader\eoreader\reader.py", line 966, in create_product
    prod = class_(
  File "e:\jteulade\repositories\eoreader\eoreader\products\optical\s2_product.py", line 175, in __init__
    super().__init__(product_path, archive_path, output_path, remove_tmp, **kwargs)
  File "e:\jteulade\repositories\eoreader\eoreader\products\optical\optical_product.py", line 116, in __init__
    super().__init__(product_path, archive_path, output_path, remove_tmp, **kwargs)
  File "e:\jteulade\repositories\eoreader\eoreader\products\product.py", line 250, in __init__
    self.name = self._get_name()
  File "e:\jteulade\repositories\eoreader\eoreader\products\product.py", line 439, in _get_name
    name = self._get_name_constellation_specific()
  File "e:\jteulade\repositories\eoreader\eoreader\products\optical\s2_product.py", line 490, in _get_name_constellation_specific
    next(self.path.glob("**/tileInfo.json")), print_file=False
StopIteration

I should catch the StopIteration error here and return a InvalidProductError