energy_demand.geography package¶
Submodules¶
energy_demand.geography.region module¶
Region Class
energy_demand.geography.spatial_diffusion module¶
This file contains all calculations related to spatial explicit calculations of technology/innovation penetration.
-
energy_demand.geography.spatial_diffusion.
calc_diffusion_f
(regions, f_reg, spatial_diff_values, fuels)[source]¶ From spatial diffusion values calculate diffusion factor for every region (which needs to sum up to one across all regions) and end use. With help of these calculation diffusion factors, a spatial explicit diffusion of innovations can be implemented.
- Parameters
Example
If the national assumption of a technology diffusion of 50% is defined (e.g. 50% of service are heat pumps), this percentage can be changed per region, i.e. in some regions with higher diffusion factors, a larger percentage adopt the technology on the expense of other regions, where a lower percentage adopt this technology. In sum however, for all regions, the total service still sums up to 50%.
Note
The total sum can be higher than 1 in case of high values. Therefore the factors need to be capped. TODO MORE INFO
-
energy_demand.geography.spatial_diffusion.
calc_regional_services
(enduse, uk_techs_service_p, regions, spatial_factors, fuel_disaggregated, techs_affected_spatial_f, capping_val=1)[source]¶ Calculate regional specific end year service shares of technologies (rs_reg_enduse_tech_p_ey)
- Parameters
uk_techs_service_p (dict) – Service shares per technology for future year
regions (dict) – Regions
spatial_factors (dict) – Spatial factor per enduse and region
fuel_disaggregated (dict) – Fuels per region
techs_affected_spatial_f (list) – List with technologies where spatial diffusion is affected
capping_val (float) – Maximum service share (1.0). This is needed in case of spatial explicit diffusion modelling where the diffusion speed is very large and thus would lead to areas with largher shares than 1
- Returns
rs_reg_enduse_tech_p_ey (dict) – Regional specific model end year service shares of techs
Modelling steps
—–
A.) Calculation national end use service to reduce – (e.g. 50% heat pumps for all regions) (uk_tech_service_ey_p)
B.) Distribute this service according to spatial index for – techs where the spatial explicit diffusion applies (techs_affected_spatial_f). Otherwise disaggregated according to fuel
C.) Convert regional service reduction to ey % in region
-
energy_demand.geography.spatial_diffusion.
calc_spatially_diffusion_factors
(regions, fuel_disagg, real_values, low_congruence_crit, speed_con_max, p_outlier)[source]¶ Calculate spatial diffusion values
- Parameters
- Returns
f_reg_norm_abs (dict) – Diffusion values with normed population. If no value is larger than 1, the total sum of all shares calculated for every region is identical to the defined scenario variable.
spatial_diff_values (dict) – Spatial diffusion values (not normed, only considering differences in speed and congruence values)
Explanation
============
(I) Load diffusion values
(II) Calculate diffusion factors
(III) Calculate sigmoid diffusion values for technology – specific enduse service shares for every region
-
energy_demand.geography.spatial_diffusion.
factor_improvements_single
(factor_uk, regions, f_reg, f_reg_norm, f_reg_norm_abs, fuel_regs_enduse)[source]¶ Calculate regional specific end year service shares of technologies (rs_reg_enduse_tech_p_ey)
- Parameters
factor_uk (float) – Improvement of either an enduse or a variable for the whole UK
regions (dict) – Regions
f_reg (dict) – Regional spatial factors not normed with fuel demand
f_reg_norm (dict) – Regional spatial factors normed with fuel demand (sum is not 1)
f_reg_norm_abs (dict) – Regional spatial factors normed with fuel demand and normed that sum is 1
spatial_diff_values (dict) – Spatial diffusion values
fuel_regs_enduse (dict) – Fuels per region and end use
- Returns
rs_reg_enduse_tech_p_ey (dict) – Regional specific model end year service shares of techs
Modelling steps
—–
A.) Calculation national end use service to reduce – (e.g. 50% heat pumps for all regions) (uk_tech_service_ey_p)
B.) Distribute this service according to spatial index for – techs where the spatial explicit diffusion applies (techs_affected_spatial_f). Otherwise disaggregated according to fuel
C.) Convert regional service reduction to ey % in region
-
energy_demand.geography.spatial_diffusion.
get_enduse_regs
(enduse, fuels_disagg)[source]¶ Get a specific enduse for all regions
-
energy_demand.geography.spatial_diffusion.
spatial_diffusion_values
(regions, real_values, speed_con_max, low_congruence_crit, p_outlier)[source]¶ Generate spatial diffusion values from real data
- Parameters
- Returns
diffusion_values – Spatial diffusion values based on speed assumptions
- Return type
Example
This function calculates the values which already incorporate different speeds in diffusion.
For example based on real values (e.g. population density) congruence values are calculated. Then, the congruence values are linked to diffusion speed differentes.
energy_demand.geography.weather_region module¶
energy_demand.geography.weather_station_location module¶
Weather Station location
-
energy_demand.geography.weather_station_location.
calc_distance_two_points
(lat_from, long_from, lat_to, long_to)[source]¶ Calculate distance between two points
energy_demand.geography.write_shp module¶
Append result to shapefile