This commit is contained in:
Felix Delattre 2026-02-20 11:34:08 +01:00
parent 626917fffb
commit c2908724cf
3 changed files with 10 additions and 4 deletions

View file

@ -100,6 +100,7 @@ def prepare_s2(season, site_position, site_name, cleaning_strategy="aggressive",
temp_normalized = s2_output_dir / f"temp_{s2_file.name}"
with rasterio.open(s2_file) as src:
# S2 L2A: use DN/10000 (Earth Search AWS differs from ESA spec; offset caused many transparent pixels)
data = src.read().astype("float32") / 10000.0
profile = src.profile.copy()
profile.update({"dtype": "float32", "nodata": 0})