Build renewable profiles
Adapted from pypsa-EUR by the pypsa China-PIK authors
Calculates for each clustered region the
(i) installable capacity (based on land-use from :mod:determine_availability_matrix)
(ii) the available generation time series (based on weather data)
(iii) the average distanc from the node for onshore wind,
AC-connected offshore wind, DC-connected offshore wind and solar PV generators.
Outputs
-
resources/profile_{technology}.ncwith the following structure=================== ==================== ===================================================== Field Dimensions Description =================== ==================== ===================================================== profile year, bus, bin, time the per unit hourly availability factors for each bus
p_nom_max bus, bin maximal installable capacity at the bus (in MW)
average_distance bus, bin average distance of units in the region to the grid bus for onshore techs and to the shoreline for offshore technologies (in km) =================== ==================== =====================================================
Description
This script functions at two main spatial resolutions: the resolution of the
clustered network regions, and the resolution of the cutout grid cells for the
weather data. Typically the weather data grid is finer than the network regions,
so we have to work out the distribution of generators across the grid cells
within each region. This is done by taking account of a combination of the
available land at each grid cell (computed in
:mod:determine_availability_matrix) and the capacity factor there.
Based on the availability matrix, the script first computes how much of the technology can be installed at each cutout grid cell. To compute the layout of generators in each clustered region, the installable potential in each grid cell is multiplied with the capacity factor at each grid cell. This is done since we assume more generators are installed at cells with a higher capacity factor.
Based on the average capacity factor, the potentials are further divided into a configurable number of resource classes (bins).
This layout is then used to compute the generation availability time series from
the weather data cutout from atlite.
The maximal installable potential for the node (p_nom_max) is computed by
adding up the installable potentials of the individual grid cells.
build_resource_classes(cutout, nbins, regions, capacity_factor, params)
Bin resources based on their capacity factor The number of bins can be dynamically reduced based on a min delta cf
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cutout
|
Cutout
|
the atlite cutout |
required |
nbins
|
int
|
the number of bins |
required |
regions
|
GeoSeries
|
the regions |
required |
capacity_factor
|
(DataArray,)
|
the capacity factor |
required |
params
|
dict
|
the config for VREs |
required |
Returns:
| Type | Description |
|---|---|
DataArray
|
xr.DataArray: the mask for the resource classes |
GeoSeries
|
gpd.GeoSeries: multi-indexed series [bus, bin]: geometry |
Source code in workflow/scripts/build_renewable_profiles.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
localize_cutout_time(cutout, drop_leap=True)
localize the time to the local timezone
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cutout
|
Cutout
|
the atlite cutout object |
required |
drop_leap
|
bool
|
drop 29th Feb. Defaults to True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
Cutout |
Cutout
|
the updated cutout |
Source code in workflow/scripts/build_renewable_profiles.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
prepare_resource_config(params, nprocesses, noprogress=True)
Parse the resource config (atlite calc config)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
dict
|
the renewable options |
required |
nprocesses
|
int
|
the number or processes |
required |
noprogress
|
bool
|
whether to show progress bars |
True
|
Returns:
| Type | Description |
|---|---|
(dict, dict)
|
the resource config for the atlite calcs, the turbine/panel models |
Source code in workflow/scripts/build_renewable_profiles.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |