-
Notifications
You must be signed in to change notification settings - Fork 12
/
run.py
39 lines (30 loc) · 1.68 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# define database and the baseline scenario
import numpy as np
from utils.pp_plot_emissions import plot_emissions
from utils.pp_plot_gas_use import plot_gas_use
from utils.pp_plot_heatmaps import plot_heatmap_comparison
from utils.pp_plot_power_sector import plot_power_sector
from utils.pp_result_to_iamc import results_to_xlsx
from utils.run_scenarios import run_scenarios
model = 'MESSAGE South Africa'
baseline = 'baseline'
database = 'message_sa'
# shale gas extraction costs (USDpGJ) & carbon costs (USDtCO2) to model
shale_cost = sorted(list(set([0.3, 0.5, 1, 3, 1000] + [round(i, 1) for i in np.arange(0.3, 8, 0.4)] + [1000])))
carbon_cost = list(set([0, 1, 3, 7, 10, 15, 30, 60] + list(range(0, 62, 2))))
# run the scenarios
run_scenarios(model, baseline, database, shale_cost, carbon_cost)
# run the postprocessing
results_to_xlsx(model, baseline, database, shale_cost, carbon_cost)
# plot ghg-emissions over the model horizon
plot_emissions(c=[0, 1, 3, 7, 15, 30, 60])
# plot energy and capacity mix of the power sector
plot_power_sector(s=[1, 3, 1000], c=[0, 10, 30], order=[(1000, 0), (1000, 10), (1000, 30),
(3, 0), (3, 10), (3, 30), (1, 0), (1, 10), (1, 30)])
# plot energy and capacity mix of the power sector
plot_gas_use(s=[1, 3, 1000], c=[0, 10, 30], order=[(1000, 0), (1000, 10), (1000, 30),
(3, 0), (3, 10), (3, 30), (1, 0), (1, 10), (1, 30)])
# plot the scenario analysis heat maps - the variable 'years' indicates which years are presented in the plot
plot_heatmap_comparison(years=[2030])
plot_heatmap_comparison(years=[2050])
plot_heatmap_comparison(years=[2020, 2030, 2040, 2050])