Skip to content

Commit

Permalink
add cumulative energy demand subset
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-young committed Nov 13, 2024
1 parent fa987ad commit 3032d1c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion fedelemflowlist/subset_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"energy":"get_energy_flows",
"renewable_energy":"get_renewable_energy_flows",
"nonrenewable_energy":"get_nonrenewable_energy_flows",
"ced":"get_ced_flows",
"USDA_CUS_pesticides":"get_USDA_CUS_pesticides",
"HAP":"get_hazardous_air_pollutant_flows"}

Expand All @@ -27,6 +28,7 @@
"energy":"MJ",
"renewable_energy":"MJ",
"nonrenewable_energy":"MJ",
"ced":"MJ",
"USDA_CUS_pesticides":"kg",
"HAP":"kg"}

Expand Down Expand Up @@ -111,7 +113,8 @@ def get_energy_flows(fl):
:param fl: df in standard flowlist format
:return: df in standard flowlist format
"""
list_of_flows = ['Uranium','Biomass','Hardwood','Softwood','Wood']
list_of_flows = ['Uranium','Biomass','Hardwood','Softwood','Wood',
'Wood, primary forest']
flows = fl[(fl["Unit"]=="MJ") | (fl['Flowable'].isin(list_of_flows))]
#Peat is captured in USGS_mineral_resource_flows so exclude here
flows = flows[flows['Flowable']!='Peat']
Expand Down Expand Up @@ -145,6 +148,21 @@ def get_nonrenewable_energy_flows(fl):

return flows

def get_ced_flows(fl):
"""
Subsets the flow list for all energy flows for use in the CED method
:param fl: df in standard flowlist format
:return: df in standard flowlist format
"""
flows = pd.concat([get_energy_flows(fl),
fl[(fl["Context"].str.startswith("resource"))
& (fl['Flowable'].isin(['Methane']))],
fl[fl['Flowable'] == 'Peat']],
ignore_index=True)

return flows

def get_hazardous_air_pollutant_flows(fl):
"""
Subsets the flow list for all HAP emissions based on list of flows from
Expand Down

0 comments on commit 3032d1c

Please sign in to comment.