Changes between Version 9 and Version 10 of udg/ecoms/RPackage/examples/pointSelection


Ignore:
Timestamp:
Sep 4, 2014 12:38:34 PM (7 years ago)
Author:
juaco
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • udg/ecoms/RPackage/examples/pointSelection

    v9 v10  
    88{{{
    99#!text/R
    10 > library(ecomsUDG.Raccess)
    11 > loginECOMS_UDG("user","password")
     10library(ecomsUDG.Raccess)
     11loginECOMS_UDG("user","password")
    1212}}}
    1313
     
    1616{{{
    1717#!text/R
    18 > point.cfs <- loadECOMS(dataset = "CFSv2_seasonal_16", var = "tas", members = 1:10, lonLim = -3.7, latLim = 40.4, season = 6:8, years = 2001, leadMonth = 2, time = "DD")
     18point.cfs <- loadECOMS(dataset = "CFSv2_seasonal_16", var = "tas", members = 1:10, lonLim = -3.7, latLim = 40.4, season = 6:8, years = 2001, leadMonth = 2, time = "DD")
     19}}}
     20
     21Note that a number of informative messages will appear on-screen:
     22
     23{{{
    1924[2014-09-02 15:28:42] Defining homogeneization parameters for variable "tas"
    2025NOTE: daily mean will be calculated from the 6-h model output
     
    2328[2014-09-02 15:28:46] Retrieving data subset ...
    2429[2014-09-02 15:31:25] Done
    25 > print(object.size(point.cfs))
    26 22456 bytes
    2730}}}
     31
     32This is the size of the loaded object:
     33
     34{{{#!text/R
     35print(object.size(point.cfs)) # 22456 bytes
     36}}}
     37
    2838
    2939The returned object contains all the necessary information for data representation (geo-location, time ...). In the next lines we plot the loaded time series for each member. The element `Data` contains the data itself. In this case, it is a 2D array with the dimensions `member` (10 members selected) and `time` (92 days for June, July and August), as indicated by the `dimensions` attribute.
     
    3242{{{
    3343#!text/R
    34 > str(point.cfs$Data)
     44str(point.cfs$Data)
     45}}}
     46
     47which returns information on the Data array structure:
     48
     49{{{
    3550 num [1:10, 1:92] 16.3 17.1 12.9 10.4 15.3 ...
    3651 - attr(*, "dimensions")= chr [1:2] "member" "time"
     
    4257{{{
    4358#!text/R
    44 > str(point.cfs$Variable)
     59str(point.cfs$Variable)
     60}}}
     61
     62returns the structure of the Variable element of the output:
     63
     64{{{
    4565List of 3
    4666 $ varName   : chr "tas"
     
    6989{{{
    7090#!text/R
    71 > point.wfdei <- loadECOMS(dataset = "WFDEI", var = "tas", lonLim = -3.7, latLim = 40.4, season = 6:8, years = 2001, time = "DD")
    72 [2014-09-02 15:49:44] Defining homogeneization parameters for variable "tas"
    73 [2014-09-02 15:49:44] Defining geo-location parameters
    74 [2014-09-02 15:49:44] Defining time selection parameters
    75 [2014-09-02 15:49:45] Retrieving data subset ...
    76 [2014-09-02 15:49:45] Done
    77 > print(object.size(point.wfdei))
    78 13704 bytes
     91point.wfdei <- loadECOMS(dataset = "WFDEI", var = "tas", lonLim = -3.7, latLim = 40.4, season = 6:8, years = 2001, time = "DD")
     92print(object.size(point.wfdei)) # 13704 bytes
    7993}}}
    8094
     
    8397{{{
    8498#!text/R
    85 > str(point.wfdei$Data)
     99str(point.wfdei$Data)
     100}}}
     101
     102{{{
    86103 num [1:92(1d)] 26.6 25.7 25.6 24.3 23.3 ...
    87104 - attr(*, "dimensions")= chr "time"
    88 > point.wfdei$xyCoords
     105}}}
     106
     107{{{#!text/R
     108point.wfdei$xyCoords
     109}}}
     110
     111{{{
    89112$x
    90113[1] -3.75
     
    102125{{{
    103126#!text/R
    104 > lines(dates, point.wfdei$Data, col = "red", lwd = 1.5)
     127lines(dates, point.wfdei$Data, col = "red", lwd = 1.5)
    105128}}}
    106129