Changes between Version 8 and Version 9 of udg/ecoms/RPackage/examples/drift


Ignore:
Timestamp:
Mar 9, 2015 5:28:00 PM (7 years ago)
Author:
juaco
Comment:

--

Legend:

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

    v8 v9  
    11= Analysing model drift in South-western Iberia
    22
    3 In this practice, we will analyse the model drift by using the forecast of daily mean surface temperature for July 2001 considering 6 different forecast (lead) months, from January to June. The lead month 0 (i.e., the initialization of July itself) will be the reference from which we will compute the anomalies. In this example, we will consider the first member of the CFSv2 hindcast.
    4 
     3In this practice, we will analyse the model drift by using the forecast of daily mean (`time = "DD"`) surface temperature (`var = "tas"`) for July (`season = 7`) 2006 (`years = 2006`) considering 6 different forecast (lead) months, from January to June. The lead month 0 (i.e., the initialization of July itself) will be the reference from which we will compute the anomalies (`leadMonth = 0`). In this example, we will consider the first member (`members = 1`) of the CFSv2 hindcast as reference:
    54
    65
    76{{{#!text/R
    8 ref <- loadECOMS(dataset = "CFSv2_seasonal_16", var = "tas", members = 1, lonLim = c(-10,-1), latLim = c(36,40), season = 7, years = 2006, leadMonth = 0, time = "DD")
     7ref <- loadECOMS(dataset = "CFSv2_seasonal_16",
     8                 var = "tas",
     9                 members = 1,
     10                 lonLim = c(-10,-1),
     11                 latLim = c(36,40),
     12                 season = 7,
     13                 years = 2006,
     14                 leadMonth = 0,
     15                 time = "DD")
    916}}}
    1017
     
    3138
    3239
    33 Next, we will load the forecast of the target variable recursively for lead month values from 1 to 6 (i.e., the initializations from January to June). The different objects are arranged in a list:
     40Next, we will load the forecast of the target variable recursively for lead month values from 1 to 6 (i.e.: the initializations from January to June). The different objects are arranged in a list:
    3441
    3542
    3643{{{#!text/R
    3744cfs.list <- lapply(1:6, function(lead.month) {
    38       loadECOMS(dataset = "CFSv2_seasonal_16", var = "tas", members = 1, lonLim = c(-10,-1), latLim = c(36,40), season = 7, years = 2006, leadMonth = lead.month, time = "DD")
    39 })
     45      loadECOMS(dataset = "CFSv2_seasonal_16",
     46                var = "tas",
     47                members = 1,
     48                lonLim = c(-10,-1),
     49                latLim = c(36,40),
     50                season = 7,
     51                years = 2006,
     52                leadMonth = lead.month,
     53                time = "DD")
     54      }
     55)
    4056}}}
    4157
    42 In order to visualize the departures of each lead month from the reference in the same range of values, we will use the `spplot` method for plotting spatial objects of the library `sp`. To this aim, we will first compute the multi-member spatial mean for each lead month forecast, and then we will arrange the data in a matrix of 6 columns (one for each month), and x * y rows, as follows:
     58In order to visualize the departures of each lead month from the reference in the same range of values, we will use the `spplot` method of package `sp` for plotting spatial objects. To this aim, we will first compute the multi-member spatial mean for each lead month forecast, and then we will arrange the data in a matrix of 6 columns (one for each month), and x * y rows, as follows:
    4359
    4460{{{#!text/R
     
    84100load(url("http://meteo.unican.es/work/downscaler/aux/wlines.rda"), verbose = TRUE)
    85101l1 <- list("sp.lines", wlines)
    86 spplot(df, as.table = TRUE, col.regions = colorRampPalette(c("blue","white","red")), at = seq(-5.25,5.25,.25), scales = list(draw = TRUE), sp.layout = list(l1))
     102spplot(df,
     103       as.table = TRUE,
     104       col.regions = colorRampPalette(c("blue","white","red")),
     105       at = seq(-5.25,5.25,.25),
     106       scales = list(draw = TRUE),
     107       sp.layout = list(l1))
    87108}}}
    88109