loadECOMS | R Documentation |
Load a user-defined spatio-temporal slice from decadal forecasts
loadECOMS(
dataset,
var,
dictionary = TRUE,
members = NULL,
lonLim = NULL,
latLim = NULL,
season = NULL,
url = NULL,
years = NULL,
leadMonth = 1,
time = "none",
aggr.d = "none",
aggr.m = "none",
threshold = NULL,
condition = NULL
)
dataset |
A character string indicating the database to be accessed. This is usually a path to a local file or a URL pointing to a netCDF or NcML file in the case of netCDF and/or gridded datasets. For station data in standard ASCII format, this is the path to the directory the dataset lives in. |
var |
Variable code (character string). This is the name of the variable according to the R standard naming
(see the next argument). For variables with vertical levels, the vertical level is specified next to the variable name followed
by the “@” symbol (e.g. |
members |
Vector of integers indicating the members to be loaded. |
lonLim |
Vector of length = 2, with minimum and maximum longitude coordinates, in decimal degrees, of the bounding box selected.
For single-point queries, a numeric value with the longitude coordinate. If |
latLim |
Same as |
season |
An integer vector specifying the desired season (in months, January = 1 ..., December = 12).
Options include one to several (contiguous) months. Default to |
years |
Optional vector of years to select. Default ( |
time |
A character vector indicating the temporal filtering/aggregation
of the output data. Default to |
aggr.d |
Character string. Function of aggregation of sub-daily data for daily data calculation.
Currently accepted values are |
aggr.m |
Same as |
A list with the following elements providing the necessary information for data representation and analysis:
Variable |
A list with three elements: |
varName
A character string indicating which is the variable returned.
Same as value provided for argument var
isStandard
Logical value indicating whether the variable returned
is standard or not (i.e., wether the dictionary has been used or not.)
level
A numeric value indicating the vertical level of the variable
(NULL
for 2D variables)
Data |
A N-dimensional array. The number of dimensions (N) depends on the type of request given that dimensions of length one are dropped. Thus, N can take values from 4 (several members for a rectangular domain with different values for longitude, latitude, ensemble and time dimensions) to 1 (atomic vector), for single-point and single-member selections, for which only the time dimension is required. The dimensions are labelled by the “dimnames” attribute. Note that the order of the dimensions is not fixed. |
xyCoords |
A list with |
Dates |
A list with two |
The different nature of the various databases, models and variables,
and the idiosyncratic naming and storage conventions often applied by the different
modelling centres, makes necessary a previous harmonization across datasets in
order to implement a truly user-friendly toolbox for data access.
This 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-
to the standard variables by means of a dictionary, provided by the argument dictionary
.
In essence, the ‘dictionary’ is a csv file particular for each individual dataset,
containing the necessary information for performing the unit conversions to match the standard variable
definitions contained in the vocabulary (see C4R.vocabulary
). This feature is described in more detail
in the loadeR wiki..
Regarding the selection of the spatial domain,
it is possible to select the whole spatial domain of the dataset by defining the arguments lonLim=NULL
and latLim=NULL
. More often, rectangular domains are defined by the minimum and maximum coordinates
in longitude and latitude (for instance lonLim=c(-10,10)
and latLim=c(35,45)
indicates a
rectangular window centered in the Iberian Peninsula), and single grid-cell values
(for instance lonLim=-3.21
and latLim=41.087
for retrieving the data in the closest grid
point to the point coordinate -3.21E, 41.087N. In the last two cases, the function
operates by finding the nearest (euclidean distance) grid-points to the coordinates introduced.
In the case of station data (loadStationData
), the logic is the same, taking into account that in the case
of rectangular domains, all stations falling inside that window will be loaded. For single-point selections,
the closest station will be chosen, and a note on-screen will inform about the distance from the selected point
to the chosen station.
In case of irregular grids (e.g. the typical RCM rotated pole projections), the regular coordinates are included in the
x
and y
elements of the xyCoords
list, while the corresponding geographical coordinates are insode two matrices inside
the lon
and lat
elements.
J. Bedia, S. Herrera, M. Iturbide, J.M. Gutierrez
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.