Changes between Version 30 and Version 31 of udg/ecoms/RPackage/examples


Ignore:
Timestamp:
May 25, 2013 12:35:28 PM (8 years ago)
Author:
juaco
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • udg/ecoms/RPackage/examples

    v30 v31  
    470470
    471471Note that in this particular case, we are loading standard variables, as defined in the vocabulary (by setting the argument `standard.vars = TRUE`), but we did not specify a path to the dictionary (default to `NULL`). By default, the function searches the dictionary in the same directory where the ''ncml'' file has been created, assuming that this is a file with extension ''.dic'' and the same name as the ''ncml''.
     472
     473
     474The function `loadGCM` allows the retrieval of rectangular windows as well as single point locations. In the last case, the function finds the closest grid point to the given coordinates, as previously described in the example of `loadSeasonalForecast`. In the following lines we extract the time series of the Spanish cities used in the previous examples:
     475
     476{{{
     477> t850.ncep.santander <- loadGCM(dataset = "./datasets/reanalysis/Iberia_NCEP/Iberia_NCEP.ncml", standard.vars=TRUE,
     478+                            var="ta", lonLim = -3.81, latLim = 43.43, level=850, season=1, years=1990:1999)
     479> t850.ncep.madrid <- loadGCM(dataset = "./datasets/reanalysis/Iberia_NCEP/Iberia_NCEP.ncml", standard.vars=TRUE,
     480+                               var="ta", lonLim = -3.68, latLim = 40.40, level=850, season=1, years=1990:1999)
     481>
     482> ylimits <- c(floor(min(t850.ncep.madrid$Data)), ceiling(max(t850.ncep.santander$Data)))
     483> plot(t850.ncep.santander$Data, ty='n', axes=FALSE, ylab="degC", xlab="Year", ylim = ylimits)
     484> axis(1,at = seq(1,31*11,31), labels=c(1990:1999,""))
     485> axis(2, ylim=ylimits)
     486> abline(v=seq(1,31*10,31), lty=2)
     487> lines(t850.ncep.santander$Data, ty='l')
     488> lines(t850.ncep.madrid$Data, col = "red")
     489> legend("bottomleft", city.names, lty=1, col=1:4)
     490> title(main = "Mean Temperature January 850mb")
     491> mtext("NCEP reanalysis")
     492
     493}}}
     494