Version 5 (modified by juaco, 8 years ago) (diff) |
---|
Single point selection
The following call to loadECOMS will load a time series of surface (2m) instantaneous temperature (var = "tas", as defined in the [wiki vocabulary])at 12:00 for the coordinate -3.7E 40.4N, (lonLim = -3.7, latLim = 40.4) corresponding to the city of Madrid (Spain), corresponding to the summer (JJA, season = 6:8) of 2001 (years = 2001) as forecasted the previous March (leadMonth = 2) by the CFSv2 hindcast (dataset = "CFSv2_seasonal_16"). We will select the first 10 members (members = 1:10):
> ex.point <- loadECOMS(dataset = "CFSv2_seasonal_16", var = "tas", members = 1:10, lonLim = -3.7, latLim = 40.4, season = 6:8, years = 2001, leadMonth = 2, time = "12") [2014-06-17 12:08:27] Defining homogeneization parameters for variable "tas" [2014-06-17 12:08:27] Defining geo-location parameters [2014-06-17 12:08:27] Defining initialization time parameters [2014-06-17 12:08:31] Retrieving data subset ... [2014-06-17 12:09:11] Done > print(object.size(ex.point)) 32088 bytes
The returned object contains all the necessary information for data representation (geo-location, time ...). In the next lines we plot the loaded time series for each member. The element Data contains the data itself. In this case, it is a 2D array with the dimensions time (92 days for June, July and August) and member (10 members selected), as indicated by the dimensions attribute:
> str(ex.point$Data) num [1:92, 1:10] 19.7 24.4 24.4 24.5 26.6 ... - attr(*, "dimensions")= chr [1:2] "time" "member"
In the following example we plot the time series with the multi-member mean and its dispersion (interquartilic range 25-75):
> quartiles <- apply(ex.point$Data, MARGIN = 1, FUN = quantile, probs = c(.25,.75)) > ens.mean <- rowMeans(ex.point$Data) > dates <- ex.point$Dates$start > plot(dates, ens.mean, ylim = range(ex.point$Data), ty = 'n', ylab = "tas - 12UTC", xlab = "time") > polygon(x = c(dates, rev(dates)), y = c(quartiles[1, ], rev(quartiles[2, ])), border = "transparent", col = rgb(0,0,1,.4)) > lines(dates, ens.mean)
Attachments (1)
- image-20150515-121332.png (27.3 KB) - added by juaco 7 years ago.
Download all attachments as: .zip