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
  • #87
Closed
Open
Issue created Jan 25, 2021 by aho@ahoMaintainer

Start: return_vars returns repetitive metadata

When lat/lon selectors are assigned by values() + parameter 'synonims' is used + 'return_vars' list name is the synonmin + 'return_vars' value is not 'dat', the returned metadata is repetitive. Take the code below as an example. 'return_vars' has 'latitude' and 'longitude' as the list names instead of 'lat' and 'lon'. The value is NULL rather than 'dat'. The returned metadata includes 'lon' and 'lat' as well as 'longitude' and 'latitude'.

Need to test if 'time' has the same situation, and if the situation only happens when the metadata is common (i.e., under $common rather than $dat1).

The bug exists in startR_v1.0.3, too.

library(startR)
repos_obs <- '/esarchive/obs/ukmo/hadisst_v1.1/monthly_mean/$var$/$var$_$date$.nc'

obs <- Start(dat = repos_obs,
             var = 'tos',
             date = '200505',
             time = 'all',
             lat = values(list(-10, 10)),  # if use indices(), no bug
             lat_reorder = Sort(),
             lon = values(list(10, 20)),
             lon_reorder = CircularSort(0, 360),
             time_across = 'date',
             #combine time and file_date dims 
             merge_across_dims = TRUE,
             #exclude the additional NAs generated by merge_across_dims
             merge_across_dims_narm = TRUE,
             synonims = list(lat = c('lat', 'latitude'),
                             lon = c('lon', 'longitude')),
             return_vars = list(latitude = NULL,  # the name should be lat
                                longitude = NULL,
                                time = 'date'),
             retrieve = TRUE)

names(attr(obs, 'Variables')$common)
[1] "latitude"  "longitude" "time"      "lat"       "lon"       "tos"    

@nperez I tag you to keep you in the loop.

Edited Jan 25, 2021 by aho
Assignee
Assign to
Time tracking