Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • startR startR
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 29
    • Issues 29
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • 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
  • startRstartR
  • Issues
  • #125
Closed
Open
Issue created Dec 21, 2021 by aho@ahoMaintainer

Chunking problem when the dimension is reshaped

Reported by @cchou, the chunking has problems over the dimension that is merged and split. the example code is below:

# obs
path.obs <- '/esarchive/recon/ecmwf/era5/monthly_mean/$var$_f1h-r1440x721cds/$var$_$date$.nc'

y1 <- 1981; y2 <- 1984
sdate <- paste0(y1:y2, "07", '01')
var <- 'prlr'

# manually create the dates for obs
dates.obs <- c(paste0(y1:y2, "07", '15'),
               paste0(y1:y2, "08", '15'),
               paste0(y1:y2, "09", '15')) 


# convert to the form required by Start()
time.obs <- as.POSIXct(dates.obs, "%Y%m%d",
                       origin = paste0(y1,'-', "07"), tz = 'UTC')
dim(time.obs) <- c('sdate' = y2 - y1 + 1, 'time' = 3)

obs <- Start(data = path.obs,
             var = var,
             date = unique(format(time.obs, '%Y%m')),
             time = values(time.obs),
             lat = indices(1:2),
             lat_reorder = Sort(),
             lon = indices(1:2),
             lon_reorder = CircularSort(0, 360),
             time_across = 'date',
             merge_across_dims = TRUE,
             split_multiselected_dims = TRUE,
             synonims = list(lon = c('lon', 'longitude'),
                             lat = c('lat', 'latitude')),
             return_vars = list(lon = NULL,
                                lat = NULL,
                                time = 'date'),
             retrieve = FALSE)

fun <- function (obs) {
  return(obs)
}
step <- Step(fun, target_dims = list(obs = 'sdate'), output_dims = list(obs = 'sdate'))
wf <- AddStep(obs, step)
res <- Compute(wf, chunks = list(time = 3))
Edited Dec 21, 2021 by aho
Assignee
Assign to
Time tracking