Skip to content

feat(analysis): map GHG FBS lines to CEDA emissions sources - #1135

Merged
MoLi7 merged 4 commits into
mainfrom
mo__fbs-ceda-es-crosswalk
Oct 21, 2026
Merged

MoLi7 merged 4 commits into
mainfrom
mo__fbs-ceda-es-crosswalk

Conversation

@MoLi7

@MoLi7 MoLi7 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

cc:
Closes:

What changed? Why?

Adds bedrock/analysis/emissions_source_crosswalk, which tags every GHG FBS line (source × GHGI activity × gas) with one of CEDA's 123 EmissionsSource codes. Lines the FBS still lumps together (soils, non-energy use, general aviation, residential/commercial, unspecified HFCs) are split without moving any sector total, and per-source totals are compared with CEDA's own E_USA_ES. This is groundwork for exporting E by source on Cornerstone codes (#1134).

Impact

No output change: analysis only, no config, pipeline code or snapshot touched.

Review focus

  • fbs_to_ceda_emissions_source.csv: the mapping choices; check: notes mark the judgment calls.
  • build_nested_split.py: non-energy use is fitted to the EPA table's national fuel mix while keeping sector totals.
  • .gitignore: one exception so the crosswalk CSV is tracked.

Testing

black, ruff and mypy pass repo-wide; hermetic pytest was not run (collection needs S3, blocked locally) and this folder adds no tests.

Evidence

2024 canonical FBS (GHG_national_Cornerstone_2024, rebuilt at cdc1d1f with retain_activity_columns=True; every source × gas total matches a rebuild without the flag and the earlier nowcast_facilities_transportation_2024 build).

Status Mt CO2e (AR6) Share
One CEDA source 6,249.1 99.9%
No CEDA source 7.3 0.1%
No species named 0.7 <0.1%

Against CEDA E_USA_ES (AR5 CO2e, industries only):

bedrock 2024 CEDA v7.1 CEDA v8.1
Total 4,768.9 4,929.5 4,854.0
CO2 3,596.3 3,745.8 3,623.3
CH4 682.2 681.8 666.7
N2O 378.3 381.9 391.6

Flagged sources (data or allocation differences, not mapping): electricity N2O 3.9 vs 17.1 (eGRID), motor gasoline 45.6 vs 113.8 (households), HFC-23 from HCFC-22 0.39 vs 2.0, field-burning CH4 0.65 vs 0.29.

🤖 Generated with Claude Code

# Everything else (target schema, caches, attribution sources) is inherited.

!include:GHG_national_Cornerstone_nowcast_facilities_transportation_2024.yaml
# The GHGRP floor moves combustion CO2 between sectors and needs the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@catherinebirney I'm trying to interpret this - if we will want to update our base methods (after #1133) to include this more granular detail or not

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't hurt to make this more clear in the fbs method - makes sense to be as clear about the metadata as we can

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MoLi7 can you rebase on main and update this include to use just GHG_national_Cornerstone_2024

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just rebased!

bl-young added a commit that referenced this pull request Oct 21, 2026
…sources

Rename gas E to E_USA_GAS and reserve E_USA_ES for ceda EmissionsSource x
industries. Stub ES as zeros (123 rows) until the #1135 crosswalk fills it;
add empty E_USA_ES_LONG for the GWP long table.
@catherinebirney

Copy link
Copy Markdown
Member

@MoLi7 overall the mapping looks good - it does look like it is missing a few activities

  1. "Coal Residential and Commercial", methane and nitrous oxide, on UMD_GHGIA_T_3_12. Update to map to residential sources. CEDA has no commercial-coal source for those gases.

  2. "Electronics Industry", "PV", and "MEMS" on UMD_GHGIA_T_4_57. Use the same semiconductor sources as "Semiconductors".

  3. Flowable "Nitrous oxide" on UMD_GHGIA_T_3_27 and UMD_GHGIA_T_3_30. CEDA has no source for that gas on either table. They were empty in this run, but they are in the method YAML.

@MoLi7

MoLi7 commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

@MoLi7 overall the mapping looks good - it does look like it is missing a few activities

  1. "Coal Residential and Commercial", methane and nitrous oxide, on UMD_GHGIA_T_3_12. Update to map to residential sources. CEDA has no commercial-coal source for those gases.
  2. "Electronics Industry", "PV", and "MEMS" on UMD_GHGIA_T_4_57. Use the same semiconductor sources as "Semiconductors".
  3. Flowable "Nitrous oxide" on UMD_GHGIA_T_3_27 and UMD_GHGIA_T_3_30. CEDA has no source for that gas on either table. They were empty in this run, but they are in the method YAML.

@catherinebirney good callout, I tried to fix them in 0f4eba9, lmk if it doesn't make sense to you.

MoLi7 and others added 3 commits October 21, 2026 09:24
Adds bedrock/analysis/emissions_source_crosswalk: a hand-written crosswalk
from GHG FBS lines (source x GHGI activity x gas) to CEDA's 123
EmissionsSource codes, per-sector splits for lines the FBS still lumps
together, and a comparison against CEDA's own source-level E.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-gas N2O

Adds crosswalk rows for activities in the method YAML that had no
emissions in the 2024 run: coal residential and commercial CH4/N2O go to
the residential sources (CEDA has no commercial coal source for those
gases), the T_4_57 species rows now cover Electronics Industry, PV and
MEMS as well as Semiconductors, and N2O on T_3_27 / T_3_30 is marked as
having no CEDA source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nerstone_2024

The nowcast and facilities_transportation 2024 methods it included were
removed when the GHG methods were consolidated. The helper now inherits
from and includes GHG_national_Cornerstone_2024, which carries the same
soils and non-energy-use blocks, and is renamed to match. Drops the
removed egrid_fbs_method_for_config from the default-method lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MoLi7
MoLi7 force-pushed the mo__fbs-ceda-es-crosswalk branch from 0f4eba9 to cdc1d1f Compare October 21, 2026 16:25
@bl-young

Copy link
Copy Markdown
Member

ok if @catherinebirney is good with the mapping then I think we can approve - i'll leave it to you

@catherinebirney catherinebirney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mappings look good to me - I compared them to the mapping files we originally created for the EPA GHGI data to CEDA and looks like everything is covered here for the similar UMD naming

…_Cornerstone_2024

Rebuilt on the consolidated method, non-energy use already follows the EPA
table's national fuel mix sector by sector, so the national fit is a
no-op safeguard and no sector needs the prefix fallback. Updates the README
and docstring to say so, and narrows the helper's sources_to_cache to the
USDA cropland source the soils tables read, so it no longer pulls the
facility datasets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MoLi7

MoLi7 commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

Thank you both for your inputs @catherinebirney @bl-young !

Merging it now. @bl-young would you drive the FBS refresh process after this? Not this week urgent but we will need to add E_USA_ES to snapshot.

@bl-young

Copy link
Copy Markdown
Member

Yes in the next few days we will cut the full time series with the updated FBS names and these extensions as well. So i'll roll this in.

@MoLi7

MoLi7 commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

@bl-young that plan sounds good. Claude helped me get a few follow-up items after merge. 1 and 2 are mechanical, 3 and 4 need judgement calls. Happy to discuss them later.

  1. FBS refresh:
    • Build the GHG FBS with retain_activity_columns=True, with pinned uploads so nothing else drifts.
    • Ideally put the nested soils and non-energy-use sets into the method itself, which would retire the helper YAML.
  2. The export:
    • E_USA_ES: 123 sources × 405 industries, AR6 kg CO2e.
    • Rename today's gas matrix to E_USA_GAS.
    • The long table for the HFC/PFC multipliers. Its name isn't agreed yet; I suggested E_USA_ES_GAS.
    • Ship all of it in one snapshot bump coordinated with CEDA's reader switch for ceda#470.
  3. An unresolved contract point. For E_USA_ES to sum to E_USA_GAS:
    • Both need the same handling of unspecified HFCs. Speciating them at AR6 adds about 2.8 Mt.
    • Both need the same fossil/biogenic CH4 rule.
  4. Decisions still with CEDA:
    • labels for the 7.3 Mt with no CEDA source: fluorochemical production, CO2 from coal mining, and other SF6;
    • the post-meter and indirect-N2O judgment calls.

@bl-young

Copy link
Copy Markdown
Member

yes this is started in #1136

@MoLi7
MoLi7 merged commit 436cff5 into main Oct 21, 2026
5 checks passed
@MoLi7
MoLi7 deleted the mo__fbs-ceda-es-crosswalk branch October 21, 2026 17:11
bl-young added a commit that referenced this pull request Oct 21, 2026
…hots (#1136)

* feat(ghg): retain ActivityProducedBy on Cornerstone GHG FBS builds

Enable source-resolved E export by keeping GHGI activity names through
generateFlowBySector, and pool waste Use resplits by activity so those
labels survive.

* feat(snapshots): wire E_USA_GAS / E_USA_ES / E_USA_ES_LONG with stub sources

Rename gas E to E_USA_GAS and reserve E_USA_ES for ceda EmissionsSource x
industries. Stub ES as zeros (123 rows) until the #1135 crosswalk fills it;
add empty E_USA_ES_LONG for the GWP long table.

* drop FBA columns from the FBS when we retain activity names

---------

Co-authored-by: catherinebirney <60186515+catherinebirney@users.noreply.github.com>
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.

3 participants