|
17 | 17 |
|
18 | 18 | configure_logging(snakemake) |
19 | 19 |
|
20 | | - leitmodell = snakemake.params.leitmodelle["buildings"] |
21 | | - logger.info(f"Using {leitmodell} for heating demand modification.") |
22 | | - |
23 | 20 | existing_heating = pd.read_csv(snakemake.input.existing_heating, index_col=0) |
24 | 21 |
|
25 | | - ariadne = pd.read_csv( |
26 | | - snakemake.input.ariadne, |
27 | | - index_col=["model", "scenario", "region", "variable", "unit"], |
28 | | - ).loc[ |
29 | | - leitmodell, |
30 | | - snakemake.params.fallback_reference_scenario, |
31 | | - "Deutschland", |
32 | | - :, |
33 | | - "million", |
34 | | - ] |
35 | | - |
36 | | - logger.info("Heating demand before modification:{existing_heating.loc['Germany']}") |
| 22 | + logger.info(f"Heating demand before modification:{existing_heating.loc['Germany']}") |
37 | 23 |
|
38 | 24 | mapping = { |
39 | 25 | "gas boiler": "Gas Boiler", |
|
43 | 29 | "biomass boiler": "Biomass Boiler", |
44 | 30 | } |
45 | 31 |
|
46 | | - year = "2020" |
47 | | - for tech in mapping: |
48 | | - stock = ariadne.at[ |
49 | | - f"Stock|Space Heating|{mapping[tech]}", |
50 | | - year, |
51 | | - ] |
52 | | - |
53 | | - peak = ( |
54 | | - stock |
55 | | - * existing_heating.loc["Germany"].sum() |
56 | | - / ariadne.at[f"Stock|Space Heating", year] |
57 | | - ) |
| 32 | + new_values = pd.Series() |
| 33 | + |
| 34 | + logger.warning( |
| 35 | + f"Adjusting heating stock towards hard coded values from a previous REMod run. This is only a hotfix." |
| 36 | + ) # Because REMod is not consistent and a better solution takes too long. |
| 37 | + |
| 38 | + new_values["gas boiler"] = 11.44 # million |
| 39 | + new_values["oil boiler"] = 5.99 |
| 40 | + new_values["air heat pump"] = 0.38 |
| 41 | + new_values["ground heat pump"] = 0.38 |
| 42 | + new_values["biomass boiler"] = 2.8 |
| 43 | + |
| 44 | + total_stock = new_values.sum() |
| 45 | + existing_factor = existing_heating.loc["Germany"].sum() / total_stock |
| 46 | + |
| 47 | + new_values *= existing_factor |
| 48 | + |
| 49 | + for tech, peak in new_values.items(): |
58 | 50 | existing_heating.at["Germany", tech] = peak |
59 | 51 |
|
60 | | - logger.info( |
61 | | - f"Heating demand after modification with {leitmodell}: {existing_heating.loc['Germany']}" |
62 | | - ) |
| 52 | + logger.info(f"Heating demand after modification: {existing_heating.loc['Germany']}") |
63 | 53 |
|
64 | 54 | existing_heating.to_csv(snakemake.output.existing_heating) |
0 commit comments