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
  • !202

New function CST_ChangeDimNames(): Rename dimensions in an s2dv_cube

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged vagudets requested to merge develop-CST_ChangeDimNames into master Jan 10, 2024
  • Overview 8
  • Commits 6
  • Pipelines 4
  • Changes 5

Hi @erifarov

I developed this method to rename the dimensions of the $data in an s2dv_cube and renaming $dims, $coords and $attrs accordingly. I might have missed something that needs changing so if you see anything, please let me know!

Here is some code to test the function:

library(CSTools)
source("https://earth.bsc.es/gitlab/external/cstools/-/raw/develop-CST_ChangeDimNames/R/CST_ChangeDimNames.R")

# Check original dimensions and coordinates
lonlat_temp$exp$dims
names(lonlat_temp$exp$coords)
dim(lonlat_temp$exp$attrs$Dates)
# Change 'dataset' to 'dat' and 'ftime' to 'time'
exp <- CST_ChangeDimNames(lonlat_temp$exp,
                          original_names = c("dataset", "ftime"),
                          new_names = c("dat", "time"))
# Check new dimensions and coordinates
exp$dims
names(exp$coords)
dim(exp$attrs$Dates)

Cheers,

Victòria

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: develop-CST_ChangeDimNames