-
Notifications
You must be signed in to change notification settings - Fork 13
Loading data from the User Data Gateway (UDG)
The User Data Gateway (UDG) is the one stop shop for climate data access maintained by the Santander MetGroup. The UDG builds on the THREDDS Access Portal (UDG-TAP) which is the entry point for authentication and data access (information for registration). Authorization is organized in thematic groups, according to the data policies of different projects and international initiatives. There is also public data available that is open for everyone, for instance, the NCEP/NCAR Reanalysis 1 data, that is used in this worked example. After registration, a username and pasword is provided to #.
In the previous section of the wiki (2.2. Loading remote grid data), we illustrate an example of remote data loading through a ncml file that was stored locally. In the case of loading data from the UDG, the ncml file is also accessed remotely, but with an additional previous step to #, for which function loginUDG
is used:
loginUDG(username = "myuser", password = "mypassword")
The needed link to the ncml file that points to the remote data is indicated for each available dataset, and corresponds to the dataset
argument in function loadGridData
. At this point, we are ready to do the data inventory
di <- dataInventory(dataset = "http://meteo.unican.es/tds5/dodsC/ncepReanalysis1/ncepReanalysis1_4xDaily.ncml", return.stats = FALSE)
## [2016-02-18 11:02:53] Doing inventory ...
## [2016-02-18 11:02:54] Retrieving info for 'tas' (14 vars remaining)
## [2016-02-18 11:02:54] Retrieving info for 'nlwrs' (13 vars remaining)
## [2016-02-18 11:02:55] Retrieving info for 'nswrs' (12 vars remaining)
## [2016-02-18 11:02:55] Retrieving info for 'prate' (11 vars remaining)
## [2016-02-18 11:02:55] Retrieving info for 'tmax' (10 vars remaining)
## [2016-02-18 11:02:55] Retrieving info for 'tmin' (9 vars remaining)
## [2016-02-18 11:02:55] Retrieving info for 'uas' (8 vars remaining)
## [2016-02-18 11:02:55] Retrieving info for 'vas' (7 vars remaining)
## [2016-02-18 11:02:55] Retrieving info for 'air' (6 vars remaining)
## [2016-02-18 11:02:55] Retrieving info for 'hgt' (5 vars remaining)
## [2016-02-18 11:02:56] Retrieving info for 'shum' (4 vars remaining)
## [2016-02-18 11:02:56] Retrieving info for 'uwnd' (3 vars remaining)
## [2016-02-18 11:02:56] Retrieving info for 'vwnd' (2 vars remaining)
## [2016-02-18 11:02:57] Retrieving info for 'rhum' (1 vars remaining)
## [2016-02-18 11:02:57] Retrieving info for 'slp' (0 vars remaining)
## [2016-02-18 11:02:57] Done.
names(di)
## [1] "tas" "nlwrs" "nswrs" "prate" "tmax" "tmin" "uas" "vas"
## [9] "air" "hgt" "shum" "uwnd" "vwnd" "rhum" "slp"
and loading the data remotely with loadeR
tx <- loadGridData(dataset = "http://meteo.unican.es/tds5/dodsC/ncepReanalysis1/ncepReanalysis1_4xDaily.ncml",
var = "tmax",
season = 6,
years = 1991,
time = "DD",
aggr.d = "mean")
## [2016-02-18 11:02:57] Opening connection with remote server...
## [2016-02-18 11:02:57] Connected successfuly
## [2016-02-18 11:02:57] Defining geo-location parameters
## [2016-02-18 11:02:57] Defining time selection parameters
## NOTE: Daily aggregation will be computed from 6-hourly data
## [2016-02-18 11:02:58] Retrieving data subset ...
## [2016-02-18 11:03:05] Done
str(tx)
## List of 4
## $ Variable:List of 2
## ..$ varName: chr "tmax"
## ..$ level : NULL
## ..- attr(*, "use_dictionary")= logi FALSE
## ..- attr(*, "description")= chr "4xDaily Maximum Temperature at 2 m"
## ..- attr(*, "units")= chr "degK"
## ..- attr(*, "longname")= chr "tmax"
## ..- attr(*, "daily_agg_cellfun")= chr "mean"
## ..- attr(*, "monthly_agg_cellfun")= chr "none"
## ..- attr(*, "verification_time")= chr "DD"
## $ Data : num [1:30, 1:94, 1:193] 211 213 216 216 218 ...
## ..- attr(*, "dimensions")= chr [1:3] "time" "lat" "lon"
## $ xyCoords:List of 2
## ..$ x: num [1:193] -178 -176 -174 -172 -171 ...
## ..$ y: num [1:94] -88.5 -86.7 -84.8 -82.9 -80.9 ...
## ..- attr(*, "projection")= chr "LatLonProjection"
## $ Dates :List of 2
## ..$ start: chr [1:30] "1991-06-01 GMT" "1991-06-02 GMT" "1991-06-03 GMT" "1991-06-04 GMT" ...
## ..$ end : chr [1:30] "1991-06-02 GMT" "1991-06-03 GMT" "1991-06-04 GMT" "1991-06-05 GMT" ...
## - attr(*, "dataset")= chr "http://meteo.unican.es/tds5/dodsC/ncepReanalysis1/ncepReanalysis1_4xDaily.ncml"
print(sessionInfo())
## R version 3.2.3 (2015-12-10)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 14.04.3 LTS
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=es_ES.UTF-8 LC_COLLATE=en_US.UTF-8
## [5] LC_MONETARY=es_ES.UTF-8 LC_MESSAGES=en_US.UTF-8
## [7] LC_PAPER=es_ES.UTF-8 LC_NAME=es_ES.UTF-8
## [9] LC_ADDRESS=es_ES.UTF-8 LC_TELEPHONE=es_ES.UTF-8
## [11] LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=es_ES.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] loadeR_0.2-0 loadeR.java_1.1-0 rJava_0.9-8
##
## loaded via a namespace (and not attached):
## [1] lattice_0.20-31 digest_0.6.8 bitops_1.0-6 grid_3.2.3
## [5] formatR_1.2 magrittr_1.5 spam_1.3-0 evaluate_0.7
## [9] stringi_0.4-1 sp_1.1-0 akima_0.5-12 rmarkdown_0.6.1
## [13] tools_3.2.3 stringr_1.0.0 RCurl_1.95-4.7 maps_3.0.2
## [17] fields_8.3-6 yaml_2.1.13 abind_1.4-3 htmltools_0.2.6
## [21] knitr_1.10.5
- Package Installation (and known problems)
- Model Data (reanalysis and climate projections)
- Observations (station and gridded data)
- Standard data manipulation