Changes between Initial Version and Version 1 of udg/ecoms/RPackage/homogeneization


Ignore:
Timestamp:
Sep 17, 2013 12:52:49 PM (9 years ago)
Author:
juaco
Comment:

--

Legend:

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

    v1 v1  
     1The different nature of the different climate products, models and variables, and the idiosyncratic naming and storage conventions often applied by the various modelling centres, makes necessary a previous homogeneization across datasets in order to implement a truly user-friendly toolbox for data access. The `meteor` package achieves this aim by defining a common ''vocabulary'' to all climate datasets. The particular variables of each dataset are translated -and transformed if necessary- into the common vocabulary by means of a ''dictionary''. Both features are next described.
     2
     3== Vocabulary definition
     4
     5In order to set a common framework with a precise definition of the variables, the `meteoR` package is based on the use of a vocabulary. In essence, the vocabulary is a table containing the standard names of a number of variables commonly used in impact studies and downscaling applications, subject to permanent revision or addition of new standard variables. The naming conventions and the units are based on the standard name [http://www.specs-fp7.eu/wiki/index.php/Data#SPECS_convention:_Standard_output_and_data_management_description table] provided in the frame of the SPECS project
     6
     7{{{#!comment
     8by the [http://cf-pcmdi.llnl.gov/documents/cf-standard-names/standard-name-table/16/cf-standard-name-table.html/ NetCDF Climate and Forecast Metadata Convention]. The vocabulary consists of a table with:
     9}}}
     10
     11* `Identifier`: this is the standard name that the loading functions require as argument when we set the `standard.vars` argument to `TRUE` (see the [wiki:SpecsEuporias/RPackage/Functions defined functions]).
     12* `Standard_name`: standard name of the variable as defined by the CF convention.
     13* `Units`: units in which the standard variable is returned
     14
     15{{{
     16"identifier","standard_name","units"
     17"ta","temperature","degrees Celsius"
     18"tas","2-meter temperature","degrees Celsius"
     19"tasmax","maximum 2-m temperature","degrees Celsius"
     20"tasmin","minimum 2-m temperature","degrees Celsius"
     21"pr","Precipitation amount","mm"
     22"zg","geopotential_height","m"
     23"plev","air_pressure","Pa"
     24"psl","air_pressure_at_sea_level","Pa"
     25"ps","surface_air_pressure","Pa"
     26"hus","specific_humidity","kg kg-1"
     27"hur","relative_humidity","1"
     28"ua","eastward_wind","m s-1"
     29"va","northward_wind","m s-1"
     30}}}
     31
     32
     33== Dictionary
     34
     35The dictionary is a table whose aim is twofold:
     36 1. On the one hand, the dictionary is intended for the translation of generic variables, as idiosyncratically defined in each particular dataset, to the standard variables defined in the vocabulary with their corresponding nomenclature and units. This is achieved by providing a correspondence between the name of the variable as encoded in the dataset (`short_name`) and the corresponding name of the standard variable as defined in the vocabulary (`identifier`), and by applying the corresponding transformation to the native variable in order to match the standard units by means of a `scale` factor and an `offset`. In some particular cases (e.g. the precipitation provided by the System4 model outputs), the variables are also deaccumulated.
     37 2. The dictionary also provides additional metadata often not explicitly declared in the datasets, regarding the ''time'' aggregation of the dataset (often referred to as the ''cell method''). This includes the fields `time_step`, which is merely informative, and describes the time interval between two consecutive values, and the `lower_time_bound` and `upper_time_bound`, which are the values that should be summed to each verification time to unequivocally delimit the time span encompassed by each value.
     38       
     39The dictionary is a comma-sepparated text file (csv), that by default is identified with the same name than the dataset, and the extension ''.dic'', and stored in the same directory than the dataset, although its name and location can be other if adequately specified in the loading functions by the argument `dictionary`. The dictionary must be created  ''"by hand"'' by the user, because it requires some ''a priori'' knowledge about the characteristics of the data stored in the dataset, that can be partly obtained using the function [wiki:SpecsEuporias/RPackage/Functions#dataInventory dataInventory]. The columns of the dictionary are next described:
     40 
     41 * `identifier`: this is the name of the standard variable, as defined in the vocabulary
     42 * `short_name`: this is the name with which the original variable has been coded in the dataset
     43 * `time_step`: the time interval between consecutive times in the time dimension axis (in hours)
     44 * `lower_time_bound`: lower time bound of the variable. This should be in hours.
     45 * `upper_time_bound`: upper time bound of the variable. This should be in hours. For instance, if a variable has identical lower and upper time bounds, it means that it is instantaneous.
     46 * `aggr_fun`: time aggregation function. Type of aggregation function applied to the variable between the lower and upper time bound.
     47 * `offset`: constant summed to the original variable for units conversion (e.g.: offset = -273.15 for conversion from Kelvin to Celsius)
     48 * `scale`: scale factor applied to the original variable for units conversion (e.g.: scale = 0.001 for conversion from m to mm)
     49 * `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.
     50
     51In the following example, we show the characteristics of the dictionary constructed for the 15 members seasonal forecast of the ECMWF's System4 model:
     52
     53{{{
     54identifier,short_name,time_step,lower_time_bound,upper_time_bound,aggr_fun,offset,scale,deaccum
     55tasmax,Maximum_temperature_at_2_metres_since_last_24_hours_surface,24h,0,24,max,-273.15,1,0
     56tasmin,Minimum_temperature_at_2_metres_since_last_24_hours_surface,24h,0,24,min,-273.15,1,0
     57tas,Mean_temperature_at_2_metres_since_last_24_hours_surface,24h,0,24,mean,-273.15,1,0
     58pr,Total_precipitation_surface,24h,0,24,sum,0,1000,1
     59psl,Mean_sea_level_pressure_surface,6h,0,0,none,0,1,0
     60}}}
     61
     62
     63Note that column names matter (not so their relative order), because the data load functions will perform the conversion of the variables to the standard format by finding the corresponding values by the name of the columns. The [https://www.meteo.unican.es/trac/meteo/attachment/wiki/SpecsEuporias/meteoR_v1_0.zip meteoR] package includes some dictionaries, and specific examples are given in the [wiki:SpecsEuporias/RPackage/Examples Examples section]