potential.py¶
-
lib.potential.
calc_FLH_solar
(hours, args)¶ This function computes the full-load hours for all valid pixels specified in ind_nz in param. Due to parallel processing, most of the inputs are collected in the list args.
- Parameters
hours (numpy array) – Filtered day hour ranks in a year (from 0 to 8759).
args (list) – List of arguments: * param (dict): Dictionary including multiple parameters such as the status bar limit, the name of the region, and others for calculating the hourly capacity factors. * tech (str): Name of the technology. * rasterData (dict): Dictionary of numpy arrays containing land use types, Ross coefficients, albedo coefficients, and wind speed correction for every point in reg_ind. * merraData (dict): Dictionary of numpy arrays containing the weather data for every point in reg_ind.
- Return FLH
Full-load hours over the year for the technology.
- Return type
numpy array
-
lib.potential.
calc_FLH_windoff
(hours, args)¶ This function computes the full-load hours for all valid pixels specified in ind_nz in param. Due to parallel processing, most of the inputs are collected in the list args.
- Parameters
hours (numpy array) – Hour ranks in a year (from 0 to 8759).
args (list) – List of arguments: * param (dict): Dictionary including multiple parameters such as the status bar limit, the name of the region, and others for calculating the hourly capacity factors. * tech (str): Name of the technology. * rasterData (dict): Dictionary of numpy arrays containing land use types, Ross coefficients, albedo coefficients, and wind speed correction for every point in reg_ind. * merraData (dict): Dictionary of numpy arrays containing the weather data for every point in reg_ind.
- Return FLH
Full-load hours over the year for the technology.
- Return type
numpy array
-
lib.potential.
calc_FLH_windon
(param, tech, rasterData, merraData, GWA_array, b_xmin, b_xmax, b_ymin, b_ymax, x_gwa, y_gwa, pixles, list_results)¶ This function computes the full-load hours for all valid pixels specified in ind_nz in param. Due to parallel processing, most of the inputs are collected in the list args.
- Parameters
hours (numpy array) – Hour ranks in a year (from 0 to 8759).
args (list) – List of arguments: * param (dict): Dictionary including multiple parameters such as the status bar limit, the name of the region, and others for calculating the hourly capacity factors. * tech (str): Name of the technology. * rasterData (dict): Dictionary of numpy arrays containing land use types, Ross coefficients, albedo coefficients, and wind speed correction for every point in reg_ind. * merraData (dict): Dictionary of numpy arrays containing the weather data for every point in reg_ind.
- Return FLH
Full-load hours over the year for the technology.
- Return type
numpy array
-
lib.potential.
calc_gcr
(Crd_all, m_high, n_high, res_desired, GCR)¶ This function creates a GCR weighting matrix for the desired geographic extent. The sizing of the PV system is conducted on a user-defined day for a shade-free exposure to the sun during a given number of hours.
- Parameters
Crd_all (list) – Desired geographic extent of the whole region (north, east, south, west).
m_high (int) – Number of rows.
n_high (int) – Number of columns.
res_desired (list) – Resolution of the high resolution map.
GCR (dict) – Dictionary that includes the user-defined day and the duration of the shade-free period.
- Return A_GCR
GCR weighting raster.
- Return type
numpy array
-
lib.potential.
calculate_full_load_hours
(paths, param, tech, multiprocessing)¶ This function calculates the yearly FLH for a technology for all valid pixels in a spatial scope. Valid pixels are land pixels for WindOn, PV and CSP, and sea pixels for WindOff. The FLH values are calculated by summing up hourly capacity factors.
- Parameters
paths (dict) – Dictionary of dictionaries containing the paths to the input weather data, land, sea and land use rasters, and correction rasters.
param (dict) – Dictionary of dictionaries containing the spatial scope, and technology and computation parameters.
tech (str) – Technology under study.
multiprocessing (bool) – Determines if the computation uses multiprocessing (True/False)
- Returns
The raster of FLH potential is saved as mat and tif files, along with the json metadata file.
- Return type
None
-
lib.potential.
get_merra_raster_data
(paths, param, tech)¶ This function returns a tuple of two dictionaries containing weather and correction rasters for specified technology.
- Parameters
paths (dict) – Dictionary of dictionaries containing the paths to the input weather and raster data.
param (dict) – Dictionary of dictionaries containing land use, Ross coefficients, albedo, and Hellmann coefficients.
tech (str) – Technology under study.
- Return (merraData, rasterData)
Dictionaries for the weather data and for the correction data.
- Return type
tuple (dict, dict)
-
lib.potential.
mask_potential_maps
(paths, param, tech)¶ This function first reads the rasters for land use, slope, bathymetry, and protected areas for the scope. Based on user-defined assumptions on their suitabilities, it generates a masking raster to exclude the unsuitable pixels. Both the mask itself and the masked potential rasters can be saved.
- Parameters
paths (dict) – Dictionary of dictionaries containing user-defined parameters for masking, protected areas, and landuse.
param (dict) – Dictionary of dictionaries containing the paths to the land use, protected areas, slope and bathymetry, in addition to output paths.
tech (str) – Technology under study.
- Returns
The files for the mask and the masked FLH are saved as tif and mat files, along with their metadata json files.
- Return type
None
-
lib.potential.
redistribution_array
(param, merraData, i, j, xmin, xmax, ymin, ymax, GWA_array, x_gwa, y_gwa)¶ What does this function do?
- Parameters
param –
merraData –
i –
j –
xmin –
xmax –
ymin –
ymax –
GWA_array –
x_gwa –
y_gwa –
- Return reMerra
- Return type
numpy array
- Aim:
Increase the resolution of the MERRA wind data by using Global Wind Atlas data. For this reason, the low resolution MERRA data is redistributed by the energy distribution of the higher resolution Global Wind Atlas data
- Algorithm:
Import wind data from Global Wind Atlas
Select pixels that are within one MERRA pixle
Convert from wind speed to energy
Redistribute MERRA data
ToDo: Where do the borders/limits come from? -> not shape file ?!?
-
lib.potential.
report_potentials
(paths, param, tech)¶ This function reads the FLH files and the subregion shapefile, and creates a CSV file containing various statistics:
Available number of pixels, before and after masking
Available area in in km²
FLH mean, median, max, min values, before and after masking
FLH standard deviation after masking
Power Potential in GW, before and after weighting
Energy Potential in TWh in total, after weighting, and after masking and weighting
Sorted sample of FLH values for each region
- Parameters
paths (dict) – Dictionary of dictionaries containing the paths to FLH, Masking, Weighting, and Area rasters.
param (dict) – Dictionary of dictionaries containing technology parameters and sampling parameters.
tech (str) – Technology under study.
- Returns
The CSV files with the report and the sorted FLH are saved directly in the desired paths, along with the corresponding metadata in JSON files.
- Return type
None
-
lib.potential.
sampled_sorting
(Raster, sampling)¶ This function returns a list with a defined length of sorted values sampled from a numpy array.
- Parameters
Raster (numpy array) – Input raster to be sorted.
sampling (int) – Number of values to be sampled from the raster, defines length of output list.
- Return s
List of sorted values sampled from Raster.
- Return type
list
-
lib.potential.
weight_potential_maps
(paths, param, tech)¶ This function weights the power potential by including assumptions on the power density and the available area. Therefore, it reads the rasters for land use and protected areas for the scope. Based on user-defined assumptions on their availabilities, it generates a weighting raster to exclude the unsuitable pixels. Both the weight itself and the weighted potential rasters can be saved.
- Parameters
paths (dict) – Dictionary of dictionaries containing user-defined parameters for weighting, protected areas, and landuse.
param (dict) – Dictionary of dictionaries containing the paths to the land use, protected areas, area, in addition to output paths.
tech (str) – Technology under study.
- Returns
The files for the weight and the weighted FLH are saved as tif and mat files, along with their metadata json files.
- Return type
None