Skip to content

Modeled landfills use measured site oxidation when available#34

Open
HughRunyan wants to merge 2 commits into
mainfrom
ers-update
Open

Modeled landfills use measured site oxidation when available#34
HughRunyan wants to merge 2 commits into
mainfrom
ers-update

Conversation

@HughRunyan

@HughRunyan HughRunyan commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Modeled landfills previously always received a type/gas-capture default oxidation factor (sanitary 0.10 no-capture / 0.22 with capture; controlled dump 0.05/0.10; dumpsite 0). The Climate TRACE waste-methane pipeline's input query carries a per-site oxidation column (populated for ~19% of sites from the standardized source table; NULL for the GPW/OSM area-matched branch) that was never read. This wires it in.

What changed

site_only_estimate_trace and citysite_estimate_trace now prefer the input oxidation over the default, via a new _build_oxidation_series(default, canonical_row, time_series_rows, years_range) helper:

  • Site-wide mean of the non-null input values as the full-series baseline, then a per-year overwrite (mean of conflicting same-year rows) keyed by reported_emissions_year where present — mirrors the existing gas_collection_efficiency handling one block below.
  • No input → the prior type/gas-capture default, broadcast across all years (unchanged for the ~81% of sites without a measured value).
  • Values are used as-is (no clamping) — a measured 0.35 passes through; the 0.25 biocover clamp is dead code (doing_fancy_ox is hardcoded False) and does not apply here.

The legacy WasteMAP builders (site_only_estimate, sinar_city_and_site) are intentionally left on defaults — they use a different row schema and are not on the Climate TRACE modeled-site path.

Model-output change (not breaking)

Emissions shift for the ~19% of sites with a measured oxidation; higher oxidation destroys more CH₄, so those sites model lower emissions. No API/schema/contract change.

Testing

  • New RMI_Climate_TRACE_Waste_Methane/tests/manual/test_input_oxidation.py: helper logic (mean baseline, per-year overwrite, conflicting-same-year averaging, unclipped 0.35, out-of-range years, no-input fallback) + end-to-end baseline (default 0.10 / 0.22, input 0.35 propagates, higher oxidation lowers emissions).
  • SWEET test suite (86) and the RMI manual mitigation suite (106) pass against this change.

Definition of done

  • Input oxidation preferred over the type/gas-capture default; default retained as fallback.
  • Tests pass (SWEET suite; RMI manual + smoke/unit).
  • Reviewed & merged (paired with the RMI PR below).

Paired PR

Consumed by RMI/RMI_Climate_TRACE_Waste_Methane#74 (same ers-update branch), which carries the value through to the mitigation stage and adds max(existing, new) oxidation semantics to the ERS strategies.

Flaring baseline (added — explicit default)

Also sets each modeled landfill's flaring destruction efficiency explicitly to dst_common.DEFAULT_FLARE_EFFICIENCY (0.98) in site_only_estimate_trace / citysite_estimate_trace, instead of leaving it unset and relying on model_v2's internal default. There is no per-site flaring-efficiency source (only flared volumes + a has_flaring boolean), so 0.98 is the canonical default; mitigation raises it to 0.98/0.99 for the few improve-GCCS strategies via _gccs_flaring's floor (max/clip). No TRACE output change — numerically identical to the prior monthly default. model_v2's annual-vs-monthly default inconsistency (1.0 vs 0.98) was left untouched (TRACE never uses the annual path; changing it would shift WasteMAP output).

🤖 Generated with Claude Code

Previously every modeled landfill got a type/gas-capture default oxidation
(sanitary 0.10 no-capture / 0.22 with capture; controlled dump 0.05/0.10;
dumpsite 0). The pipeline input query carries a per-site `oxidation` column
(populated for ~19% of rows from the standardized source table, NULL for the
GPW/OSM area-matched branch) that was never read.

site_only_estimate_trace and citysite_estimate_trace now prefer that input
value over the default via a new _build_oxidation_series helper:
- site-wide mean of non-null input values as the full-series baseline, then a
  per-year overwrite (mean of conflicting same-year rows) keyed by
  reported_emissions_year where present -- mirrors the existing
  gas_collection_efficiency handling;
- no input -> the prior type/gas-capture default, broadcast across all years;
- values used as-is (no clamping); the dead 0.25 biocover clamp does not apply.

model-output-change: emissions shift for the ~19% of sites with a measured
oxidation. Not a breaking change (schemas/contracts unchanged).

Paired with RMI_Climate_TRACE_Waste_Methane ers-update.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@HughRunyan HughRunyan added model-output-change Changes model OUTPUT values (expected progress, not breaking); results differ from prior runs enhancement New feature or request labels Jul 10, 2026
The modeled baseline previously left each landfill's `flaring` unset, so it fell to
model_v2's internal default (0.98 in the monthly path used by TRACE). There is no
per-site flaring-efficiency source column (the source has only flared volumes and a
has_flaring boolean), so no per-site value can be read.

site_only_estimate_trace and citysite_estimate_trace now set flaring explicitly to
dst_common.DEFAULT_FLARE_EFFICIENCY (0.98) on every TRACE landfill, so the value no
longer depends on model internals. A function-local import is used because dst_common
imports city_params (a top-level import would be circular).

No TRACE output change: baseline flaring was already effectively 0.98 via the monthly
default, so this is numerically identical. Mitigation still raises it to 0.98/0.99 for
the few improve-GCCS strategies via _gccs_flaring's floor (max/clip).

Deliberately NOT touched: model_v2's default handling. The annual estimate_emissions2
defaults unset flaring to 1.0 vs the monthly estimate_emissions_monthly's 0.98 -- a real
inconsistency, but TRACE/mitigation only use the monthly path, and changing the annual
default would shift WasteMAP/DST output. Left as a separate, optional cleanup.

Paired with RMI_Climate_TRACE_Waste_Methane ers-update.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request model-output-change Changes model OUTPUT values (expected progress, not breaking); results differ from prior runs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant