Skip to content

Time aggregation functions not drop time dimension

This issue is regarding time aggregation functions:

  • PeriodAccumulation
  • PeriodMean
  • PeriodMax
  • PeriodMin
  • PeriodVariance
  • AccumulationExceedingThreshold
  • TotalSpellTimeExceedingThreshold
  • TotalTimeExceedingThreshold

Current behaviour
Now, when a time dimension is aggregated, it drops.

exp <- CSTools::lonlat_prec_st
dim(exp$data)
exp$attrs$Dates <- Reorder(exp$attrs$Dates, c(2,1))
res <- CST_PeriodAccumulation(data = exp, time_dim = 'ftime',
                              start = list(10, 03), end = list(20, 03))
dim(res$data)
# Same for Dates

Development needed
I think that it would be good to not drop the accumulated dimension since the common structure for a climate data array is with forecast time dimension. As an example, the function from CSTools: SaveExp, needs to add a time dimension of lenght 1 internally to work.

Edited by Eva Rifà