Changes between Version 15 and Version 16 of udg/ecoms/RPackage/homogeneization


Ignore:
Timestamp:
Mar 9, 2015 6:00:23 PM (7 years ago)
Author:
juaco
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • udg/ecoms/RPackage/homogeneization

    v15 v16  
    1414{{{
    1515#!text/R
    16 > library(ecomsUDG.Raccess)
    17 Loading required package: rJava
    18 > data(vocabulary)
    19 > print(vocabulary)
     16library(ecomsUDG.Raccess)
     17data(vocabulary)
     18print(vocabulary)
     19}}}
     20{{{
    2021 identifier                           standard_name           units
    21221         tas                     2-meter temperature degrees Celsius
     
    4748{{{
    4849#!text/R
    49 > ip <- installed.packages()
    50 > # Path to the installed library
    51 > libPath <- ip[grep("ecomsUDG.Raccess", ip[ ,1]), 2]
    52 > # Path to the dictionaries folder
    53 > dicPath <- paste(libPath, "/ecomsUDG.Raccess/dictionaries", sep = "")
    54 > list.files(dicPath)
    55 [1] "CFSv2_seasonal_16.csv"   "System4_annual_15.csv"   "System4_seasonal_15.csv"
    56 [4] "System4_seasonal_51.csv"
    57 > dic <- read.csv(list.files(dicPath, full = TRUE)[grep("CFSv2", list.files(dicPath))])
    58 > str(dic.cfs)
    59 'data.frame':      5 obs. of  9 variables:
    60  $ identifier      : Factor w/ 5 levels "psl","tas","tasmax",..: 3 4 2 5 1
    61  $ short_name      : Factor w/ 5 levels "Maximum_temperature_height_above_ground" ...
    62  $ time_step       : Factor w/ 1 level "6h": 1 1 1 1 1
    63  $ lower_time_bound: int  0 0 0 0 0
    64  $ upper_time_bound: int  6 6 6 6 0
    65  $ aggr_fun        : Factor w/ 5 levels "max","mean","min",..: 1 3 2 5 4
    66  $ offset          : num  -273 -273 -273 0 0
    67  $ scale           : int  1 1 1 21600 1
    68  $ deaccum         : int  0 0 0 0 0
     50# Path to the installed library
     51libPath <- find.package("ecomsUDG.Raccess")
     52# Path to the dictionaries folder
     53dicPath <- file.path(libPath, "dictionaries")
     54list.files(dicPath)
     55}}}
     56{{{
     57[1] "CFSv2_seasonal_16.dic"   "NCEP.dic"               
     58[3] "readme.txt"              "System4_annual_15.dic" 
     59[5] "System4_seasonal_15.dic" "System4_seasonal_51.dic"
     60[7] "WFDEI.dic" 
     61}}}
     62
     63In this case, we inspect the dictionary of the CFSv2 dataset:
     64
     65{{{
     66#!text/R
     67dic.cfs <- read.csv(list.files(dicPath, full = TRUE)[grep("CFSv2", list.files(dicPath))])
     68str(dic.cfs)
     69}}}
     70{{{
     71'data.frame':   4 obs. of  11 variables:
     72 $ identifier      : Factor w/ 4 levels "tas","tasmax",..: 2 3 1 4
     73 $ short_name      : Factor w/ 4 levels "Maximum_temperature_height_above_ground",..: 1 2 4 3
     74 $ time_step       : Factor w/ 1 level "6h": 1 1 1 1
     75 $ lower_time_bound: int  0 0 0 0
     76 $ upper_time_bound: int  6 6 6 6
     77 $ cell_method     : Factor w/ 4 levels "max","mean","min",..: 1 3 2 4
     78 $ offset          : num  -273 -273 -273 0
     79 $ scale           : int  1 1 1 21600
     80 $ deaccum         : int  0 0 0 0
     81 $ derived         : int  0 0 0 0
     82 $ interface       : logi  NA NA NA NA}}}
    6983}}}
    7084
     
    7892 * `lower_time_bound`: lower time bound of the variable. This should be in hours. This is the number of hours to substract from the verification times to define the lower time boundary of the verification period. See the example below.
    7993 * `upper_time_bound`: upper time bound of the variable. This should be in hours. This is the number of hours to add to the verification times to define the upper time boundary of the verification period. See the example below.
    80  * `aggr_fun`: time aggregation function. Type of aggregation function applied to the variable between the lower and upper time bound. For instance, typically its value is "none" for instantaneous variables, "mean" for mean daily temperatures or "sum" for daily precipitation values. See the example below.
     94 * `cell_method`: function of time aggregation between the lower and upper time bound. For instance, its value is "none" for instantaneous variables, "mean" for mean daily temperatures or "sum" for daily precipitation values. See the example below.
    8195 * `offset`: constant summed to the original variable for units conversion (e.g.: offset = -273.15 for conversion from Kelvin to Celsius)
    8296 * `scale`: scale factor applied to the original variable for units conversion (e.g.: scale = 0.001 for conversion from m to mm)
    8397 * `deaccum`. This is a logical flag (0 = FALSE, 1= TRUE), which indicates if the variable should be de-accumulated at each time step. Typically applied to precipitation in some forecast datasets.
     98 * `derived`: this value is internally used by the loading functions to know if the variable is derived from any other variable(s) or can be directly read from the dataset.
     99 * `interface`: this is a internal value used by the loading functions.
    84100
    85 '''Example''': Suppose we have daily temperature data, each record associated to a date (e.g. 19780420 for 20th April 1978). The lower time bound in this case is 0, and the upper time bound 24, indicating that the verification period of the value starts 20 April 1978 at 00:00 and ends 20 April 1978 23:59:59 (i.e., the range {{{[19780420, 19780421)}}}. Because it is mean temperature, the aggregation function for this time interval would be "mean". If the same record has a time associated at 12:00 rather than 00:00 (i.e. 20 April 1978 at 12:00), then the lower and the upper time bounds would be 12.
     101'''Example''': Suppose we have daily temperature data, each record associated to a date (e.g. 19780420 for 20th April 1978). The lower time bound in this case is 0, and the upper time bound 24, indicating that the verification period of the value starts 20 April 1978 at 00:00 and ends 20 April 1978 23:59:59 (i.e., the time interval {{{[19780420, 19780421)}}}. Because it is mean temperature, the `cell_method` for this variable is "mean". If the same record has a time associated at 12:00 rather than 00:00 (i.e. 20 April 1978 at 12:00), then the lower and the upper time bounds would be 12.
    86102
    87103