Changes between Version 12 and Version 13 of udg/ecoms/RPackage/examples/continentalSelection


Ignore:
Timestamp:
Sep 2, 2014 5:22:00 PM (7 years ago)
Author:
juaco
Comment:

--

Legend:

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

    v12 v13  
    3333
    3434
    35 [[Image(image-20140617-130616.png)]]
     35[[Image(image-20140902-170632.png)]]
    3636
    37 It is possible to load now the reference observations for the spatio-temporal domain selected, using the same values in the corresponding arguments:
     37
     38We load now the reference observations for the spatio-temporal domain previously chosen:
     39
    3840
    3941{{{
    4042#!text/R
    4143> ex2.obs <- loadECOMS(dataset = "WFDEI", var = "tasmin", lonLim = c(-15,35), latLim = c(32, 75), season = c(12,1,2), years = 2001:2010)
    42 [2014-06-17 16:28:13] Defining homogeneization parameters for variable "tasmin"
    43 [2014-06-17 16:28:13] Defining geo-location parameters
    44 [2014-06-17 16:28:13] Defining time selection parameters
    45 [2014-06-17 16:28:32] Done
     44[2014-09-02 17:07:43] Defining homogeneization parameters for variable "tasmin"
     45[2014-09-02 17:07:44] Defining geo-location parameters
     46[2014-09-02 17:07:44] Defining time selection parameters
     47[2014-09-02 17:07:44] Retrieving data subset ...
     48[2014-09-02 17:07:58] Done
    4649> print(object.size(ex2.obs), units = "Mb")
    475060.6 Mb
     
    5255{{{
    5356#!text/R
    54 > observed <- apply(ex2.obs$Data, FUN = mean, MARGIN = c(1,2))
    55 > x.obs <- ex2.obs$xyCoords$x
    56 > y.obs <- ex2.obs$xyCoords$y
    57 > image.plot(x.obs, y.obs, observed, asp = 1, xlab = "", ylab = "", main = "Mean minimum surface temp observed")
    58 > world(add=TRUE)
     57> plotMeanField(ex2.obs)
    5958}}}
    6059
    61 [[Image(image-20140617-163609.png)]]
     60[[Image(image-20140902-171138.png)]]
    6261
    63 Note that WFDEI provides data for land areas only, and its spatial resolution is much higher that CFS (1º vs 0.5º). In order to compare both datasets, it is first necessary to put them in the same grid (i.e., to interpolate). We use the bilinear interpolation algorithm of package `fields` to this aim, included in the function `interp.surface.grid`:
     62Note that WFDEI provides data for land areas only, and its spatial resolution is finer than CFS (1º vs 0.5º). In order to compare both datasets, it is first necessary to put them in the same grid (i.e., to interpolate). We use bilinear interpolation to this aim, using the `downscaleR` function `interpGridData` in combination with the `getGrid` method, useful to recover the parameters defining the grid of a dataset to pass them to the interpolator:
    6463
    6564{{{
    6665#!text/R
    67 > obs.regridded <- interp.surface.grid(obj = list(x = x.obs, y = y.obs, z = observed), grid.list = list(x = x, y = y))
    68 > par(mfrow = c(1,2))
    69 > image.plot(member1 - obs.regridded$z, asp = 1, main = "Bias Member 1")
    70 > image.plot(member2 - obs.regridded$z, asp = 1, main = "Bias Member 2")
     66> obs.regridded <- interpGridData(gridData = ex2.obs, new.grid = getGrid(ex2), method = "bilinear")
     67> plotMeanField(obs.regridded)
    7168}}}
    72 
    73 [[Image(image-20140617-170438.png)]]
    7469
    7570
     
    7974
    8075
    81 
    82