wiki:udg/ecoms/RPackage/examples

Version 4 (modified by juaco, 9 years ago) (diff)

--

In the next lines we describe an illustrative example considering SYSTEM4, one-month lead time forecasts of minimum surface temperature for January over a window centered in Europe (0oW - 30oE and 35oS - 65oN). A more elaborated example describing a multi-model selection of a similar dataset is presented in the tutorial, which can be downloaded here.

The request is simply formulated via the loadSystem4 function in the following way:

> ds <- "http://www.meteo.unican.es/tds5/dodsC/system4/System4_Seasonal_15Members.ncml";
> openDAP.query <- loadSystem4(dataset = ds, var = "tasmin", members = 1, 
+      lonLim = c(0,30), latLim = c(35,65),
+      season = 1, years = 1981:2000, leadMonth = 1)

The function arguments are the next described:

  • dataset: A character string indicating the full URL path to the OPeNDAP dataset. Currently, the accepted values correspond to the System4 datasets described in Sec. \ref{s.thredds}, as specified in the above example, but using \texttt{System4\_Seasonal\_15Members.ncml}, \texttt{System4\_Seasonal\_51Members.ncml}, or \texttt{System4\_Annual\_15Members.ncml} ending strings.

\item \texttt{var}: Variable code. Currently \texttt{tas}, \texttt{tasmin}, \texttt{tasmax}, \texttt{pr}, \texttt{mslp}, as internally defined in the dictionary defined for System4 following the nomenclature displayed in Table \ref{t.dictionary}, although new variables and datasets will be soon included. \item \texttt{members}: Optional. Default to all members. In the above case, a single member (the first) of the System4 ensemble is loaded, but additional members could be also specified (e.g. \texttt{members=NULL} for all members, or \texttt{members=1:5} for the first five members). \item \texttt{lonLim}: Vector of length = 2, with minimum and maximum longitude coordinates, in decimal degrees, of the bounding box selected. \item \texttt{latLim}: Vector of length = 2, with minimum and maximum latitude coordinates, in decimal degrees, of the bounding box selected. \item \texttt{season}: A vector of integers specifying the desired season (in months, January=1, etc.) of analysis. Options include a single month (as in the above example) or a standard season (e.g. \texttt{period = c(12,1,2)} for standard Boreal winter, DJF). \item \texttt{years}: Optional. Default to all available years. Vector of years to select. Note that in cases with year-crossing seasons (e.g. winter DJF, \texttt{season = c(12,1,2)}, for a particular year period \texttt{years = 1981:2000}), by convention the first season would be DJF 1980/81, if available (otherwise a warning message is given). \item \texttt{loadMonth}: Lead month forecast time corresponding to the first month of the specified season. Note that \texttt{leadMonth = 1} for \texttt{season = 1} (January) correspond to the December initilization forecasts. In this way the effect of the lead time forecast in the analysis of a particular season can be analyzed by just changing this parameter. \end{itemize}

The result of the function is a data structure with all the requested information as follows.