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 6
    • Merge requests 6
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • 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
  • #99
Closed
Open
Issue created May 05, 2021 by aho@ahoMaintainer

Misplaced data when reshape parameters used

The problem is detected from use case ex1_2 https://earth.bsc.es/gitlab/es/startR/-/blob/master/inst/doc/usecase/ex1_2_exp_obs_attr.R. The obs data along dimensions 'sdate' and 'time' are swapped. Use case ex1_3 has a similar Start call but the data are correct.

dim(obs)
  dat   var sdate  time   lat   lon 
    1     1     4     3   256   512 
# (1) 200501 (sdate = 1, time = 1)
dates[1, 1]
[1] "2005-01-16 12:00:00 UTC"
obs[1, 1, 1, 1, 1, 1] #CORRECT
[1] 250.212
## check with netCDF file
file200501 <- NcOpen('/esarchive/recon/ecmwf/erainterim/monthly_mean/tas_f6h/tas_200501.nc')
obs200501 <- NcToArray(file200501, vars_to_read = 'tas', dim_indices = list(lon = 1, lat = 256, time = 1))
NcClose(file200501)
obs200501[1]
[1] 250.212  

# (2) 200502 (sdate = 1, time = 2)
dates[1, 2]
[1] "2005-02-15 UTC"
obs[1, 1, 1, 2, 1, 1]  #WRONG. It is 200601 (sdate = 2, time = 1)
[1] 248.2269
## check with netCDF file
file200601 <- NcOpen('/esarchive/recon/ecmwf/erainterim/monthly_mean/tas_f6h/tas_200601.nc')
obs200601 <- NcToArray(file200601, vars_to_read = 'tas', dim_indices = list(lon = 1, lat = 256, time = 1))
obs200601[1]
[1] 248.2269

@llledo I haven't checked the script you gave me. I'll work on ex1_2 first since it's more simple. Sorry for the inconvenience.

An-Chi

Edited May 05, 2021 by aho
Assignee
Assign to
Time tracking