foo
This commit is contained in:
parent
8683624557
commit
79ee099809
2 changed files with 7 additions and 4 deletions
|
|
@ -667,9 +667,12 @@ def _s3_reflectance_scale(raw_s3_dir: Path) -> float:
|
|||
"""Return multiplier that maps raw SYN L2 SDR values to 0–1 reflectance."""
|
||||
for path in raw_s3_dir.glob("S3*.tif"):
|
||||
with rasterio.open(path) as src:
|
||||
mx = float(np.nanmax(src.read()))
|
||||
if np.isfinite(mx) and mx > 5:
|
||||
return 1.0 / S3_REFLECTANCE_SCALE
|
||||
data = src.read()
|
||||
if not np.any(np.isfinite(data)):
|
||||
continue
|
||||
mx = float(np.nanmax(data))
|
||||
if np.isfinite(mx) and mx > 5:
|
||||
return 1.0 / S3_REFLECTANCE_SCALE
|
||||
return 1.0
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue