209209# since February 2022 DEA uses a new format for the technology data
210210# all excel sheets of updated technologies have a different layout and are
211211# given in EUR_2020 money (instead of EUR_2015)
212- new_format = ['solar-utility' ,
212+ cost_year_2020 = ['solar-utility' ,
213213 'solar-utility single-axis tracking' ,
214214 'solar-rooftop residential' ,
215215 'solar-rooftop commercial' ,
216216 'offwind' ,
217- 'electrolysis' ]
217+ 'electrolysis' ,
218+ 'biogas' ,
219+ 'biogas CC' ,
220+ 'biogas upgrading' ,
221+ 'direct air capture' ,
222+ 'biomass CHP capture' ,
223+ 'cement capture' ,
224+ 'BioSNG' ,
225+ 'BtL' ,
226+ 'biomass-to-methanol' ,
227+ 'biogas plus hydrogen' ,
228+ 'methanolisation' ,
229+ 'Fischer-Tropsch'
230+ ]
231+
232+ cost_year_2019 = ['direct firing gas' ,
233+ 'direct firing gas CC' ,
234+ 'direct firing solid fuels' ,
235+ 'direct firing solid fuels CC' ,
236+ 'industrial heat pump medium temperature' ,
237+ 'industrial heat pump high temperature' ,
238+ 'electric boiler steam' ,
239+ 'gas boiler steam' ,
240+ 'solid biomass boiler steam' ,
241+ 'solid biomass boiler steam CC' ,
242+ ]
243+
218244
219245# %% -------- FUNCTIONS ---------------------------------------------------
220246
@@ -273,7 +299,7 @@ def get_data_DEA(tech, data_in, expectation=None):
273299 usecols += f",{ uncrtnty_lookup [tech ]} "
274300
275301
276- if (tech in new_format ) or ("renewable_fuels" in excel_file ):
302+ if (( tech in cost_year_2019 ) or (tech in cost_year_2020 ) or ( "renewable_fuels" in excel_file ) ):
277303 skiprows = [0 ]
278304 else :
279305 skiprows = [0 ,1 ]
@@ -454,7 +480,7 @@ def get_data_DEA(tech, data_in, expectation=None):
454480 df_final = df_final .ffill (axis = 1 )
455481
456482 df_final ["source" ] = source_dict ["DEA" ] + ", " + excel_file .replace ("inputs/" ,"" )
457- if tech in new_format and (tech != "electrolysis" ):
483+ if tech in cost_year_2020 and (not ( "for_carbon_capture_transport_storage" in excel_file )) and ( not ( "renewable_fuels" in excel_file ) ):
458484 for attr in ["investment" , "Fixed O&M" ]:
459485 to_drop = df [df .index .str .contains (attr ) &
460486 ~ df .index .str .contains ("\(\*total\)" )].index
@@ -2184,9 +2210,13 @@ def prepare_inflation_rate(fn):
21842210 data = add_carbon_capture (data , tech_data )
21852211
21862212 # adjust for inflation
2187- data ["currency_year" ] = [2015 if x not in new_format else 2020 for x in
2188- data .index .get_level_values (0 )]
2189-
2213+ for x in data .index .get_level_values ("technology" ):
2214+ if x in cost_year_2020 :
2215+ data .at [x , "currency_year" ] = 2020
2216+ elif x in cost_year_2019 :
2217+ data .at [x , "currency_year" ] = 2019
2218+ else :
2219+ data .at [x , "currency_year" ] = 2015
21902220
21912221 # %% (2) -- get data from other sources which need formatting -----------------
21922222 # (a) ---------- get old pypsa costs ---------------------------------------
@@ -2321,4 +2351,4 @@ def prepare_inflation_rate(fn):
23212351 costs_tot .sort_index (inplace = True )
23222352 costs_tot .loc [:,'value' ] = round (costs_tot .value .astype (float ),
23232353 snakemake .config .get ("ndigits" , 2 ))
2324- costs_tot .to_csv ([v for v in snakemake .output if str (year ) in v ][0 ])
2354+ costs_tot .to_csv ([v for v in snakemake .output if str (year ) in v ][0 ])
0 commit comments