Skip to content

Commit

Permalink
Sentinel2: fix detection of SR files
Browse files Browse the repository at this point in the history
  • Loading branch information
iona5 committed Nov 13, 2024
1 parent c54d665 commit 1af7d70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def load_s2_scene(fpath: str | Path) -> xr.Dataset:

# Get imagepath
try:
s2_image = next(fpath.glob("*_SR_*.tif"))
s2_image = next(fpath.glob("*_SR*.tif"))
except StopIteration:
raise FileNotFoundError(f"No matching TIFF files found in {fpath.resolve()} (.glob('*_SR_clip.tif'))")
raise FileNotFoundError(f"No matching TIFF files found in {fpath.resolve()} (.glob('*_SR*.tif'))")

# Define band names and corresponding indices
s2_da = xr.open_dataarray(s2_image)
Expand Down
4 changes: 2 additions & 2 deletions darts-preprocessing/src/darts_preprocessing/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ def load_and_preprocess_sentinel2_scene(
│ └── 4372514_slope.tif
└── sentinel2
└── 20220826T200911_20220826T200905_T17XMJ/
├── 20220826T200911_20220826T200905_T17XMJ_SCL_clip.tif
└── 20220826T200911_20220826T200905_T17XMJ_SR_clip.tif
├── 20220826T200911_20220826T200905_T17XMJ_SCL(_clip).tif
└── 20220826T200911_20220826T200905_T17XMJ_SR(_clip).tif
```
Load and preprocess a Sentinel Scene:
Expand Down

0 comments on commit 1af7d70

Please sign in to comment.