Commit 32b4fd72 authored by Delaigue Olivier's avatar Delaigue Olivier Committed by Dorchies David
Browse files

v1.4.6.0 feat: new SeriesAggreg2.InputsModel function #41

parent 62b0d86b
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.4.5.0
Version: 1.4.6.0
Date: 2020-04-30
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -11,6 +11,7 @@ useDynLib(airGR, .registration = TRUE)
S3method("plot", "OutputsModel")
S3method("SeriesAggreg2", "data.frame")
S3method("SeriesAggreg2", "default")
S3method("SeriesAggreg2", "InputsModel")
......@@ -51,7 +52,7 @@ export(RunModel_Lag)
export(SeriesAggreg)
export(SeriesAggreg2)
#export(SeriesAggreg2.data.frame)
#export(SeriesAggreg2.InputsModel)
export(SeriesAggreg2.InputsModel)
#export(SeriesAggreg2.OutputsModel)
export(TransfoParam)
export(TransfoParam_CemaNeige)
......
......@@ -4,12 +4,13 @@
### 1.4.5.0 Release Notes (2020-04-30)
### 1.4.6.0 Release Notes (2020-04-30)
#### New features
- Added <code>SeriesAggreg2</code> method.
- Added <code>SeriesAggreg2.default()</code> function.
- Added <code>SeriesAggreg2.InputsModel()</code> function.
- Added <code>SeriesAggreg2.data.frame()</code> function. This new verson of the <code>SeriesAggreg()</code> function allows to compute regimes.
......
SeriesAggreg2.InputsModel <- function(TabSeries,
Format,
TimeFormat,
NewTimeFormat,
YearFirstMonth = 1, TimeLag = 0,
verbose = TRUE, ..., simplify = FALSE) {
if (!inherits(TabSeries, "InputsModel")) {
stop("to be used with 'InputsModel' object")
}
res <- SeriesAggreg2.default(TabSeries = TabSeries,
Format = Format,
TimeFormat = TimeFormat,
NewTimeFormat = NewTimeFormat,
YearFirstMonth = YearFirstMonth, TimeLag = TimeLag,
verbose = verbose,
simplify = simplify)
if (inherits(TabSeries, "CemaNeige")) {
res$ZLayers <- TabSeries$ZLayers
}
return(res)
# TabSeries <- as.data.frame.list(TabSeries)
#
# # NewTimeFormat <- c(hourly = "hourly",
# # daily = "daily",
# # monthly = "monthly",
# # yearly = "yearly")
# # Format <- switch(Format,
# # hourly = "%Y%m%d%h",
# # daily = "%Y%m%d",
# # monthly = "%Y%m",
# # yearly = "%Y")
# #
# # TimeFormat <- intersect(class(InputsModel), listTimeFormat)
# #
# # if (length(TimeFormat) == 0) {
# # stop("wrong time step")
# # }
# #
#
#
# NewTabSeries <- SeriesAggreg2(TabSeries = TabSeries,
# Format = Format,
# TimeFormat = TimeFormat, NewTimeFormat = NewTimeFormat,
# ConvertFun = c("sum", "sum"),
# YearFirstMonth = YearFirstMonth, TimeLag = TimeLag,
# verbose = verbose)
#
# ## to be consistent with InputsModel class
# NewTabSeries$DatesR <- as.POSIXlt(NewTabSeries$DatesR)
#
# ClassFormat <- class(NewTabSeries)[class(NewTabSeries) != "SeriesAggreg"]
#
# SuffixRunModel <- switch(ClassFormat,
# hourly = "4H",
# daily = "4J",
# monthly = "2M",
# yearly = "1A")
#
# RunModel <- paste0("RunModel_GR", SuffixRunModel)
#
# InputsModel <- CreateInputsModel(FUN_MOD = RunModel,
# DatesR = NewTabSeries$DatesR, Precip = NewTabSeries$Precip, PotEvap = NewTabSeries$PotEvap)
#
#
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment