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

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

--

### Legend:

Unmodified
 v15 {{{ #!text/R > library(ecomsUDG.Raccess) Loading required package: rJava > data(vocabulary) > print(vocabulary) library(ecomsUDG.Raccess) data(vocabulary) print(vocabulary) }}} {{{ identifier                           standard_name           units 1         tas                     2-meter temperature degrees Celsius {{{ #!text/R > ip <- installed.packages() > # Path to the installed library > libPath <- ip[grep("ecomsUDG.Raccess", ip[ ,1]), 2] > # Path to the dictionaries folder > dicPath <- paste(libPath, "/ecomsUDG.Raccess/dictionaries", sep = "") > list.files(dicPath) [1] "CFSv2_seasonal_16.csv"   "System4_annual_15.csv"   "System4_seasonal_15.csv" [4] "System4_seasonal_51.csv" > dic <- read.csv(list.files(dicPath, full = TRUE)[grep("CFSv2", list.files(dicPath))]) > str(dic.cfs) 'data.frame':      5 obs. of  9 variables: $identifier : Factor w/ 5 levels "psl","tas","tasmax",..: 3 4 2 5 1$ short_name      : Factor w/ 5 levels "Maximum_temperature_height_above_ground" ... $time_step : Factor w/ 1 level "6h": 1 1 1 1 1$ lower_time_bound: int  0 0 0 0 0 $upper_time_bound: int 6 6 6 6 0$ aggr_fun        : Factor w/ 5 levels "max","mean","min",..: 1 3 2 5 4 $offset : num -273 -273 -273 0 0$ scale           : int  1 1 1 21600 1 $deaccum : int 0 0 0 0 0 # Path to the installed library libPath <- find.package("ecomsUDG.Raccess") # Path to the dictionaries folder dicPath <- file.path(libPath, "dictionaries") list.files(dicPath) }}} {{{ [1] "CFSv2_seasonal_16.dic" "NCEP.dic" [3] "readme.txt" "System4_annual_15.dic" [5] "System4_seasonal_15.dic" "System4_seasonal_51.dic" [7] "WFDEI.dic" }}} In this case, we inspect the dictionary of the CFSv2 dataset: {{{ #!text/R dic.cfs <- read.csv(list.files(dicPath, full = TRUE)[grep("CFSv2", list.files(dicPath))]) str(dic.cfs) }}} {{{ 'data.frame': 4 obs. of 11 variables:$ identifier      : Factor w/ 4 levels "tas","tasmax",..: 2 3 1 4 $short_name : Factor w/ 4 levels "Maximum_temperature_height_above_ground",..: 1 2 4 3$ time_step       : Factor w/ 1 level "6h": 1 1 1 1 $lower_time_bound: int 0 0 0 0$ upper_time_bound: int  6 6 6 6 $cell_method : Factor w/ 4 levels "max","mean","min",..: 1 3 2 4$ offset          : num  -273 -273 -273 0 $scale : int 1 1 1 21600$ deaccum         : int  0 0 0 0 $derived : int 0 0 0 0$ interface       : logi  NA NA NA NA}}} }}} * 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. * 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. * 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. * 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. * offset: constant summed to the original variable for units conversion (e.g.: offset = -273.15 for conversion from Kelvin to Celsius) * scale: scale factor applied to the original variable for units conversion (e.g.: scale = 0.001 for conversion from m to mm) * 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. * 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. * interface: this is a internal value used by the loading functions. '''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. '''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.