Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • CSTools CSTools
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 28
    • Issues 28
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • External
  • CSToolsCSTools
  • Merge requests
  • !186

Draft: Correct reordering in RainFARM

  • Review changes

  • Download
  • Patches
  • Plain diff
Closed Eva Rifà requested to merge develop-RainFARM_errordim into master Oct 03, 2023
  • Overview 1
  • Commits 3
  • Pipelines 3
  • Changes 1

The error happened when exp <- lonlat_prec_st was used instead of exp <- lonlat_prec. The difference is due to that the first object has var dimension. I think this should be corrected since the function needs to allow flexibility in margin dimensions (dimensions not used in the calculation).

The error is the following: when lonlat_prec is used, the variable iorder is a vector, whereas lonlat_prec_st is used, iorder it's a named list. The modification allows the function to work in both cases. These lines are in charge of reordering the array dimensions.

library(CSTools)
load("/esarchive/scratch/erifarov/git/cstools/data/lonlat_temp_st.rda")

`exp <- lonlat_prec_st`

ilon <- which(exp$coords$lon %in% 5:12)
ilat <- which(exp$coords$lat %in% 40:47)
exp$data <- exp$data[, , , , , ilat, ilon, drop = FALSE]
names(dim(exp$data)) <- names(dim(lonlat_prec_st$data))
exp$coords$lon <- exp$coords$lon[ilon]
exp$coords$lat <- exp$coords$lat[ilat]
downscaled <- RainFARM(exp$data, exp$coords$lon, exp$coords$lat, 
                       nf = 20, kmin = 1, nens = 3,
                       time_dim = c("member", "ftime"))
Edited Oct 03, 2023 by Eva Rifà
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: develop-RainFARM_errordim