Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • CSIndicators CSIndicators
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare revisions
  • Issues 18
    • Issues 18
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Earth SciencesEarth Sciences
  • CSIndicatorsCSIndicators
  • Issues
  • #41
Closed
Open
Issue created Dec 01, 2023 by Eva Rifà@erifarovMaintainer

Error in subsetting Dates

I found an error in CSIndicators v1.1.0 regarding Dates subset.

Summary

The resulting Dates are not correct when the order of the Dates dimension is: 'sdate' 'ftime'. It works well for: 'ftime' 'sdate'

Example

library(CSIndicators)

exp <- CSTools::lonlat_prec_st

res <- CST_PeriodAccumulation(data = exp, time_dim = 'ftime',
                              start = list(10, 03), end = list(20, 03))
res$attrs$Dates
# [1] "2011-03-10 12:00:00 UTC" "2013-03-10 12:00:00 UTC"
# [3] "2011-03-11 12:00:00 UTC"

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))
res$attrs$Dates
# [1] "2011-03-10 12:00:00 UTC" "2012-03-10 12:00:00 UTC"
# [3] "2013-03-10 12:00:00 UTC"

Other Relevant Information

I think that it would be good that the sample data from start has the following order for Dates: 'ftime' 'sdate'.

Assignee
Assign to
Time tracking