readAntares | R Documentation |
readAntares
is a swiss-army-knife function used to read almost every
possible time series of an antares Project at any desired time resolution
(hourly, daily, weekly, monthly or annual).
It was first designed to read
output time series, but it can also read input time series. The input time
series are processed by the function to fit the query of the user (timeStep,
synthetic results or Monte-Carlo simulation, etc.). The few data that are not
read by readAntares
can generally by read with other functions of the
package starting with "read" (readClusterDesc
,
readLayout
, readBindingConstraints
)
readAntares(
areas = NULL,
links = NULL,
clusters = NULL,
districts = NULL,
clustersRes = NULL,
clustersST = NULL,
bindingConstraints = FALSE,
misc = FALSE,
thermalAvailabilities = FALSE,
hydroStorage = FALSE,
hydroStorageMaxPower = FALSE,
reserve = FALSE,
linkCapacity = FALSE,
mustRun = FALSE,
thermalModulation = FALSE,
select = NULL,
mcYears = NULL,
timeStep = c("hourly", "daily", "weekly", "monthly", "annual"),
mcWeights = NULL,
opts = simOptions(),
parallel = FALSE,
simplify = TRUE,
showProgress = TRUE
)
areas |
Vector containing the names of the areas to import. If
|
links |
Vector containing the name of links to import. If |
clusters |
Vector containing the name of the areas for which you want to
import results at thermal cluster level. If |
districts |
Vector containing the names of the districts to import. If |
clustersRes |
Vector containing the name of the areas for which you want to
import results at renewable cluster level. If |
clustersST |
Vector containing the name of the areas for which you want to
import results at short-term cluster level. If |
bindingConstraints |
Should binding constraints be imported (v8.4+)? |
misc |
Vector containing the name of the areas for which you want to import misc. |
thermalAvailabilities |
Should thermal availabilities of clusters be imported ? If TRUE, the column "thermalAvailability" is added to the result and a new column "availableUnits" containing the number of available units in a cluster is created.If synthesis is set to TRUE then "availableUnits" contain the mean of avaible units on all MC Years. |
hydroStorage |
Should hydro storage be imported ? |
hydroStorageMaxPower |
Should hydro storage maximum power be imported ? |
reserve |
Should reserve be imported ? |
linkCapacity |
Should link capacities be imported ? |
mustRun |
Should must run productions be added to the result? If TRUE,
then four columns are added: |
thermalModulation |
Should thermal modulation time series be imported ? If |
select |
Character vector containing the name of the columns to import. If this
argument is |
mcYears |
Index of the Monte-Carlo years to import. If |
timeStep |
Resolution of the data to import: hourly (default), daily, weekly, monthly or annual. |
mcWeights |
Vector of weights to apply to the specified mcYears. If not |
opts |
list of simulation parameters returned by the function
|
parallel |
Should the importation be parallelized ? (See details) |
simplify |
If TRUE and only one type of output is imported then a data.table is returned. If FALSE, the result will always be a list of class "antaresData". |
showProgress |
If TRUE the function displays information about the progress of the importation. |
If parameters areas
, links
, clusters
and districts
are all NULL
, readAntares
will read output for all areas.
By default the function reads synthetic results if they are available.
readAntares
is able to read input time series, but when they are not
stored in output, these time series may have changed since a simulation has
been run. In such a case the function will remind you this danger with a
warning.
When individual Monte-Carlo simulations are read, the function may crash because of insufficient memory. In such a case, it is necessary to reduce size of the output. Different strategies are available depending on your objective:
Use a larger time step (parameter timeStep
)
Filter the elements to import (parameters areas
,links
,
clusters
and districts
)
Select only a few columns (parameter select
)
read only a subset of Monte-Carlo simulations (parameter
mcYears
). For instance one can import a random sample of
100 simulations with mcYears = sample(simOptions()$mcYears, 100)
If simplify = TRUE
and only one type of output is imported
then the result is a data.table.
Else an object of class "antaresDataList" is returned. It is a list of data.tables, each element representing one type of element (areas, links, clusters)
If you import several elements of the same type (areas, links, clusters), you
can use parallelized importation to improve performance. Setting the
parameter parallel = TRUE
is not enough to parallelize the
importation, you also have to install the package
foreach
and a package that provides a parallel backend (for instance the package
doParallel).
Before running the function with argument parallel=TRUE
, you need to
register your parallel backend. For instance, if you use package "doParallel"
you need to use the function registerDoParallel
once per
session.
setSimulationPath
, getAreas
,
getLinks
, getDistricts
## Not run:
# Import areas and links separately
areas <- readAntares() # equivalent to readAntares(areas="all")
links <- readAntares(links="all")
# Import areas and links at same time
output <- readAntares(areas = "all", links = "all")
# Add input time series to the object returned by the function
areas <- readAntares(areas = "all", misc = TRUE, reserve = TRUE)
# Get all output for one area
myArea <- sample(simOptions()$areaList, 1)
myArea
myAreaOutput <- readAntares(area = myArea,
links = getLinks(myArea, regexpSelect=FALSE),
clusters = myArea)
# Or equivalently:
myAreaOutput <- readAntaresAreas(myArea)
# Use parameter "select" to read only some columns.
areas <- readAntares(select = c("LOAD", "OV. COST"))
# Aliases can be used to select frequent groups of columns. use showAliases()
# to view a list of available aliases
areas <- readAntares(select="economy")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.