feat(bestpixel): end-to-end L1C custom-AC composite (v0.2.0) - #3
Merged
Conversation
Add `bestpixel.build_l1c_composite` — a Sentinel-2 L1C custom atmospheric-
correction monthly composite — to the published bestpixel package, with the
6S correction running in Rust and the GEE fetch in Python.
- Rust: new `correct_toa(toa, xap, xbp, xcp)` PyO3 function wired to the
crate's `atcorr` 6S core; applies rho_boa = y/(1+xcp*y), y = xap*rho_toa-xbp
per pixel, NaN nodata passthrough, negatives clamp to 0.
- python/bestpixel/l1c.py: build_l1c_composite — MAIAC clean-day gate,
scout-first windowed getPixels of L1C TOA + Cloud Score+, correct_toa (Rust),
best-pixel compose (lowest-AOD wins, cs tie-break), optional int16 GeoTIFF.
- python/bestpixel/_gee.py: lazy GEE fetch helper (getPixels patch, coarse
scout, asset resolution from the sidecar's system:index).
- python/bestpixel/atmosphere.py: 6S sidecar loader (AtmoSidecar/SceneAtmosphere).
- __init__ exports build_l1c_composite; __init__.pyi stub + README section.
- pyproject: 0.1.2 -> 0.2.0, numpy core dep, new [gee] extra
(earthengine-api, pyproj, rasterio); Cargo.toml bumped to match.
- tests/test_l1c.py: correct_toa round-trip + the pipeline with a fake ee.
Sidecar built by scripts/{build_atmo_sidecar,custom_ac_phase2_sixs,
atmo_sidecar_merge}.py; scripts/run_l1c_composite.sh runs it then the composite.
Validated live against GEE: blue 1338 / red 2243 DN (matches the prototype).
cargo test 11/11, bestpixel pytest 4/4, repo ruff clean.
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
bestpixel.build_l1c_composite— a Sentinel-2 L1C custom atmospheric- correction monthly composite — to the published bestpixel package, with the 6S correction running in Rust and the GEE fetch in Python.correct_toa(toa, xap, xbp, xcp)PyO3 function wired to the crate'satcorr6S core; applies rho_boa = y/(1+xcpy), y = xaprho_toa-xbp per pixel, NaN nodata passthrough, negatives clamp to 0.Sidecar built by scripts/{build_atmo_sidecar,custom_ac_phase2_sixs, atmo_sidecar_merge}.py; scripts/run_l1c_composite.sh runs it then the composite. Validated live against GEE: blue 1338 / red 2243 DN (matches the prototype). cargo test 11/11, bestpixel pytest 4/4, repo ruff clean.