Modeled landfills use measured site oxidation when available#34
Open
HughRunyan wants to merge 2 commits into
Open
Modeled landfills use measured site oxidation when available#34HughRunyan wants to merge 2 commits into
HughRunyan wants to merge 2 commits into
Conversation
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]>
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]>
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.
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
oxidationcolumn (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_traceandcitysite_estimate_tracenow prefer the input oxidation over the default, via a new_build_oxidation_series(default, canonical_row, time_series_rows, years_range)helper:reported_emissions_yearwhere present — mirrors the existinggas_collection_efficiencyhandling one block below.doing_fancy_oxis hardcodedFalse) 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
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).Definition of done
Paired PR
Consumed by RMI/RMI_Climate_TRACE_Waste_Methane#74 (same
ers-updatebranch), which carries the value through to the mitigation stage and addsmax(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) insite_only_estimate_trace/citysite_estimate_trace, instead of leaving it unset and relying onmodel_v2's internal default. There is no per-site flaring-efficiency source (only flared volumes + ahas_flaringboolean), 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