Skip to content

CH4 emission accounting from Material Reporting #524

Description

@Tyler-lc

Currently the Material reporting has a bug when calculating CH4 emissions.
The file run_reporting.py loads the
CH4-emi.yaml. The method pyam_df_from_rep requests a standard set of indexes for all reporting keys.
The genno reporter is not filtering properly, because the requested keys do not all exist (commodity and level are not part of the key emi), which means that Genno will return ALL indexes.
The .join() applied to DF, will correctly apply the reporting variable to each technology.
But then the .groupby is where things break. Beacuse we are grouping by ["nl", "ya", "iamc_variable"], we are actually summing up ALL available emissions. That means that if a technology has in the parameter emission_fator :

  • TCE
  • PM2p5
  • CO2_industry
  • CH4_IND_ENE_COAL
  • N2O_IND_ENE_COAL
  • TCE_non-CO2
  • TCE_other

All of these entries will be summed up. I think the reason is that we are not filtering by emission type. And there is no information anywhere for the reporter that provides that emission type.
Most likely, the solution would be to have not just the

var: emi

but to spell out the whole key:

var: emi:t-ya-yv-m-e  #or similar

Plus, we would need to specify in the yaml file, the actualy emission type we are looking for, so that we can filter for it properly.
For example, in the case of Industrial Processes|Iron and Steel

  Industrial Processes|Iron and Steel:
    filter:
      { technology: [DUMMY_limestone_supply_steel, prod_charcoal_steel, sinter_steel, pellet_steel, bf_steel, bof_steel,  eaf_steel, finishing_steel], mode: [M1, M2, M3, M4], emission[ADD EMISSIONS TYPE HERE]}
    short:
      emi_ch4_ind_proc_steel

This way, technologies that do not actually contain any CH4 (such as pellet_steel) will be filtered out. While those that do contain any of the emissions in the specified emission will be included, and only that type of emission will be kept in the DF.
I'm not entirely sure if this is the best way to go about it. There are several types of CH4 emissions to account for different things (leakages on the pipelines, industrial use, non-energy use, etc., pure CH4 emissions). I suppose that each of these emission types should end up in a different iamc variable anyway.
@macflo8 and I briefly discussed this issue already. Currently this may not be a big issue. I have found this to happen only for the CH4_emi.yaml. But it may affect all emission reporting done through the genno reporter that follow this structure.
I know @khaeru has definitely more experience with the Genno reporting. I don't know if you have any suggestion on the matter.

Metadata

Metadata

Labels

bugSomething isn't workingreportgenno-based reporting and post-solve processing

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions