adjust mapping energy demand per ct

This commit is contained in:
lisazeyen 2024-07-29 17:37:06 +02:00
parent 2f3fde26d0
commit b0e00249aa

View File

@ -36,7 +36,7 @@ For each country and each subcategory of
- Integrated steelworks - Integrated steelworks
- Machinery Equipment - Machinery Equipment
- Methanol - Methanol
- Other Industrial Sectors - Other industrial sectors
- Other chemicals - Other chemicals
- Other non-ferrous metals - Other non-ferrous metals
- Paper production - Paper production
@ -74,46 +74,49 @@ ktoe_to_twh = 0.011630
# name in JRC-IDEES Energy Balances # name in JRC-IDEES Energy Balances
sector_sheets = { sector_sheets = {
"Integrated steelworks": "cisb", "Integrated steelworks": "FC_IND_IS_BF_E",
"Electric arc": "cise", "Electric arc": "FC_IND_IS_EA_E",
"Alumina production": "cnfa", "Alumina production": "FC_IND_NFM_AM_E",
"Aluminium - primary production": "cnfp", "Aluminium - primary production": "FC_IND_NFM_PA_E",
"Aluminium - secondary production": "cnfs", "Aluminium - secondary production": "FC_IND_NFM_SA_E",
"Other non-ferrous metals": "cnfo", "Other non-ferrous metals": "FC_IND_NFM_OM_E",
"Basic chemicals": "cbch", "Basic chemicals": "FC_IND_CPC_BC_E",
"Other chemicals": "coch", "Other chemicals": "FC_IND_CPC_OC_E",
"Pharmaceutical products etc.": "cpha", "Pharmaceutical products etc.": "FC_IND_CPC_PH_E",
"Basic chemicals feedstock": "cpch", "Basic chemicals feedstock": "FC_IND_CPC_BC_E",
"Cement": "ccem", "Cement": "FC_IND_NMM_CM_E",
"Ceramics & other NMM": "ccer", "Ceramics & other NMM": "FC_IND_NMM_CR_E",
"Glass production": "cgla", "Glass production": "FC_IND_NMM_GL_E",
"Pulp production": "cpul", "Pulp production": "FC_IND_PPP_PU_E",
"Paper production": "cpap", "Paper production": "FC_IND_PPP_PA_E",
"Printing and media reproduction": "cprp", "Printing and media reproduction": "FC_IND_PPP_PR_E",
"Food, beverages and tobacco": "cfbt", "Food, beverages and tobacco": "FC_IND_FBT_E",
"Transport Equipment": "ctre", "Transport equipment": "FC_IND_TE_E",
"Machinery Equipment": "cmae", "Machinery equipment": "FC_IND_MAC_E",
"Textiles and leather": "ctel", "Textiles and leather": "FC_IND_TL_E",
"Wood and wood products": "cwwp", "Wood and wood products": "FC_IND_WP_E",
"Mining and quarrying": "cmiq", "Mining and quarrying": "FC_IND_MQ_E",
"Construction": "ccon", "Construction": "FC_IND_CON_E",
"Non-specified": "cnsi", "Non-specified": "FC_IND_NSP_E",
} }
fuels = { fuels = {
"All Products": "all", "Total": "all",
"Solid Fuels": "solid", "Solid fossil fuels": "solid",
"Total petroleum products (without biofuels)": "liquid", "Peat and peat products": "solid",
"Gases": "gas", "Oil shale and oil sands": "solid",
"Oil and petroleum products": "liquid",
"Manufactured gases": "gas",
"Natural gas": "gas",
"Nuclear heat": "heat", "Nuclear heat": "heat",
"Derived heat": "heat", "Heat": "heat",
"Biomass and Renewable wastes": "biomass", "Renewables and biofuels": "biomass",
"Wastes (non-renewable)": "waste", "Non-renewable waste": "waste",
"Electricity": "electricity", "Electricity": "electricity",
} }
eu28 = cc.EU28as("ISO2").ISO2.tolist() eu27 = cc.EU27as("ISO2").ISO2.tolist()
jrc_names = {"GR": "EL", "GB": "UK"} jrc_names = {"GR": "EL", "GB": "UK"}
@ -139,7 +142,7 @@ def industrial_energy_demand_per_country(country, year, jrc_dir):
) )
sel = ["Mining and quarrying", "Construction", "Non-specified"] sel = ["Mining and quarrying", "Construction", "Non-specified"]
df["Other Industrial Sectors"] = df[sel].sum(axis=1) df["Other industrial sectors"] = df[sel].sum(axis=1)
df["Basic chemicals"] += df["Basic chemicals feedstock"] df["Basic chemicals"] += df["Basic chemicals feedstock"]
df.drop(columns=sel + ["Basic chemicals feedstock"], index="all", inplace=True) df.drop(columns=sel + ["Basic chemicals feedstock"], index="all", inplace=True)
@ -189,20 +192,20 @@ def separate_basic_chemicals(demand, production):
return demand return demand
def add_non_eu28_industrial_energy_demand(countries, demand, production): def add_non_eu27_industrial_energy_demand(countries, demand, production):
non_eu28 = countries.difference(eu28) non_eu27 = countries.difference(eu27)
if non_eu28.empty: if non_eu27.empty:
return demand return demand
eu28_production = production.loc[countries.intersection(eu28)].sum() eu27_production = production.loc[countries.intersection(eu27)].sum()
eu28_energy = demand.groupby(level=1).sum() eu27_energy = demand.groupby(level=1).sum()
eu28_averages = eu28_energy / eu28_production eu27_averages = eu27_energy / eu27_production
demand_non_eu28 = pd.concat( demand_non_eu27 = pd.concat(
{k: v * eu28_averages for k, v in production.loc[non_eu28].iterrows()} {k: v * eu27_averages for k, v in production.loc[non_eu27].iterrows()}
) )
return pd.concat([demand, demand_non_eu28]) return pd.concat([demand, demand_non_eu27])
def industrial_energy_demand(countries, year): def industrial_energy_demand(countries, year):
@ -232,10 +235,10 @@ if __name__ == "__main__":
set_scenario_config(snakemake) set_scenario_config(snakemake)
params = snakemake.params.industry params = snakemake.params.industry
year = params.get("reference_year", 2015) year = params.get("reference_year", 2019)
countries = pd.Index(snakemake.params.countries) countries = pd.Index(snakemake.params.countries)
demand = industrial_energy_demand(countries.intersection(eu28), year) demand = industrial_energy_demand(countries.intersection(eu27), year)
# output in MtMaterial/a # output in MtMaterial/a
production = ( production = (
@ -245,7 +248,7 @@ if __name__ == "__main__":
demand = separate_basic_chemicals(demand, production) demand = separate_basic_chemicals(demand, production)
demand = add_non_eu28_industrial_energy_demand(countries, demand, production) demand = add_non_eu27_industrial_energy_demand(countries, demand, production)
# for format compatibility # for format compatibility
demand = demand.stack(future_stack=True).unstack(level=[0, 2]) demand = demand.stack(future_stack=True).unstack(level=[0, 2])