Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ lint = "ruff check python/siac tests"
format-check = "ruff format --check python/siac tests"
format = "ruff format python/siac tests"
typecheck = "mypy python/siac"
typecheck-scoped = "mypy --follow-imports=skip python/siac/config/algorithms.py python/siac/config/load.py python/siac/config/providers.py python/siac/config/public.py python/siac/config/request.py python/siac/config/resolved.py python/siac/config/snapshot.py python/siac/config/system.py python/siac/config/types.py python/siac/adapters/auth.py python/siac/adapters/bestpixel.py python/siac/adapters/bestpixel_surface_prior.py python/siac/adapters/atmo/cams.py python/siac/adapters/atmo/maiac_day_aod.py python/siac/adapters/atmo/mcd19_earthaccess.py python/siac/adapters/atmo/merra2.py python/siac/adapters/brdf/mcd43_earthaccess.py python/siac/adapters/brdf/_mcd43_kernels.py python/siac/adapters/brdf/_mcd43_qa.py python/siac/adapters/data/copernicus_dataspace.py python/siac/adapters/data/gcs_sentinel2.py python/siac/adapters/data/earthaccess_catalog.py python/siac/adapters/earthdata.py python/siac/adapters/satellite/sentinel2.py python/siac/algorithms/brdf/kernels.py python/siac/algorithms/cloud/providers/omnicloudmask.py python/siac/algorithms/rt/lut/backend.py python/siac/algorithms/rt/lut/_compact.py python/siac/algorithms/rt/lut/_spectral.py python/siac/algorithms/rt/lut/http_zip_store.py python/siac/algorithms/rt/lut/store.py python/siac/algorithms/rt/direct/libradtran.py python/siac/algorithms/rt/direct/libradtran_runner.py python/siac/algorithms/rt/direct/libradtran_build.py python/siac/algorithms/rt/direct/_build_common.py python/siac/algorithms/rt/direct/_common.py python/siac/algorithms/rt/_run_cache.py python/siac/workflows/scene_setup.py python/siac/algorithms/surface/_swir_refine_resample.py python/siac/algorithms/surface/brdf_monthly_database.py python/siac/algorithms/surface/brdf_whittaker.py python/siac/algorithms/surface/kernel_model.py python/siac/algorithms/grid/toa_psf.py python/siac/algorithms/surface/spectral_mapping.py python/siac/algorithms/surface/swir_refine.py python/siac/storage/writers.py python/siac/storage/readers.py python/siac/geo/reprojection.py python/siac/api/public.py python/siac/app/_assembly_correction.py python/siac/app/_assembly_io.py python/siac/app/_assembly_preprocessor.py python/siac/app/_assembly_providers.py python/siac/app/_assembly_rt.py python/siac/app/_assembly_solver.py python/siac/app/_assembly_surface.py python/siac/app/planning.py python/siac/app/s2_backend.py python/siac/app/sentinel2.py python/siac/workflows/_pipeline_config.py python/siac/workflows/scene.py python/siac/workflows/sentinel2.py"
typecheck-scoped = "mypy --follow-imports=skip python/siac/config/algorithms.py python/siac/config/load.py python/siac/config/providers.py python/siac/config/public.py python/siac/config/request.py python/siac/config/resolved.py python/siac/config/snapshot.py python/siac/config/system.py python/siac/config/types.py python/siac/adapters/auth.py python/siac/adapters/bestpixel.py python/siac/adapters/bestpixel_surface_prior.py python/siac/adapters/atmo/cams.py python/siac/adapters/atmo/maiac_day_aod.py python/siac/adapters/atmo/mcd19_earthaccess.py python/siac/adapters/atmo/merra2.py python/siac/adapters/brdf/mcd43_earthaccess.py python/siac/adapters/brdf/_mcd43_kernels.py python/siac/adapters/brdf/_mcd43_qa.py python/siac/adapters/data/copernicus_dataspace.py python/siac/adapters/data/gcs_sentinel2.py python/siac/adapters/data/earthaccess_catalog.py python/siac/adapters/earthdata.py python/siac/adapters/satellite/sentinel2.py python/siac/adapters/satellite/landsat.py python/siac/algorithms/brdf/kernels.py python/siac/algorithms/cloud/providers/omnicloudmask.py python/siac/algorithms/rt/lut/backend.py python/siac/algorithms/rt/lut/_compact.py python/siac/algorithms/rt/lut/_spectral.py python/siac/algorithms/rt/lut/http_zip_store.py python/siac/algorithms/rt/lut/store.py python/siac/algorithms/rt/direct/libradtran.py python/siac/algorithms/rt/direct/libradtran_runner.py python/siac/algorithms/rt/direct/libradtran_build.py python/siac/algorithms/rt/direct/_build_common.py python/siac/algorithms/rt/direct/_common.py python/siac/algorithms/rt/_run_cache.py python/siac/workflows/scene_setup.py python/siac/algorithms/surface/_swir_refine_resample.py python/siac/algorithms/surface/brdf_monthly_database.py python/siac/algorithms/surface/brdf_whittaker.py python/siac/algorithms/surface/kernel_model.py python/siac/algorithms/grid/toa_psf.py python/siac/algorithms/surface/spectral_mapping.py python/siac/algorithms/surface/swir_refine.py python/siac/storage/writers.py python/siac/storage/readers.py python/siac/geo/reprojection.py python/siac/api/public.py python/siac/app/_assembly_correction.py python/siac/app/_assembly_io.py python/siac/app/_assembly_preprocessor.py python/siac/app/_assembly_providers.py python/siac/app/_assembly_rt.py python/siac/app/_assembly_solver.py python/siac/app/_assembly_surface.py python/siac/app/planning.py python/siac/app/s2_backend.py python/siac/app/sentinel2.py python/siac/workflows/_pipeline_config.py python/siac/workflows/scene.py python/siac/workflows/sentinel2.py"
build-rust = "maturin develop --release --skip-install --manifest-path src/siac_rs/Cargo.toml"
rust-test = "cargo test --manifest-path src/siac_rs/Cargo.toml"
# Invoke cargo-clippy directly (resolved via PATH -> the pixi env's clippy)
Expand Down
1 change: 1 addition & 0 deletions python/siac/adapters/satellite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@
)

# Import sensor-specific preprocessors to trigger registration
from siac.adapters.satellite.landsat import LandsatPreprocessor as LandsatPreprocessor
from siac.adapters.satellite.sentinel2 import Sentinel2Preprocessor as Sentinel2Preprocessor
13 changes: 11 additions & 2 deletions python/siac/adapters/satellite/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,20 @@ def detect_sensor(input_path: str | Path) -> str:
return "s2"

# Check for Landsat MTL
mtl_files = list(input_path.glob("*_MTL.txt")) + list(input_path.glob("*_MTL.xml"))
if input_path.is_file() and input_path.name.upper().endswith(("_MTL.TXT", "_MTL.JSON")):
mtl_files = [input_path]
else:
mtl_files = [
*input_path.glob("*_MTL.txt"),
*input_path.glob("*_MTL.json"),
*input_path.glob("*_MTL.xml"),
]
if mtl_files:
# Check if Landsat 8/9 or older
mtl_content = mtl_files[0].read_text()
if "LANDSAT_8" in mtl_content or "LANDSAT_9" in mtl_content:
if "LANDSAT_9" in mtl_content:
return "l9"
if "LANDSAT_8" in mtl_content:
return "l8"
elif "LANDSAT_5" in mtl_content or "LANDSAT_7" in mtl_content:
return "l5"
Expand Down
Loading
Loading