feat: Phase 3 — S1Tiling conditions ingestion and discovery#153
feat: Phase 3 — S1Tiling conditions ingestion and discovery#153emmanuelmathot merged 3 commits intos1-rtcfrom
Conversation
Add conditions ingestion support for time-invariant per-orbit arrays (gamma_area, LIA, incidence_angle) written into a 'conditions' group under each orbit direction. Includes: - ingest_s1tiling_conditions() and discover_s1tiling_conditions() - CLI commands: ingest-s1, ingest-s1-conditions, consolidate-s1 - Updated package exports - 20 new tests covering ingestion, discovery, validation, and errors
There was a problem hiding this comment.
Pull request overview
Adds Phase 3 support for ingesting and discovering Sentinel-1 S1Tiling “conditions” (time-invariant, per-relative-orbit rasters) into the S1 GRD RTC GeoZarr V3 hierarchy, and exposes the workflows via CLI commands with accompanying tests.
Changes:
- Implemented
ingest_s1tiling_conditions()to write per-orbit 2D condition arrays under an orbit-directionconditions/group. - Implemented
discover_s1tiling_conditions()to find and group condition GeoTIFFs by(tile, orbit). - Added CLI subcommands (
ingest-s1,ingest-s1-conditions,consolidate-s1) and expanded tests for ingestion/discovery.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
src/eopf_geozarr/conversion/s1_ingest.py |
Adds condition filename patterns, discovery, and ingestion into conditions/ group. |
src/eopf_geozarr/cli.py |
Adds S1 ingestion-related CLI commands and wiring. |
src/eopf_geozarr/conversion/__init__.py |
Exports new S1 conditions discovery/ingestion functions. |
tests/test_s1_rtc_ingest.py |
Adds unit tests for conditions ingestion and discovery behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Validate CRS, transform, and shape for every condition file against the reference (not just the first) - Validate existing conditions group metadata when re-opening - Check array shape before overwrite and raise on mismatch - Add incidence_angle discovery pattern (S1TILING_INCIDENCE_ANGLE_PATTERN) - Fix CLI help text to mention incidence_angle - Fix docstring to describe actual return schema (keys present only when files discovered) - Add tests: LIA-only schema validation, cross-file CRS mismatch, cross-file shape/transform mismatch, overwrite shape mismatch, incidence_angle discovery, all-three-types grouping 53/53 tests passing.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Simplify GAMMA_AREA regex to match actual S1Tiling output (GAMMA_AREA_<tile>_<orbit>.tif only, no platform/direction segments) - Validate condition transform/shape against orbit group's native grid - Normalize tile identifiers to uppercase in discovery - Warn on duplicate gamma_area files for same tile/orbit - Guard nanmin/nanmax in logging against all-NaN condition data - Add tests: tile casing normalization, all-three-types grouping 54/54 tests passing.
emmanuelmathot
left a comment
There was a problem hiding this comment.
Tested locally and then view on titiler!
Phase 3 — S1Tiling Conditions Ingestion and Discovery
Adds support for ingesting time-invariant per-orbit condition arrays (gamma_area, LIA, incidence_angle) into a
conditionsgroup under each orbit direction.Closes part of #139 (Phase 3).
Changes
src/eopf_geozarr/conversion/s1_ingest.pyS1TILING_GAMMA_AREA_PATTERN/S1TILING_LIA_PATTERN— regex constants for condition file discoveryingest_s1tiling_conditions()— creates conditions group with proj:/spatial: attrs, writes per-orbit(Y, X)arraysdiscover_s1tiling_conditions()— groups condition GeoTIFFs by tile + orbitsrc/eopf_geozarr/cli.pyingest-s1— ingest a single acquisition (VV + VH + mask)ingest-s1-conditions— ingest condition arrays for an orbitconsolidate-s1— post-batch consolidationsrc/eopf_geozarr/conversion/__init__.pydiscover_s1tiling_conditionsandingest_s1tiling_conditionsto exportstests/test_s1_rtc_ingest.pyTestIngestConditions(14 tests) andTestDiscoverConditions(5 tests)Test summary
TestIngestConditionsTestDiscoverConditions