WikiPrint - from Polar Technologies

The SPECS-EUPORIAS Data Portal can be remotely accessed from R via the ?loadSystem4.R function. Note that this function is part of a more comprehensive R package currently under development. This function automatically cares about the proper location of the right indices for data sub-setting across the different variable dimensions, given a few simple arguments for subset definition. In addition, instead of retrieving a NetCDF file that needs to be opened and read, the requested data is directly loaded into the current R working session, according to a particular structure described below, prior to data analysis and/or representation.

In order to explain the loadSystem4 function, in the next lines we describe an illustrative example considering 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, or in the section Examples.

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 arguments of the function are the next described:

Short NameDataset variable
tasmax Maximum temperature at 2 metres since last 24 hours surface
tasmin Minimum temperature at 2 metres since last 24 hours surface
tas Mean temperature at 2 metres since last 24 hours surface
pr Total precipitation surface
mslp Mean sea level pressure surface

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

> str(openDAP.query)
List of 4
 $ MemberData   :List of 1
  ..$ : num [1:930, 1:1600] 275 277 278 279 277 ...
 $ Coordinates  : num [1:1600, 1:2] 64.5 63.7 63 62.2 61.5 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : NULL
  .. ..$ : chr [1:2] "lat" "lon"
 $ RunDates     : POSIXlt[1:30], format: "1981-12-01" "1982-12-01" "1983-12-01" ...
 $ ForecastDates: Date[1:930], format: "1982-01-01" "1982-01-02" "1982-01-03" ...

The output consists of a list with the following 4 elements: