Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • s2dv s2dv
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 17
    • Issues 17
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Earth SciencesEarth Sciences
  • s2dvs2dv
  • Issues
  • #108
Closed
Open
Issue created Oct 11, 2023 by vagudets@vagudetsMaintainer

Ano_CrossValid() and Clim(): Can the requirement for equal dimensions in exp and obs be removed?

Hi @aho,

Summary

Currently, Ano_CrossValid() and Clim() contain checks requiring exp and obs to meet the following requirement:

Parameter 'exp' and 'obs' must have the same dimensions except 'dat_dim'.

This is a problem for the use case where the anomalies have to be computed on exp and obs data in their respective original grids, which may have different lon and lat dimensions, for example when downscaling will be performed afterwards.

I have briefly reviewed the functions and it seems like the climatologies and anomalies for the experiment and the observations are computed separately and do not depend on each other, and for this reason, the requirement for exp and obs to have the same dimensions may be unnecessary. @eduzenli and @jramon will be reviewing the different anomaly computation methods individually to fully confirm this, or see if there is any specific method that requires the dimensions to be common, and will leave a comment with their conclusions.

On a similar note, we are wondering about the requirement to pass both exp and obs to the function. Although I understand that this may be because the focus of the package is verification, so usually both datasets will be present.

Example

library(s2dv)

# Mock data
exp <- rnorm(300)
dim(exp) <- c(dataset = 1, sdate = 3, ftime = 1, latitude = 10, longitude = 10, member = 1)
obs <- rnorm(7500)
dim(obs) <- c(dataset = 1, sdate = 3, ftime = 1, latitude = 50, longitude = 50, member = 1)
# Try to compute climatology
clim <- Clim(exp, obs)
## Error in Clim(exp, obs) : 
##   Parameter 'exp' and 'obs' must have the same dimensions except 'dat_dim'.
# Try to compute anomalies in cross-validation
ano <- Ano_CrossValid(exp, obs)
## Error in Ano_CrossValid(exp, obs) : 
##   Parameter 'exp' and 'obs' must have the same length of all dimensions except 'dat_dim'.

Module and Package Version

R version: R/4.1.2 s2dv version: 1.4.1

Please @eduzenli and @jramon, feel free to make corrections or add anything I may have forgotten.

Thanks,

Victòria

Edited Oct 11, 2023 by vagudets
Assignee
Assign to
Time tracking