Skip to content

elementaryflows.py

jgrooviest edited this page Aug 6, 2019 · 2 revisions

Description: This script compares the names of the wastes and replaces them with names in the Federal LCA Commons elementary flows list. Other flows are also handled. Along with that, types of flows and compartment information are also determined and indexed.

  • mapping_to_fedelemflows is a df that maps various emissions/waste streams to corresponding openLCA UUIDs.
  • compartment_to_flowtype is a df that maps compartments to valid flow types for JSON or openLCA.

Functions: There are two main functions and 2 helper functions:

  • map_missions_to_fedelemflows - Will map emissions from a given dataframe to the correct flows in the federal flow list based on matching sources (e.g., national emissions inventory [NEI], flow name, and compartment (e.g., emissions/air)
  • map_renewable_heat_flows_to_fedelemflows - Maps inputs of "Heat" to the various energy types for renewables.
  • map_compartment_to_flow_type - The primary purpose of this function is to take an input dataframe with compartment values and output the same dataframe but with a new column corresponding to flowtype values.
  • add_flow_direction - The main purpose of this function is to add a "FlowDirection" column to the input dataframe that indicates either output direction or input direction. Setting to input requires either a compartment type of input, or a value in the ElementaryFlowPrimeContext equal to resources.

Data: All dataframes used are inputted as arguments to the functions contained in this script.

Dependencies:

  • pandas
  • fedelemflowlist
  • electricitylci
Clone this wiki locally