diff --git a/R/sample_data.R b/R/sample_data.R index 2470f0d16e9bf15e41428b3e42a5111804ec6b2e..cb8d5f54f6aacad42d320a72538c397be800d6b0 100644 --- a/R/sample_data.R +++ b/R/sample_data.R @@ -1,6 +1,14 @@ -#' Sample Of Experimental And Observational Climate Data In Function Of Longitudes And Latitudes +#'Sample Of Experimental And Observational Climate Data In Function Of Longitudes And Latitudes #' -#' This sample data set contains gridded seasonal forecast and corresponding observational data from the Copernicus Climate Change ECMWF-System 5 forecast system, and from the Copernicus Climate Change ERA-5 reconstruction. Specifically, for the 'tas' (2-meter temperature) variable, for the 15 first forecast ensemble members, monthly averaged, for the 3 first forecast time steps (lead months 1 to 4) of the November start dates of 2000 to 2005, for the Mediterranean region (27N-48N, 12W-40E). The data was generated on (or interpolated onto, for the reconstruction) a rectangular regular grid of size 360 by 181. +#'This sample data set contains gridded seasonal forecast and corresponding +#'observational data from the Copernicus Climate Change ECMWF-System 5 forecast +#'system, and from the Copernicus Climate Change ERA-5 reconstruction. +#'Specifically, for the 'tas' (2-meter temperature) variable, for the 15 first +#'forecast ensemble members, monthly averaged, for the 3 first forecast time +#'steps (lead months 1 to 4) of the November start dates of 2000 to 2005, for +#'the Mediterranean region (27N-48N, 12W-40E). The data was generated on (or +#'interpolated onto, for the reconstruction) a rectangular regular grid of size +#'360 by 181. #' #' It is recommended to use the data set as follows: #'\preformatted{ @@ -8,7 +16,11 @@ #' c(exp, obs) %<-% CSTools::lonlat_temp #'} #' -#' The `CST_Load` call used to generate the data set in the infrastructure of the Earth Sciences Department of the Barcelona Supercomputing Center is shown next. Note that `CST_Load` internally calls `s2dv::Load`, which would require a configuration file (not provided here) expressing the distribution of the 'system5c3s' and 'era5' NetCDF files in the file system. +#'The `CST_Load` call used to generate the data set in the infrastructure of +#'the Earth Sciences Department of the Barcelona Supercomputing Center is shown +#'next. Note that `CST_Load` internally calls `s2dv::Load`, which would require +#'a configuration file (not provided here) expressing the distribution of the +#''system5c3s' and 'era5' NetCDF files in the file system. #'\preformatted{ #' library(CSTools) #' require(zeallot) @@ -37,29 +49,39 @@ #' @keywords data NULL -#' Sample Of Experimental Precipitation Data In Function Of Longitudes And Latitudes +#'Sample Of Experimental Precipitation Data In Function Of Longitudes And Latitudes #' -#' This sample data set contains a small cutout of gridded seasonal precipitation forecast data from the Copernicus Climate Change ECMWF-System 5 forecast system, to be used to demonstrate downscaling. Specifically, for the 'pr' (precipitation) variable, for the first 6 forecast ensemble members, daily values, for all 31 days in March following the forecast starting dates in November of years 2010 to 2012, for a small 4x4 pixel cutout in a region in the North-Western Italian Alps (44N-47N, 6E-9E). The data resolution is 1 degree. +#'This sample data set contains a small cutout of gridded seasonal precipitation +#'forecast data from the Copernicus Climate Change ECMWF-System 5 forecast +#'system, to be used to demonstrate downscaling. Specifically, for the 'pr' +#'(precipitation) variable, for the first 6 forecast ensemble members, daily +#'values, for all 31 days in March following the forecast starting dates in +#'November of years 2010 to 2012, for a small 4x4 pixel cutout in a region in +#'the North-Western Italian Alps (44N-47N, 6E-9E). The data resolution is 1 +#'degree. #' -#' The `CST_Load` call used to generate the data set in the infrastructure of the Marconi machine at CINECA is shown next, working on files which were extracted from forecast data available in the MEDSCOPE internal archive. +#'The `CST_Load` call used to generate the data set in the infrastructure of +#'the Marconi machine at CINECA is shown next, working on files which were +#'extracted from forecast data available in the MEDSCOPE internal archive. #' #'\preformatted{ #' library(CSTools) -#' -#' infile <- list(path = '../medscope/nwalps/data/$VAR_NAME$_$START_DATE$_nwalps.nc') +#' infile <- list(path = paste0('/esarchive/exp/ecmwf/system5c3s/daily_mean/', +#' '$VAR_NAME$_s0-24h/$VAR_NAME$_$START_DATE$.nc')) #' lonlat_prec <- CST_Load('prlr', exp = list(infile), obs = NULL, #' sdates = c('20101101', '20111101', '20121101'), #' leadtimemin = 121, leadtimemax = 151, #' latmin = 44, latmax = 47, -#' lonmin = 5, lonmax = 9, -#' nmember = 25, +#' lonmin = 6, lonmax = 9, +#' nmember = 6, #' storefreq = "daily", sampleperiod = 1, #' output = "lonlat" -#' )$exp +#' ) #'} #' #' @name lonlat_prec #' @docType data #' @author Jost von Hardenberg \email{j.vonhardenberg@isac.cnr.it} +#' @author An-Chi Ho \email{an.ho@bsc.es} #' @keywords data NULL diff --git a/data/lonlat_prec.RData b/data/lonlat_prec.RData deleted file mode 100644 index dde1f84658006c0255768b22f8dade776255e479..0000000000000000000000000000000000000000 Binary files a/data/lonlat_prec.RData and /dev/null differ diff --git a/data/lonlat_prec.rda b/data/lonlat_prec.rda new file mode 100644 index 0000000000000000000000000000000000000000..4c566a4af69dd006258e6e9901aa24f6b8d162dc Binary files /dev/null and b/data/lonlat_prec.rda differ diff --git a/man/lonlat_prec.Rd b/man/lonlat_prec.Rd index 345e3cabfe965dd9813f92a38393d67b06090003..3c66f2bcf1d99b617d445f0e7e957bf99d0dc1e0 100644 --- a/man/lonlat_prec.Rd +++ b/man/lonlat_prec.Rd @@ -5,27 +5,38 @@ \alias{lonlat_prec} \title{Sample Of Experimental Precipitation Data In Function Of Longitudes And Latitudes} \description{ -This sample data set contains a small cutout of gridded seasonal precipitation forecast data from the Copernicus Climate Change ECMWF-System 5 forecast system, to be used to demonstrate downscaling. Specifically, for the 'pr' (precipitation) variable, for the first 6 forecast ensemble members, daily values, for all 31 days in March following the forecast starting dates in November of years 2010 to 2012, for a small 4x4 pixel cutout in a region in the North-Western Italian Alps (44N-47N, 6E-9E). The data resolution is 1 degree. +This sample data set contains a small cutout of gridded seasonal precipitation +forecast data from the Copernicus Climate Change ECMWF-System 5 forecast +system, to be used to demonstrate downscaling. Specifically, for the 'pr' +(precipitation) variable, for the first 6 forecast ensemble members, daily +values, for all 31 days in March following the forecast starting dates in +November of years 2010 to 2012, for a small 4x4 pixel cutout in a region in +the North-Western Italian Alps (44N-47N, 6E-9E). The data resolution is 1 +degree. } \details{ -The `CST_Load` call used to generate the data set in the infrastructure of the Marconi machine at CINECA is shown next, working on files which were extracted from forecast data available in the MEDSCOPE internal archive. +The `CST_Load` call used to generate the data set in the infrastructure of +the Marconi machine at CINECA is shown next, working on files which were +extracted from forecast data available in the MEDSCOPE internal archive. \preformatted{ library(CSTools) - -infile <- list(path = '../medscope/nwalps/data/$VAR_NAME$_$START_DATE$_nwalps.nc') +infile <- list(path = paste0('/esarchive/exp/ecmwf/system5c3s/daily_mean/', + '$VAR_NAME$_s0-24h/$VAR_NAME$_$START_DATE$.nc')) lonlat_prec <- CST_Load('prlr', exp = list(infile), obs = NULL, sdates = c('20101101', '20111101', '20121101'), leadtimemin = 121, leadtimemax = 151, latmin = 44, latmax = 47, - lonmin = 5, lonmax = 9, - nmember = 25, + lonmin = 6, lonmax = 9, + nmember = 6, storefreq = "daily", sampleperiod = 1, output = "lonlat" - )$exp + ) } } \author{ Jost von Hardenberg \email{j.vonhardenberg@isac.cnr.it} + +An-Chi Ho \email{an.ho@bsc.es} } \keyword{data} diff --git a/man/lonlat_temp.Rd b/man/lonlat_temp.Rd index 703611790b02781401891fb8487b0f433a875691..204e44370333c9e88acd89e7f07c0600996a9c5b 100644 --- a/man/lonlat_temp.Rd +++ b/man/lonlat_temp.Rd @@ -5,7 +5,15 @@ \alias{lonlat_temp} \title{Sample Of Experimental And Observational Climate Data In Function Of Longitudes And Latitudes} \description{ -This sample data set contains gridded seasonal forecast and corresponding observational data from the Copernicus Climate Change ECMWF-System 5 forecast system, and from the Copernicus Climate Change ERA-5 reconstruction. Specifically, for the 'tas' (2-meter temperature) variable, for the 15 first forecast ensemble members, monthly averaged, for the 3 first forecast time steps (lead months 1 to 4) of the November start dates of 2000 to 2005, for the Mediterranean region (27N-48N, 12W-40E). The data was generated on (or interpolated onto, for the reconstruction) a rectangular regular grid of size 360 by 181. +This sample data set contains gridded seasonal forecast and corresponding +observational data from the Copernicus Climate Change ECMWF-System 5 forecast +system, and from the Copernicus Climate Change ERA-5 reconstruction. +Specifically, for the 'tas' (2-meter temperature) variable, for the 15 first +forecast ensemble members, monthly averaged, for the 3 first forecast time +steps (lead months 1 to 4) of the November start dates of 2000 to 2005, for +the Mediterranean region (27N-48N, 12W-40E). The data was generated on (or +interpolated onto, for the reconstruction) a rectangular regular grid of size +360 by 181. } \details{ It is recommended to use the data set as follows: @@ -14,7 +22,11 @@ require(zeallot) c(exp, obs) %<-% CSTools::lonlat_temp } -The `CST_Load` call used to generate the data set in the infrastructure of the Earth Sciences Department of the Barcelona Supercomputing Center is shown next. Note that `CST_Load` internally calls `s2dv::Load`, which would require a configuration file (not provided here) expressing the distribution of the 'system5c3s' and 'era5' NetCDF files in the file system. +The `CST_Load` call used to generate the data set in the infrastructure of +the Earth Sciences Department of the Barcelona Supercomputing Center is shown +next. Note that `CST_Load` internally calls `s2dv::Load`, which would require +a configuration file (not provided here) expressing the distribution of the +'system5c3s' and 'era5' NetCDF files in the file system. \preformatted{ library(CSTools) require(zeallot) diff --git a/vignettes/Figures/RainFARM_fig1.png b/vignettes/Figures/RainFARM_fig1.png index 8c61d083990ba9b4c27eff4c90b4fade4c81ff71..9c80d8fb80e3e6fc05af907ccf811193e6e7ae59 100644 Binary files a/vignettes/Figures/RainFARM_fig1.png and b/vignettes/Figures/RainFARM_fig1.png differ diff --git a/vignettes/RainFARM_vignette.Rmd b/vignettes/RainFARM_vignette.Rmd index c47d0e73b8f03936345e0da19c38630fc0badf06..5fe249f3ab7888babb68c592df3d41a1d460f7dd 100644 --- a/vignettes/RainFARM_vignette.Rmd +++ b/vignettes/RainFARM_vignette.Rmd @@ -66,7 +66,7 @@ RainFARM can compute automatically its only free parameter, i.e. the spatial spe In this example we would like to compute this slope as an average over the _member_ and _ftime_ dimensions, while we will use different slopes for the remaining _dataset_ and _sdate_ dimensions (a different choice may be more appropriate in a real application). To obtain this we specify the parameter `time_dim = c("member", "ftime")`. The slope is computed starting from the wavenumber corresponding to the box, `kmin=1`. We create 3 stochastic realizations for each dataset, member, starting date and forecast time with `nens=5`. The command to donwscale and the resulting fields are: ```{r} -exp_down <- CST_RainFARM(exp, nf=20, kmin = 1, nens = 3, +exp_down <- CST_RainFARM(exp, nf = 20, kmin = 1, nens = 3, time_dim = c("member", "ftime")) dim(exp_down$data) @@ -179,8 +179,8 @@ dim(slopes) # dataset sdate # 1 3 slopes -# [,1] [,2] [,3] -#[1,] 1.532351 1.664028 1.459252 + [,1] [,2] [,3] +[1,] 1.09958 1.768862 1.190185 ``` which return an array of spectral slopes, one for each "dataset" and starting date "sdate".