Skip to content
Jorge Baño-Medina edited this page Dec 19, 2019 · 4 revisions

downscaleR.keras: An R package to integrate keras models in the climate4R framework

Introduction

We used as tutorial an example of the manuscript entitled Configuration and Intercomparison of Deep Learning Neural Models for Statistical Downscaling by J. Baño-Medina, R. Manzanas and J. M. Gutiérrez, which has been submitted for discussion to Geoscientific Model Development in September 2019. Througout this example we can learn to use the downscaleR.keras functions in a real case study. In particular, we downscale temperature and precipitation using reanalysis predictors at a resolution of 2º to an observational gridded dataset of 0.5º of resolution. This package is integrated into the climate4R framework and therefore we rely on other climate4R libraries, such as loadeR to load the data.

Loading Data

To load the data we use the loadeR package (link). In particular we download the ERA-Interim reanalysis (predictors) and the E-OBS observed temperature and precipitation (predictands) datasets.

variables <- c("z@500","z@700","z@850","z@1000",
               "hus@500","hus@700","hus@850","hus@1000",
               "ta@500","ta@700","ta@850","ta@1000",
               "ua@500","ua@700","ua@850","ua@1000",
               "va@500","va@700","va@850","va@1000")
x <- lapply(variables, function(x) {
  loadGridData(dataset = "ECMWF_ERA-Interim-ESD",
               var = x,
               lonLim = c(-10,32), # 22 puntos en total
               latLim = c(36,72),  # 19 puntos en total
               years = 1979:2008)
}) %>% makeMultiGrid()

y <- loadGridData(dataset = "E-OBS_v14_0.50regular",
                  var = "pr",lonLim = c(-10,32),
                  latLim = c(36,72), 
                  years = 1979:2008)
Clone this wiki locally