Solar and wind capacity factors by year, region and cluster
Usage
get_ideea_cf(
resource = "sol",
nreg = 5,
year = 2019,
tol = 0.05,
data = "merra2",
data_file = "merra_raw_{year}.fst",
clusters_file = "locid_{resource}_cl_r{nreg}.RData",
tsl_format = "d365_h24",
load_from_extra = TRUE,
save_to_extra = TRUE,
overwrite = FALSE
)
Arguments
- resource
character, name of the resource: "sol" or "win"
- nreg
integer, the number of regions
- year
integer, the year of the data to return
- tol
numeric, the tolerance of the information loss in the clustering from 0 to 1. If 0 the number of clusters is equal to the number of locations in MERRA2 database. When tol is 1, there is only one cluster per region.
- data
character, the name of the data source, the directory in the
ideea_extra
directory. Currently only "merra2" is supported.- data_file
character, the name of the file with the raw data in the
data
sub-directory inideea_extra
. Default is "merra_raw_year.fst", valid for MERRA2 data.- clusters_file
character, the name of the file with the clusters in the
data
directory. Default is "locid_resource_cl_rnreg.RData", available inideea_data
.- tsl_format
character, the format of the time-slices. Default is "d365_h24". If changed, the clustering will be done based on the new time-slices.
- load_from_extra
logical, if TRUE, the function will try to read the capacity factors from the file in the
data
sub-directory inideea_extra
. If the file with requested parameters exists, it will be read. If the file doesn't exist, the function will calculate the capacity factors. Default is TRUE.- save_to_extra
logical, if TRUE, the function will save the estimated capacity factors to the file in the
data
sub-directory inideea_extra
. Default is TRUE.- overwrite
logical, if TRUE, the function will overwrite the existing file with the capacity factors. Default is FALSE.
Value
data.table, the capacity factors for the requested year by region, cluster, and time-slice. The data.table contains the following columns:
locid
- the location ID from the MERRA2 database,year
- the year of the data,slice
- the time-slice,cluster
- the cluster ID,reg{nreg}
andreg{nreg}_off
- the region ID and the offshore region ID,wcf_*
orscf_*
- the capacity factor for the wind or solar resource at the given height or tracking type.
Examples
# don't run
# default tolerance level (0.05)
get_ideea_cf(resource = "sol", nreg = 5, year = 2019)
#> Reading capacity factors data from:
#> D:/Dropbox/projects/ideea_extra//merra2/cf_sol_r5_TOL05_d365_h24_2019.fst
#> Maximum number of clusters per region: 3
#> year slice reg5 reg5_off cluster scf_fh scf_fl scf_tl scf_td
#> <num> <char> <char> <char> <int> <num> <num> <num> <num>
#> 1: 2019 d001_h00 EAST EAST 1 0 0 0 0
#> 2: 2019 d001_h00 EAST EAST_off 1 0 0 0 0
#> 3: 2019 d001_h00 EAST EAST_off 2 0 0 0 0
#> 4: 2019 d001_h00 NORTH NORTH 1 0 0 0 0
#> 5: 2019 d001_h00 NORTH NORTH 2 0 0 0 0
#> ---
#> 105116: 2019 d365_h23 SOUTH SOUTH 1 0 0 0 0
#> 105117: 2019 d365_h23 SOUTH SOUTH_off 1 0 0 0 0
#> 105118: 2019 d365_h23 SOUTH SOUTH_off 2 0 0 0 0
#> 105119: 2019 d365_h23 WEST WEST 1 0 0 0 0
#> 105120: 2019 d365_h23 WEST WEST_off 1 0 0 0 0
get_ideea_cf(resource = "sol", nreg = 32, year = 2019)
#> Reading capacity factors data from:
#> D:/Dropbox/projects/ideea_extra//merra2/cf_sol_r32_TOL05_d365_h24_2019.fst
#> Maximum number of clusters per region: 2
#> year slice reg32 reg32_off cluster scf_fh scf_fl scf_tl scf_td
#> <num> <char> <char> <char> <int> <num> <num> <num> <num>
#> 1: 2019 d001_h00 AN AN 1 0 0 0 0
#> 2: 2019 d001_h00 AN AN_off 1 0 0 0 0
#> 3: 2019 d001_h00 APY APY 1 0 0 0 0
#> 4: 2019 d001_h00 APY APY_off 1 0 0 0 0
#> 5: 2019 d001_h00 AR AR 1 0 0 0 0
#> ---
#> 385436: 2019 d365_h23 TR TR 1 0 0 0 0
#> 385437: 2019 d365_h23 UP UP 1 0 0 0 0
#> 385438: 2019 d365_h23 UT UT 1 0 0 0 0
#> 385439: 2019 d365_h23 WB WB 1 0 0 0 0
#> 385440: 2019 d365_h23 WB WB_off 1 0 0 0 0
get_ideea_cf(resource = "win", nreg = 5, year = 2019)
#> Reading capacity factors data from:
#> D:/Dropbox/projects/ideea_extra//merra2/cf_win_r5_TOL05_d365_h24_2019.fst
#> Maximum number of clusters per region: 40
#> year slice reg5 reg5_off cluster wcf_50m wcf_100m wcf_150m
#> <num> <char> <char> <char> <int> <num> <num> <num>
#> 1: 2019 d001_h00 EAST EAST 1 0.057 0.068 0.074
#> 2: 2019 d001_h00 EAST EAST 2 0.006 0.017 0.026
#> 3: 2019 d001_h00 EAST EAST 3 0.001 0.003 0.006
#> 4: 2019 d001_h00 EAST EAST 4 0.063 0.115 0.159
#> 5: 2019 d001_h00 EAST EAST 5 0.073 0.207 0.346
#> ---
#> 981116: 2019 d365_h23 WEST WEST_off 2 0.107 0.120 0.128
#> 981117: 2019 d365_h23 WEST WEST_off 3 0.034 0.040 0.043
#> 981118: 2019 d365_h23 WEST WEST_off 4 0.163 0.187 0.203
#> 981119: 2019 d365_h23 WEST WEST_off 5 0.154 0.223 0.272
#> 981120: 2019 d365_h23 WEST WEST_off 6 0.230 0.282 0.317
get_ideea_cf(resource = "win", nreg = 32, year = 2019)
#> Reading capacity factors data from:
#> D:/Dropbox/projects/ideea_extra//merra2/cf_win_r32_TOL05_d365_h24_2019.fst
#> Maximum number of clusters per region: 12
#> year slice reg32 reg32_off cluster wcf_50m wcf_100m wcf_150m
#> <num> <char> <char> <char> <int> <num> <num> <num>
#> 1: 2019 d001_h00 AN AN 1 0.051 0.058 0.062
#> 2: 2019 d001_h00 AN AN 2 0.058 0.070 0.077
#> 3: 2019 d001_h00 AN AN_off 1 0.045 0.052 0.056
#> 4: 2019 d001_h00 AN AN_off 2 0.075 0.085 0.091
#> 5: 2019 d001_h00 AN AN_off 3 0.050 0.056 0.061
#> ---
#> 1086236: 2019 d365_h23 TNY TNY_off 7 0.241 0.280 0.305
#> 1086237: 2019 d365_h23 UP UP 1 0.037 0.096 0.155
#> 1086238: 2019 d365_h23 UP UP 2 0.000 0.000 0.000
#> 1086239: 2019 d365_h23 WB WB 1 0.017 0.040 0.057
#> 1086240: 2019 d365_h23 WB WB_off 1 0.013 0.016 0.018
# custom tolerance level (0.01)
get_ideea_cf(resource = "sol", nreg = 5, tol = 0.01, year = 2019)
#> Reading capacity factors data from:
#> D:/Dropbox/projects/ideea_extra//merra2/cf_sol_r5_TOL01_d365_h24_2019.fst
#> Maximum number of clusters per region: 50
#> year slice reg5 reg5_off cluster scf_fh scf_fl scf_tl scf_td
#> <num> <char> <char> <char> <int> <num> <num> <num> <num>
#> 1: 2019 d001_h00 EAST EAST 1 0 0 0 0
#> 2: 2019 d001_h00 EAST EAST 2 0 0 0 0
#> 3: 2019 d001_h00 EAST EAST 3 0 0 0 0
#> 4: 2019 d001_h00 EAST EAST 4 0 0 0 0
#> 5: 2019 d001_h00 EAST EAST 5 0 0 0 0
#> ---
#> 1839596: 2019 d365_h23 WEST WEST_off 7 0 0 0 0
#> 1839597: 2019 d365_h23 WEST WEST_off 8 0 0 0 0
#> 1839598: 2019 d365_h23 WEST WEST_off 9 0 0 0 0
#> 1839599: 2019 d365_h23 WEST WEST_off 10 0 0 0 0
#> 1839600: 2019 d365_h23 WEST WEST_off 11 0 0 0 0
get_ideea_cf(resource = "sol", nreg = 32, tol = 0.01, year = 2019)
#> Reading capacity factors data from:
#> D:/Dropbox/projects/ideea_extra//merra2/cf_sol_r32_TOL01_d365_h24_2019.fst
#> Maximum number of clusters per region: 18
#> year slice reg32 reg32_off cluster scf_fh scf_fl scf_tl scf_td
#> <num> <char> <char> <char> <int> <num> <num> <num> <num>
#> 1: 2019 d001_h00 AN AN 1 0 0 0 0
#> 2: 2019 d001_h00 AN AN 2 0 0 0 0
#> 3: 2019 d001_h00 AN AN 3 0 0 0 0
#> 4: 2019 d001_h00 AN AN_off 1 0 0 0 0
#> 5: 2019 d001_h00 AN AN_off 2 0 0 0 0
#> ---
#> 2154956: 2019 d365_h23 WB WB 2 0 0 0 0
#> 2154957: 2019 d365_h23 WB WB 3 0 0 0 0
#> 2154958: 2019 d365_h23 WB WB 4 0 0 0 0
#> 2154959: 2019 d365_h23 WB WB 5 0 0 0 0
#> 2154960: 2019 d365_h23 WB WB_off 1 0 0 0 0
get_ideea_cf(resource = "win", nreg = 5, tol = 0.01, year = 2019)
#> Reading capacity factors data from:
#> D:/Dropbox/projects/ideea_extra//merra2/cf_win_r5_TOL01_d365_h24_2019.fst
#> Maximum number of clusters per region: 150
#> year slice reg5 reg5_off cluster wcf_50m wcf_100m wcf_150m
#> <num> <char> <char> <char> <int> <num> <num> <num>
#> 1: 2019 d001_h00 EAST EAST 1 0.051 0.058 0.062
#> 2: 2019 d001_h00 EAST EAST 2 0.070 0.084 0.093
#> 3: 2019 d001_h00 EAST EAST 3 0.005 0.007 0.008
#> 4: 2019 d001_h00 EAST EAST 4 0.001 0.004 0.005
#> 5: 2019 d001_h00 EAST EAST 5 0.003 0.014 0.030
#> ---
#> 5352356: 2019 d365_h23 WEST WEST_off 71 0.337 0.381 0.411
#> 5352357: 2019 d365_h23 WEST WEST_off 72 0.349 0.429 0.479
#> 5352358: 2019 d365_h23 WEST WEST_off 73 0.362 0.683 0.874
#> 5352359: 2019 d365_h23 WEST WEST_off 74 0.456 0.846 0.975
#> 5352360: 2019 d365_h23 WEST WEST_off 75 0.440 0.880 0.989
get_ideea_cf(resource = "win", nreg = 32, tol = 0.01, year = 2019)
#> Reading capacity factors data from:
#> D:/Dropbox/projects/ideea_extra//merra2/cf_win_r32_TOL01_d365_h24_2019.fst
#> Maximum number of clusters per region: 75
#> year slice reg32 reg32_off cluster wcf_50m wcf_100m wcf_150m
#> <num> <char> <char> <char> <int> <num> <num> <num>
#> 1: 2019 d001_h00 AN AN 1 0.051 0.058 0.062
#> 2: 2019 d001_h00 AN AN 2 0.070 0.084 0.093
#> 3: 2019 d001_h00 AN AN 3 0.005 0.007 0.008
#> 4: 2019 d001_h00 AN AN_off 1 0.019 0.022 0.023
#> 5: 2019 d001_h00 AN AN_off 2 0.022 0.027 0.030
#> ---
#> 5562596: 2019 d365_h23 WB WB_off 3 0.010 0.010 0.010
#> 5562597: 2019 d365_h23 WB WB_off 4 0.012 0.015 0.018
#> 5562598: 2019 d365_h23 WB WB_off 5 0.016 0.022 0.025
#> 5562599: 2019 d365_h23 WB WB_off 6 0.009 0.013 0.015
#> 5562600: 2019 d365_h23 WB WB_off 7 0.022 0.051 0.071