Skip to content

feat: productionise L1C custom-AC composite as S2L1CGeeSource (v0.6.0) - #2

Merged
MarcYin merged 1 commit into
mainfrom
feat/l1c-custom-ac-source
Jun 23, 2026
Merged

feat: productionise L1C custom-AC composite as S2L1CGeeSource (v0.6.0)#2
MarcYin merged 1 commit into
mainfrom
feat/l1c-custom-ac-source

Conversation

@MarcYin

@MarcYin MarcYin commented Jun 23, 2026

Copy link
Copy Markdown
Owner

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.

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]>
@MarcYin
MarcYin merged commit 5b214b2 into main Jun 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant