Skip to content

examples: ERA LTE Tier-1 integration script (#110)#112

Open
Sammyjoseph999 wants to merge 3 commits into
mainfrom
feat/era-lte-tier1-110
Open

examples: ERA LTE Tier-1 integration script (#110)#112
Sammyjoseph999 wants to merge 3 commits into
mainfrom
feat/era-lte-tier1-110

Conversation

@Sammyjoseph999

Copy link
Copy Markdown
Collaborator

Adds the ERA LTE Tier-1 integration as a runnable, reviewable file (examples/era_lte_tier1.py) instead of living only in the issue discussion. Relates to #110.

What it does

Bridges the ERA LTEs dataset (ERAgriculture/LTEs) to this toolkit with no R required:

  • Reads ERA's shipped data/unique_ltes.csv registry (LTE.ID, Site.ID, Year.start, Year.end, Latitude, Longitude).
  • Defensively parses the messy year columns, drops rows with missing coords, and dedups the repeated registry → one run per unique LTE site-period.
  • Runs analyze_climate_statistics with auto season detection per site and flattens season_statistics into a tidy per-season climate table (rainfall total, rainy/dry days, mean temp, NDWS, WRSI).
  • --dry-run (list sites, no fetch) and --limit N for safe testing.

Verification

  • ruff clean.
  • Ran --dry-run against the real ERA unique_ltes.csv: parses/dedups to 358 unique site-periods and lists them correctly. (A full run fetches Earth Engine data per site, so --limit is provided for validation first.)

Scope

This is Tier 1 (the pure-Python pass). Tier 2 — the yield comparison — needs a short R export of ERA's season windows + crop/yield from the industrious_elephant .RData tables, then feeds the adapter documented on #110. That stays as a workflow step; this PR just lands the runnable Tier-1 entry point under examples/.

Runnable bridge from the ERA LTEs dataset to the toolkit: reads ERA's shipped
unique_ltes.csv registry and runs analyze_climate_statistics with auto season
detection per LTE site-period, emitting a tidy per-season climate table. No R
needed for this tier. --dry-run / --limit for safe testing. Verified against
the real ERA CSV (parses/dedups to 358 site-periods) and ruff clean.
@Sammyjoseph999
Sammyjoseph999 force-pushed the feat/era-lte-tier1-110 branch from da1510b to cfa63b9 Compare July 8, 2026 09:28
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