@@ -96,6 +96,7 @@ def stream_tci(
9696
9797 # Compute output transform
9898 from rasterio .transform import from_bounds
99+
99100 transform = from_bounds (* src .bounds , out_width , out_height )
100101
101102 profile = {
@@ -159,7 +160,7 @@ def _build_tci_vsis3_path(self, s3_path: str, tile_code: str) -> Optional[str]:
159160 else :
160161 path = path .lstrip ("/" )
161162 if path .startswith (f"{ CDSE_S3_BUCKET } /" ):
162- path = path [len (CDSE_S3_BUCKET ) + 1 :]
163+ path = path [len (CDSE_S3_BUCKET ) + 1 :]
163164
164165 # Ensure trailing slash
165166 if not path .endswith ("/" ):
@@ -216,7 +217,7 @@ def find_tci_path_in_product(self, s3_path: str, tile_code: str) -> Optional[str
216217 prefix = prefix .lstrip ("/" )
217218 # Strip bucket name (eodata/) from prefix to get the S3 key
218219 if prefix .startswith (f"{ CDSE_S3_BUCKET } /" ):
219- prefix = prefix [len (CDSE_S3_BUCKET ) + 1 :]
220+ prefix = prefix [len (CDSE_S3_BUCKET ) + 1 :]
220221 if not prefix .endswith ("/" ):
221222 prefix += "/"
222223
@@ -243,13 +244,8 @@ def find_tci_path_in_product(self, s3_path: str, tile_code: str) -> Optional[str
243244 # Sentinel-2 TCI filenames always carry the ``T`` prefix on
244245 # the tile id (``T34TFL_...``); MGRS callers may pass the
245246 # bare code (``34TFL``). Normalise here.
246- tile_with_t = (
247- tile_code if tile_code .startswith ("T" ) else f"T{ tile_code } "
248- )
249- tci_key = (
250- f"{ granule_prefix } IMG_DATA/R10m/"
251- f"{ tile_with_t } _{ product_datetime } _TCI_10m.jp2"
252- )
247+ tile_with_t = tile_code if tile_code .startswith ("T" ) else f"T{ tile_code } "
248+ tci_key = f"{ granule_prefix } IMG_DATA/R10m/{ tile_with_t } _{ product_datetime } _TCI_10m.jp2"
253249 # Cheap HEAD verify (~50-150 ms) before returning so any
254250 # unexpected layout falls back to the full LIST below
255251 # rather than blowing up later in ``stream_tci`` with
@@ -258,10 +254,7 @@ def find_tci_path_in_product(self, s3_path: str, tile_code: str) -> Optional[str
258254 s3_client .head_object (Bucket = CDSE_S3_BUCKET , Key = tci_key )
259255 return f"/vsis3/{ CDSE_S3_BUCKET } /{ tci_key } "
260256 except Exception :
261- logger .debug (
262- f"Constructed TCI path missing, falling back to "
263- f"LIST: { tci_key } "
264- )
257+ logger .debug (f"Constructed TCI path missing, falling back to LIST: { tci_key } " )
265258 # If delimiter LIST returned nothing, fall through to full LIST.
266259
267260 # Fallback: full prefix LIST (covers L1C and any unexpected layout)
0 commit comments