R/h5utils.R

Defines functions .getTimeStep isH5Opts

Documented in isH5Opts

#Copyright © 2016 RTE Réseau de transport d’électricité

#' Test if opts is h5
#'
#' @description Test if the value returned by setSimulationPath() is referring to an h5 file
#' 
#' @param opts , opts
#' @export
isH5Opts <- function(opts){
  v <- FALSE
  if(!is.null(opts$h5)){
    if(opts$h5){
      v <- TRUE
    }
  }
  v
}


.getTimeStep <- function(fid){
  .requireRhdf5_Antares()
  timeSteps <- sapply(c("hourly", "daily", "weekly", "monthly", "annual"), function(X){
    rhdf5::H5Lexists(fid, X)
  })
  names(timeSteps[which(timeSteps == TRUE)])
}

Try the antaresRead package in your browser

Any scripts or data that you put into this service are public.

antaresRead documentation built on Aug. 31, 2023, 1:09 a.m.