feat: productionise L1C custom-AC composite as S2L1CGeeSource (v0.6.0) - #2
Merged
Conversation
Add a Sentinel-2 L1C custom atmospheric-correction composite as a first-class package source, reusing the existing scout/select/windowed-fetch/compositor machinery (the same path as sources/s2_gee.py for L2A). - atmosphere.py: AtmoSidecar + SceneAtmosphere — load the per-scene 6S sidecar, select_low_aod clean-day gate, (tile,date) lookup so a GEE system:index matches a sidecar keyed by earth-search STAC id, and vectorized 6S TOA->BOA correction (pure numpy, mirrors the Rust atcorr core). - sources/s2_l1c_gee.py: S2L1CGeeSource — lists L1C + Cloud Score+ scenes, restricts to the lowest-AOD fraction, scouts coarse Cloud Score+, fetches raw TOA via getPixels (no compute graph, ~2.5x faster than computePixels for raw assets), 6S-corrects each chunk, and emits Observation(data=BOA, quality). - sources/s2.py: S2_L1C constants + aod_cloud_score_to_quality — gate on Cloud Score+, then rank clear pixels by lowest MAIAC AOD (most reliable correction) with cs as a deterministic tie-break (cs saturates near 1.0 on clear pixels). - cli.py/types.py: wire --gee-product s2_l1c --atmosphere-sidecar --low-aod-frac. - scripts/run_l1c_composite.sh: sidecar generation (3 stages) + the CLI build. - tests: test_atmosphere.py, test_s2_l1c_gee.py, plus aod-quality coverage. Validated live against GEE: the CLI composite matches the earlier prototype within ~2-3 DN (Cairo blue 1338 vs 1336, red 2244 vs 2241). 97 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a Sentinel-2 L1C custom atmospheric-correction composite as a first-class package source, reusing the existing scout/select/windowed-fetch/compositor machinery (the same path as sources/s2_gee.py for L2A).
Validated live against GEE: the CLI composite matches the earlier prototype within ~2-3 DN (Cairo blue 1338 vs 1336, red 2244 vs 2241). 97 tests pass.