Skip to content

Commit

Permalink
state of generation of modelling results
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Eggimann committed Nov 7, 2018
1 parent 810d8a2 commit e7de72e
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 41 deletions.
5 changes: 3 additions & 2 deletions docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,13 +553,14 @@ Data preparation of the raw input files was necessary:
### 4.4 Temperature data
To calculate regional daily hourly load heating profiles, hourly temperature data are used from the [UK Met Office (2015)](http://catalogue.ceda.ac.uk/uuid/220a65615218d5c9cc9e4785a3234bd0) and loaded for weather stations across the UK.

- The station ID can be retreived [here](http://badc.nerc.ac.uk/cgi-bin/midas_stations/search_by_name.cgi.py?name=&minyear=&maxyear=)
- Metadatda of raw data can be found [here](http://artefacts.ceda.ac.uk/badc_datadocs/ukmo-midas/WH_Table.html)

### 4.5 Census data
Employment statistics from the census (Office for National Statistics 2011)
are used to disaggregate industry related energy demands for different end uses and sectors.

- The data download link can be found [here](http://catalogue.ceda.ac.uk/uuid/916ac4bbc46f7685ae9a5e10451bae7c)
- The station ID can be retreived [here](http://badc.nerc.ac.uk/cgi-bin/midas_stations/search_by_name.cgi.py?name=&minyear=&maxyear=)
- Metadatda of raw data can be found [here](http://artefacts.ceda.ac.uk/badc_datadocs/ukmo-midas/WH_Table.html)

## Literature

Expand Down
4 changes: 2 additions & 2 deletions energy_demand/geography/weather_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def __init__(
tech_stock=rs_tech_stock,
rs_hdd_cy=self.rs_hdd_cy,
model_yeardays=assumptions.model_yeardays)

# ------------
# Set criteria wheter to use float load profile for heat pumps or not
# ------------
Expand Down Expand Up @@ -307,7 +307,7 @@ def __init__(
unique_identifier=uuid.uuid4(),
technologies=assumptions.tech_list['heating_non_const'],
enduses=['rs_space_heating', 'rs_water_heating'],
shape_y_dh=tech_lp['rs_profile_hp_y_dh'],
shape_y_dh=rs_profile_hp_y_dh, #tech_lp['rs_profile_hp_y_dh'],
shape_yd=rs_hp_shape_yd,
shape_yh=rs_fuel_shape_hp_yh,
sectors=[dummy_sector],
Expand Down
60 changes: 30 additions & 30 deletions energy_demand/plotting/result_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,19 +866,19 @@ def spatial_maps(
unique_merge_id = 'name' #'geo_code'

fueltype_str_to_create_maps = [
tech_related.get_fueltype_str(fueltypes, 'electricity'),
tech_related.get_fueltype_str(fueltypes, 'gas')]
'electricity'] #,
#'gas']

# ======================================
# Peak max h all enduses (abs)
# ======================================
if plot_crit_dict['plot_abs_peak_h']:
for year in results_container['ed_fueltype_regs_yh'].keys():
for fueltype in range(fueltypes_nr):
#for fueltype_str in fueltype_str_to_create_maps:
#for fueltype in range(fueltypes_nr):
for fueltype_str in fueltype_str_to_create_maps:

fueltype_str = tech_related.get_fueltype_str(fueltypes, fueltype)
#fueltype = tech_related.get_fueltype_int(fueltype_str)
#fueltype_str = tech_related.get_fueltype_str(fueltypes, fueltype)
fueltype = tech_related.get_fueltype_int(fueltype_str)

# Calculate peak h across all regions
field_name = 'peak_abs_h_{}_{}'.format(year, fueltype_str)
Expand Down Expand Up @@ -931,11 +931,11 @@ def spatial_maps(
if year == base_yr:
pass
else:
for fueltype in range(fueltypes_nr):
#for fueltype_str in fueltype_str_to_create_maps:
#for fueltype in range(fueltypes_nr):
for fueltype_str in fueltype_str_to_create_maps:

fueltype_str = tech_related.get_fueltype_str(fueltypes, fueltype)
#fueltype = tech_related.get_fueltype_int(fueltype_str)
#fueltype_str = tech_related.get_fueltype_str(fueltypes, fueltype)
fueltype = tech_related.get_fueltype_int(fueltype_str)

# If total sum is zero, skip
if np.sum(results_container['ed_fueltype_regs_yh'][base_yr][fueltype]) == 0:
Expand Down Expand Up @@ -972,10 +972,12 @@ def spatial_maps(
merge_data,
unique_merge_id)

bins_increments = 50 #10
'''bins_increments = 25 #10 KAMEL
bins = get_reasonable_bin_values(
data_to_plot=list(data_to_plot.values()),
increments=bins_increments)
increments=bins_increments)'''
#bins = [10, 20, 40, 80, 160, 320, 640]
bins = [-160, -320, -640, -80, -40, -20, -10 ,0, 10, 20, 40, 80, 160, 320, 640]

color_list, color_prop, user_classification, color_zero = colors_plus_minus_map(
bins=bins,
Expand All @@ -1002,10 +1004,10 @@ def spatial_maps(
# ======================================
if plot_crit_dict['plot_load_factors']:
for year in results_container['reg_load_factor_y'].keys():
for fueltype in range(fueltypes_nr):
#for fueltype_str in fueltype_str_to_create_maps:
fueltype_str = tech_related.get_fueltype_str(fueltypes, fueltype)
#fueltype = tech_related.get_fueltype_int(fueltype_str)
#for fueltype in range(fueltypes_nr):
for fueltype_str in fueltype_str_to_create_maps:
#fueltype_str = tech_related.get_fueltype_str(fueltypes, fueltype)
fueltype = tech_related.get_fueltype_int(fueltype_str)

field_name = 'lf_{}_{}'.format(year, fueltype_str)

Expand Down Expand Up @@ -1056,10 +1058,10 @@ def spatial_maps(
final_yr = simulated_yrs[-1]
base_yr = simulated_yrs[0]

for fueltype in range(fueltypes_nr):
#for fueltype_str in fueltype_str_to_create_maps:
#fueltype = tech_related.get_fueltype_int(fueltype_str)
fueltype_str = tech_related.get_fueltype_str(fueltypes, fueltype)
#for fueltype in range(fueltypes_nr):
for fueltype_str in fueltype_str_to_create_maps:
fueltype = tech_related.get_fueltype_int(fueltype_str)
#fueltype_str = tech_related.get_fueltype_str(fueltypes, fueltype)

field_name = 'lf_diff_{}-{}_{}'.format(base_yr, final_yr, fueltype_str)

Expand Down Expand Up @@ -1151,10 +1153,10 @@ def spatial_maps(
# Total fuel (y) all enduses
# ======================================
for year in results_container['ed_fueltype_regs_yh'].keys():
for fueltype in range(fueltypes_nr):
#for fueltype_str in fueltype_str_to_create_maps:
#fueltype = tech_related.get_fueltype_int(fueltype_str)
fueltype_str = tech_related.get_fueltype_str(fueltypes, fueltype)
#for fueltype in range(fueltypes_nr):
for fueltype_str in fueltype_str_to_create_maps:
fueltype = tech_related.get_fueltype_int(fueltype_str)
#fueltype_str = tech_related.get_fueltype_str(fueltypes, fueltype)

if plot_crit_dict['plot_total_demand_fueltype']:

Expand Down Expand Up @@ -1237,14 +1239,12 @@ def spatial_maps(
# ----
# CAlculate classes for manual classification
# ----
#logging.info("Min {} Max {}".format(
# min(list(data_to_plot.values())),
# max(list(data_to_plot.values()))))
bins_increments = 10 #MAYBE NEEDS TO BE ADOPTED #TODO KAMEL

'''bins_increments = 25 #MAYBE NEEDS TO BE ADOPTED #TODO KAMEL
bins = get_reasonable_bin_values(
data_to_plot=list(data_to_plot.values()),
increments=bins_increments)
increments=bins_increments)'''
#bins = [10, 20, 40, 80, 160, 320, 640]
bins = [-160, -320, -640, -80, -40, -20, -10 ,0, 10, 20, 40, 80, 160, 320, 640]

color_list, color_prop, user_classification, color_zero = colors_plus_minus_map(
bins=bins,
Expand Down
3 changes: 2 additions & 1 deletion energy_demand/result_processing/multiple_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def process_result_multi_scen(
#path_to_folder_with_scenarios="C:/Users/cenv0553/ed/results/_multiple_TEST",
path_to_folder_with_scenarios="C:/Users/cenv0553/ed/results/Fig_11",
#path_to_folder_with_scenarios="C:/Users/cenv0553/ed/results/scen_A",
#path_to_folder_with_scenarios="C:/Users/cenv0553/ed/results/scenario_A", #scenario a charts
#path_shapefile_input="C:/Users/cenv0553/ED/data/region_definitions/msoa_uk/msoa_lad_2015_uk.shp",
path_shapefile_input="C:/Users/cenv0553/ED/data/region_definitions/lad_2016_uk_simplified.shp",
base_yr=2015,
Expand Down Expand Up @@ -56,6 +56,7 @@ def process_result_multi_scen(
'_results_PDF_figs']

for scenario in scenarios:
print("... scenario: " + str(scenario))
if scenario in scenario_names_ignored:
pass
else:
Expand Down
6 changes: 3 additions & 3 deletions energy_demand/result_processing/scenario_charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ def process_scenarios(path_to_scenarios, year_to_model=2015):
# Generate plots across all scenarios

#process_scenarios(os.path.abspath("C:/Users/cenv0553/ed/results/scen_A"))
process_scenarios(os.path.abspath("C:/Users/cenv0553/ed/results/scen_B"))
#process_scenarios(os.path.abspath("C:/Users/cenv0553/ed/results/scen_B"))
#process_scenarios(os.path.abspath("C:/Users/cenv0553/ed/results/scen_C"))
#process_scenarios(os.path.abspath("C:/Users/cenv0553/ed/results/scen_D"))

process_scenarios(os.path.abspath("C:/Users/cenv0553/ed/results/Fig_11"))

#process_scenarios(os.path.abspath("C:/Users/cenv0553/ed/results/Fig_11"))
process_scenarios(os.path.abspath("C:/Users/cenv0553/ed/results/scen_C_Fig12"))

##process_scenarios(os.path.abspath("C:/Users/cenv0553/ed/results/Fig_08_09"))
#process_scenarios(os.path.abspath("C:/Users/cenv0553/ed/results/Fig_13")) # Color scheme Fig 13
Expand Down
4 changes: 2 additions & 2 deletions energy_demand/technologies/tech_related.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ def get_fueltype_int(fueltype_str):
fueltype_in_string : str
Fueltype string
"""
fueltype_lu = lookup_tables.basic_lookups()['fueltypes']

lookups = lookup_tables.basic_lookups()
fueltype_lu = lookups['fueltypes']
if not fueltype_str:
return None
else:
Expand Down
3 changes: 2 additions & 1 deletion tests/assumptions/test_assumptions_fuel_share.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pkg_resources import resource_filename
from pkg_resources import Requirement

def test_assign_by_fuel_tech_p():
'''def test_assign_by_fuel_tech_p():
"""
"""
path_main = resource_filename(
Expand Down Expand Up @@ -46,3 +46,4 @@ def test_assign_by_fuel_tech_p():
data['sectors'],
data['lookups']['fueltypes'],
data['lookups']['fueltypes_nr'])
'''

0 comments on commit e7de72e

Please sign in to comment.