# \dontshow{
startDates <- c('19851101', '19901101', '19951101', '20001101', '20051101')
sampleData <- s2dv:::.LoadSampleData('tos', c('experiment'),
c('observation'), startDates,
leadtimemin = 1,
leadtimemax = 4,
output = 'lonlat',
latmin = 27, latmax = 48,
lonmin = -12, lonmax = 40)
# }
ano <- Ano_CrossValid(sampleData$mod, sampleData$obs)
eof_exp <- EOF(ano$exp, sampleData$lat, sampleData$lon)
eof_obs <- EOF(ano$obs, sampleData$lat, sampleData$lon)
mode1_exp <- ProjectField(ano$exp, eof_exp, mode = 1)
mode1_obs <- ProjectField(ano$obs, eof_obs, mode = 1)
if (FALSE) {
# Plot the forecast and the observation of the first mode for the last year
# of forecast
sdate_dim_length <- dim(mode1_obs)['sdate']
plot(mode1_obs[sdate_dim_length, 1, 1, ], type = "l", ylim = c(-1, 1),
lwd = 2)
for (i in 1:dim(mode1_exp)['member']) {
par(new = TRUE)
plot(mode1_exp[sdate_dim_length, 1, i, ], type = "l", col = rainbow(10)[i],
ylim = c(-15000, 15000))
}
}
Run the code above in your browser using DataLab