Skip to content

combinator.py

Matt Jamieson edited this page May 19, 2020 · 3 revisions

Description: This module contains several utilities for combining the data from different sources, such as from modules providing life cycle inventory and the modules providing power plant facility emissions.

Functions: There are 3 main functions -

  • concat_map_upstream_databases(*arg) - This function concatenates the various upstream databases provided by different modules [coal_upstream.py], [solar_upstream.py], [natural_gas_upstream.py], etc. Once the dataframes are combined, the emissions are mapped to the federal LCA commons elementary flow list, using a flow mapping dataframe generated by the federal LCA commons elementary flow list module. Note that this crosswalk is not 100% complete so some rows will disappear from the returned dataframe.

  • concat_clean_upstream_and_plant(pl_df, up_df) - This function will take the combined upstream dataframes and combine it with the power plant facility-level emissions, generated by Standardized Emission and Waste Inventories (StEWI) and ampd_plant_emissions.py. This function also cleans up some columns and applies a filter as to what qualifies as a coal, natural gas, etc. power plant. Anything with less than 90% of its generation coming from a given fuel type is labeled as MIXED. The cutoff is actually available as a parameter in the configuration file.

  • add_fuel_inputs(gen_df, upstream_df, upstream_dict) - To support the translation of the entire life cycle inventories to openLCA, in a manageable format, all of the upstream fuel emissions (e.g. coal mining/transport, natural gas extraction, nuclear fuel cycle) are removed from the dataframe and converted to either mass or energy inputs of fuel. These serve as the quantities of product flows between the various processes in openLCA. This module provides that translation.

Clone this wiki locally