diff --git a/R/AccumulationExceedingThreshold.R b/R/AccumulationExceedingThreshold.R index eecded6edd066bd628abe2df414c8e3cc554fa69..0b312e9dfc6878585f177369b0058af132a3e3dd 100644 --- a/R/AccumulationExceedingThreshold.R +++ b/R/AccumulationExceedingThreshold.R @@ -113,6 +113,7 @@ CST_AccumulationExceedingThreshold <- function(data, threshold, op = '>', diff = na.rm = na.rm, ncores = ncores) data$data <- total data$dims <- dim(total) + data$coords[[time_dim]] <- NULL if (!is.null(Dates)) { if (!is.null(start) && !is.null(end)) { diff --git a/R/PeriodAccumulation.R b/R/PeriodAccumulation.R index b8dcf9ad2f29e74c0109e9d5f5722c942acbaea3..41c9b6783395cdffc3450c37294f3fd4e61fb7fd 100644 --- a/R/PeriodAccumulation.R +++ b/R/PeriodAccumulation.R @@ -87,6 +87,7 @@ CST_PeriodAccumulation <- function(data, start = NULL, end = NULL, time_dim = time_dim, na.rm = na.rm, ncores = ncores) data$data <- total data$dims <- dim(total) + data$coords[[time_dim]] <- NULL if (!is.null(Dates)) { if (!is.null(start) && !is.null(end)) { diff --git a/R/PeriodMax.R b/R/PeriodMax.R index 0806c51d1dd4b6a9b45131a5a750fd580aae7666..d0004e0831119d3ff6166a7c20a0810987e3c0fc 100644 --- a/R/PeriodMax.R +++ b/R/PeriodMax.R @@ -61,8 +61,8 @@ #'@importFrom ClimProjDiags Subset #'@export CST_PeriodMax <- function(data, start = NULL, end = NULL, - time_dim = 'time', na.rm = FALSE, - ncores = NULL) { + time_dim = 'time', na.rm = FALSE, + ncores = NULL) { # Check 's2dv_cube' if (!inherits(data, 's2dv_cube')) { stop("Parameter 'data' must be of the class 's2dv_cube'.") @@ -80,10 +80,11 @@ CST_PeriodMax <- function(data, start = NULL, end = NULL, Dates <- data$attrs$Dates total <- PeriodMax(data = data$data, dates = Dates, start = start, end = end, - time_dim = time_dim, na.rm = na.rm, ncores = ncores) + time_dim = time_dim, na.rm = na.rm, ncores = ncores) data$data <- total data$dims <- dim(total) + data$coords[[time_dim]] <- NULL if (!is.null(Dates)) { if (!is.null(start) && !is.null(end)) { diff --git a/R/PeriodMean.R b/R/PeriodMean.R index 7066fdd270bc0edf7a2cf47c9bd0489b3b72342e..69ffc8c7cb75047d54ed074ef999b3d672f1cdd2 100644 --- a/R/PeriodMean.R +++ b/R/PeriodMean.R @@ -83,6 +83,7 @@ CST_PeriodMean <- function(data, start = NULL, end = NULL, data$data <- total data$dims <- dim(total) + data$coords[[time_dim]] <- NULL if (!is.null(Dates)) { if (!is.null(start) && !is.null(end)) { diff --git a/R/PeriodMin.R b/R/PeriodMin.R index 842e2e8077673e973f11f1bf340efc03bf83f569..afe5eb83f71db31dc24ddf62ca5a0de340102c20 100644 --- a/R/PeriodMin.R +++ b/R/PeriodMin.R @@ -84,6 +84,7 @@ CST_PeriodMin <- function(data, start = NULL, end = NULL, data$data <- total data$dims <- dim(total) + data$coords[[time_dim]] <- NULL if (!is.null(Dates)) { if (!is.null(start) && !is.null(end)) { diff --git a/R/PeriodVariance.R b/R/PeriodVariance.R index b702981bbccbf1f447c5bb19b2bc2f02d1d0c078..77bf68dc70667e126b82c5009f478868b5e65439 100644 --- a/R/PeriodVariance.R +++ b/R/PeriodVariance.R @@ -88,6 +88,7 @@ CST_PeriodVariance <- function(data, start = NULL, end = NULL, data$data <- total data$dims <- dim(total) + data$coords[[time_dim]] <- NULL if (!is.null(Dates)) { if (!is.null(start) && !is.null(end)) { diff --git a/R/QThreshold.R b/R/QThreshold.R index 4686cb378dc5c09b3fc9b737483567889c2eebe2..0f20858fc8dd989797aa0759bf3205502148201d 100644 --- a/R/QThreshold.R +++ b/R/QThreshold.R @@ -97,6 +97,7 @@ CST_QThreshold <- function(data, threshold, start = NULL, end = NULL, sdate_dim = sdate_dim, ncores = ncores) data$data <- probs data$dims <- dim(probs) + if (!is.null(start) && !is.null(end)) { data$attrs$Dates <- SelectPeriodOnDates(dates = data$attrs$Dates, start = start, end = end, diff --git a/R/Threshold.R b/R/Threshold.R index 9efaebda11ed1aa79cc3a3d17c879fa85d4e3ede..ee4fa38110acb87d5f2b7786d98a553f57c34b0d 100644 --- a/R/Threshold.R +++ b/R/Threshold.R @@ -76,6 +76,9 @@ CST_Threshold <- function(data, threshold, start = NULL, end = NULL, sdate_dim = sdate_dim, na.rm = na.rm, ncores = ncores) data$data <- thres data$dims <- dim(thres) + data$coords[[memb_dim]] <- NULL + data$coords[[sdate_dim]] <- NULL + if (!is.null(start) && !is.null(end)) { data$attrs$Dates <- SelectPeriodOnDates(dates = data$attrs$Dates, start = start, end = end, diff --git a/R/TotalSpellTimeExceedingThreshold.R b/R/TotalSpellTimeExceedingThreshold.R index b7e33cf89516d2e8d4b1e3e421f8a9402deed517..1bc1bb3862aea135dcbe74d3fd08169b91aa1627 100644 --- a/R/TotalSpellTimeExceedingThreshold.R +++ b/R/TotalSpellTimeExceedingThreshold.R @@ -115,6 +115,7 @@ CST_TotalSpellTimeExceedingThreshold <- function(data, threshold, spell, op = '> ncores = ncores) data$data <- total data$dims <- dim(total) + data$coords[[time_dim]] <- NULL if (!is.null(Dates)) { if (!is.null(start) && !is.null(end)) { diff --git a/R/TotalTimeExceedingThreshold.R b/R/TotalTimeExceedingThreshold.R index 4d46260e9aed0d2cf43eb761a09c19b09e215029..5c6bb628bb0c4b35845cb5e6d095253d694eec71 100644 --- a/R/TotalTimeExceedingThreshold.R +++ b/R/TotalTimeExceedingThreshold.R @@ -119,6 +119,7 @@ CST_TotalTimeExceedingThreshold <- function(data, threshold, op = '>', ncores = ncores) data$data <- total data$dims <- dim(total) + data$coords[[time_dim]] <- NULL if (!is.null(Dates)) { if (!is.null(start) && !is.null(end)) {