# Changes between Version 25 and Version 26 of EcomsUdg/RPackage/Functions

Ignore:
Timestamp:
May 20, 2013 2:15:25 PM (9 years ago)
Comment:

--

### Legend:

Unmodified
 v25 ''__Description__'' === ''__Description'' Generates a NcML file from a collection of netCDF files. ''__Usage__'' === ''__Usage'' {{{ }}} ''__Arguments__'' === ''__Arguments'' * source.dir: character string indicating a valid path of the directory containing the files The output is a NcML file named as file.name which will be stored in the output.dir. ''__Details__'' === ''__Details'' * All files of the same dataset should be put together in the same directory, indicated by the source.dir argument. * A number of useful recommendations regarding dataset naming are provided [http://www.unidata.ucar.edu/software/netcdf-java/reference/DatasetUrls.html#NcmlScan here] ''__Value__'' === ''__Value'' Creates a NcML file at the specified location ''__Notes__'' === ''__Notes'' A NcML file is a [http://en.wikipedia.org/wiki/XML XML] representation of netCDF metadata. This is approximately the same information one gets when dumping the header of a netCDF file (e.g. by typing on the terminal the command ncdump -h). By means of NcML it is possible to create virtual datasets by modifying and  aggregating other datasets, thus providing maximum flexibility and ease of access to data stored in collections of files containing data from different variables/time slices. The function makeNcmlDataset is intended to deal with reanalysis, forecasts and other climate data products, often consisting of collections of netCDF files corresponding to different variables and partitioned by years/decades or other time slices. It operates by applying to types of [http://www.unidata.ucar.edu/software/netcdf/ncml/v2.2/Aggregation.html aggregation operations]: === ''__Examples'' === An example of this function is provided in the [wiki:SpecsEuporias/RPackage/Examples Examples section] = dataInventory = ''__Description__'' === ''__Description__'' Provides summary information about the main characteristics of a NcML dataset. ''__Usage__'' === ''__Usage__'' {{{ ''__Arguments__'' === ''__Arguments__'' * ncml.file: a character string indicating the full path to the virtual dataset (the NcML file). This can be either a path containing the directory and name of the file, or an appropriate URL in case the dataset is remotely accessed (e.g., via the [https://www.meteo.unican.es/trac/meteo/wiki/SpecsEuporias/DataServer/THREDDS SPECS-EUPORIAS THREDDS]). ''__Value__'' === ''__Value__'' The output of the function consists of a list of variable length, depending on the number of variables contained in the dataset, following this structure: * Values: A vector containing all the dimension values. This might be a vector of POSIXlt class in case of a dimension of type ''time'', or numeric in other cases. ''__Details__'' === ''__Details__'' A common need prior to data analysis is to get an overview of all data available and their structure (variables, dimensions, units, geographical extent, time span ...). Note that the function provides an overview of the raw data as they are stored in the original data files. The units may change after loading the function if conversions are applied via dictionary. === ''__Examples__'' An example of this function is provided in the [wiki:SpecsEuporias/RPackage/Examples Examples section] = loadObservations = ''__Description'' === ''__Description'' Loads observational station data from standard station datasets stored in ''.csv'' files. ''__Usage'' === ''__Usage'' {{{ }}} ''__Arguments'' === ''__Arguments'' * source.dir: Character string indicating the full path to the directory where the data are stored (see Details). ''__Details'' === ''__Details'' This function works with standard ''.csv'' observational datasets. It allows loading data from one or several stations at a time. ''__Value'' === ''__Value'' A list with the containing the following elements: === ''__Examples__'' An example of this function is provided in the [wiki:SpecsEuporias/RPackage/Examples Examples section] = loadData = ''__Description'' === ''__Description'' Loads selected dimensional slices of a NcML dataset. The function is intended to deal with gridded data (interpolated surfaces, reanalysis, RCMs/GCMs ...) ''__Usage'' === ''__Usage'' {{{ }}} ''__Arguments'' === ''__Arguments'' * var: Character string indicating the variable to load. ''__Details'' === ''__Details'' The function can select the whole spatial domain covered by the dataset, spatial windows defined by the minimum and maximum corner coordinates, and single grid-cell values. In the last two cases, the function operates by finding the closest grid-points to the coordinates introduced. ''__Value'' === ''__Value'' A list with the following components: === ''__Examples__'' An example of this function is provided in the [wiki:SpecsEuporias/RPackage/Examples Examples section] = loadSystem4 = ''__Description__'' === ''__Description__'' Loads hindcast/forecast data from ECMWF's System4 model by remotely accessing the SPECS-EUPORIAS THREDDS Data Server. ''__Usage__'' === ''__Usage__'' {{{ }}} ''__Arguments__'' === ''__Arguments__'' * dataset: A character string indicating the full URL path to the OPeNDAP dataset. Currently, the accepted values correspond to the System4 [https://www.meteo.unican.es/trac/meteo/wiki/SpecsEuporias/DataServer/Datasets  available datasets] at the SPECS-EUPORIAS THREDDS Data Server. * leadMonth: Lead month forecast time corresponding to the first month of the specified season. Note that leadMonth = 1 for season = 1 (January) corresponds to the December initialization forecasts. The effect of the lead time in the forecast for a particular season can be analyzed by just changing this parameter. ''__Details__'' === ''__Details__'' Currently, accepted values for the argument var are tas, tasmin, tasmax, pr or mslp, as internally defined in the vocabulary of System4 following the nomenclature displayed in the table below. However, note that new variables and datasets will be progressively included. Further details regarding the nature and temporal aggregation of these variables can be obtained through the dataInventory function. ''__Value'' === ''__Value'' The output returned by the function consists of a list with the following elements providing the necessary information for data representation and analysis: * End: End time of the verification period of the variable ''__Note__'' === ''__Note__'' A worked example describing a multi-model selection of a dataset is presented in the tutorial, which can be downloaded [https://www.meteo.unican.es/trac/meteo/attachment/wiki/SpecsEuporias/DataPortal_Tutorial.pdf here], ''__Examples__'' An example of this function is provided in the [wiki:SpecsEuporias/RPackage/Examples Examples section] === ''__Examples__'' An example of this function is provided in the [wiki:SpecsEuporias/RPackage/Examples Examples section]