Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR with Series().stack() #6

Open
bcerripromethee opened this issue May 15, 2024 · 1 comment
Open

ERROR with Series().stack() #6

bcerripromethee opened this issue May 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bcerripromethee
Copy link

Description

Hello,
I am actually trying to create a series of two granule of Sentinel-2 L2A ( S2A_MSIL2A_20220713T103041_N0400_R108_T31TFJ_20220713T164557.SAFE and S2A_MSIL2A_20220716T103641_N0400_R008_T31TFJ_20220716T183414.SAFE).

After creating my Series, this latter fails to stack them, do you have an idea of the issue ?

Code To Reproduce

from eoreader.bands import RED, GREEN, SWIR_1
from eosets import Series
import geopandas as gpd

bands = [RED, GREEN, SWIR_1]
aoi_gdf = gpd.read_file("path/to/aoi.geojson")
products_paths = ["path/to/S2A_MSIL2A_20220713T103041_N0400_R108_T31TFJ_20220713T164557.SAFE.zip", "path/to/S2A_MSIL2A_20220716T103641_N0400_R008_T31TFJ_20220716T183414.SAFE.zip"]
multi_reader = Series(paths=products_paths)
products = multi_reader.stack(bands, window=aoi_gdf).astype(np.float32)

Output

products = multi_reader.stack(bands, window=aoi_gdf).astype(np.float32)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\miniconda3\envs\ff_env_toml\Lib\site-packages\eosets\series.py", line 426, in stack
    band_ds = self.load(bands, pixel_size=pixel_size, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\miniconda3\envs\ff_env_toml\Lib\site-packages\eosets\series.py", line 335, in load
    reference_ds = self.reference_mosaic.load(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\miniconda3\envs\ff_env_toml\Lib\site-packages\eosets\mosaic.py", line 408, in load
    merge_fct(prod_path, output_path)
  File "C:\ProgramData\miniconda3\envs\ff_env_toml\Lib\site-packages\sertit\rasters.py", line 1212, in merge_vrt
    return rasters_rio.merge_vrt(crs_paths, crs_merged_path, abs_path, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\miniconda3\envs\ff_env_toml\Lib\site-packages\sertit\rasters_rio.py", line 1384, in merge_vrt
    with rasterio.open(str(crs_path)) as src:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\miniconda3\envs\ff_env_toml\Lib\site-packages\rasterio\env.py", line 451, in wrapper
    return f(*args, **kwds)
           ^^^^^^^^^^^^^^^^
  File "C:\ProgramData\miniconda3\envs\ff_env_toml\Lib\site-packages\rasterio\__init__.py", line 317, in open
    dataset = DatasetReader(path, driver=driver, sharing=sharing, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "rasterio\\_base.pyx", line 312, in rasterio._base.DatasetBase.__init__
rasterio.errors.RasterioIOError: C:/Users/BASTIE~1/AppData/Local/Temp/tmpmsfu4pnc/tmp/T31TFJ_20220713T103041_B11_20m.jp2: No such file or directory

Environment:

  • Python version: Python 3.11.9
  • eoreader version: 0.21.1
  • sertit version: 1.37.0
  • eosets version: 0.2.1
@bcerripromethee bcerripromethee added the bug Something isn't working label May 15, 2024
@remi-braun
Copy link
Member

Hi @bcerripromethee!

Unfortunately I'm out of office till the first of July, so I won't investiguate this issue until then.
In the meantime, could you try with unzipped products?

I think there is a copy issue (maybe when creating the VRT?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants