rte-antares-rpackage / antaresViz

ANTARES Visualizations

Home Page:https://rte-antares-rpackage.github.io/antaresViz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

plotMap, prodStack, echangesStack and tsPlot : compare several studies relatively

jalazawa opened this issue · comments

  • code R

  • in app

  • in app H5

plotmapcompare

library(antaresViz)
library(data.table)

studyPath<-"E:\\ANTARES\\Exemple_antares\\2_exemple_etudes_importantes\\TYNDP\\ST2030\\ST2030"
opts1<-setSimulationPath(studyPath,-1)
mydata1<-readAntares(areas = "all", links = "all", select=c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE)

opts2<-setSimulationPath(studyPath,-2)
mydata2<-readAntares(areas = "all", links = "all", select=c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE)

opts3<-setSimulationPath(studyPath,-3)
mydata3<-readAntares(areas = "all", links = "all", select=c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE)

opts4<-setSimulationPath(studyPath,1)
mydata4<-readAntares(areas = "all", links = "all", select=c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE)

opts5<-setSimulationPath(studyPath,2)
mydata5<-readAntares(areas = "all", links = "all", select=c("allAreas", "allLinks"), mcYears = c(1), linkCapacity = TRUE)


resCompare1 <- compare(mydata2, mydata1, method = "diff")
resCompare2 <- compare(mydata3, mydata1, method = "diff")
resCompare3 <- compare(mydata4, mydata1, method = "diff")
resCompare4 <- compare(mydata5, mydata1, method = "diff")

listCompare <- list(resCompare1, resCompare2, resCompare3, resCompare4)

for( i in 1:length(listCompare)){
  print(class(listCompare[[i]]))
  listCompare[[i]] <- removeVirtualAreas(listCompare[[i]], 
                                        storageFlexibility = getAreas(select = c("z_dsr", "y_mul", "pum", "tur" )))
}

ml <- readRDS("...\\mapLayoutTyndp.RDS")
plotMap(listCompare, ml)