diff --git a/DESCRIPTION b/DESCRIPTION index f1a9778c8fcd0d67ab57e621d3ba8a52351ed19c..62087d9efb74bcdb0a355b312a340d6566ef7eb5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,7 +27,7 @@ Imports: multiApply (>= 2.1.1), parallel, easyNCDF, - s2dverification, + s2dv, ClimProjDiags, PCICt Suggests: diff --git a/NAMESPACE b/NAMESPACE index ccf783cbe12b94f8b703a403b9cf16f4be0ff870..1375d83968e48c525cfdd4f0fb8e84f1b2dfbe1e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -24,7 +24,7 @@ import(future) import(multiApply) import(parallel) importFrom(ClimProjDiags,Subset) -importFrom(s2dverification,CDORemap) +importFrom(s2dv,CDORemap) importFrom(stats,na.omit) importFrom(stats,setNames) importFrom(utils,str) diff --git a/R/CDORemapper.R b/R/CDORemapper.R index 8aed954be45da45d9824b60a03f4b3503265aa68..8e2a468515f13ea9a4642099b7caebc17c5f178e 100644 --- a/R/CDORemapper.R +++ b/R/CDORemapper.R @@ -5,7 +5,7 @@ #''transform' in a Start() call. This function complies with the input/output #'interface required by Start() defined in the documentation for the parameter #''transform' of function Start().\cr\cr -#'This function uses the function CDORemap() in the package 's2dverification' to +#'This function uses the function CDORemap() in the package 's2dv' to #'perform the interpolation, hence CDO is required to be installed. #' #'@param data_array A data array to be transformed. See details in the @@ -24,7 +24,7 @@ #' potentially with different sizes, and potentially with the attribute #' 'variables' with additional auxiliary data. See details in the documentation #' of the parameter 'transform' of the function Start(). -#'@seealso \code{\link[s2dverification]{CDORemap}} +#'@seealso \code{\link[s2dv]{CDORemap}} #' #'@examples #'# Used in Start(): @@ -50,7 +50,7 @@ #' time = 'sdate'), #' retrieve = FALSE) #' } -#'@importFrom s2dverification CDORemap +#'@importFrom s2dv CDORemap #'@export CDORemapper <- function(data_array, variables, file_selectors = NULL, ...) { file_dims <- names(file_selectors) @@ -93,7 +93,7 @@ CDORemapper <- function(data_array, variables, file_selectors = NULL, ...) { stop("Parameters 'grid', 'method' and 'crop' must be specified for the ", "CDORemapper, via the 'transform_params' argument.") } - result <- s2dverification::CDORemap(data_array, lons, lats, ...) + result <- s2dv::CDORemap(data_array, lons, lats, ...) return_variables <- list(result$lons, result$lats) names(return_variables) <- c(lon_name, lat_name) list(data_array = result$data_array, variables = return_variables) diff --git a/inst/doc/usecase.md b/inst/doc/usecase.md index 013b47a3c159be2931b3b2c24b47857f2e254525..e0cf5e17d6063ec8903da29a6581a2bf0efcc598 100644 --- a/inst/doc/usecase.md +++ b/inst/doc/usecase.md @@ -70,12 +70,12 @@ this use case is for two file dimensions (i.e., the usage of *_depends). 2. [Function using attributes of the data](inst/doc/usecase/ex2_2_attr.R) Using attributes is only available in startR_v0.1.3 or above. 3. [Use function CDORemap for interpolation](inst/doc/usecase/ex2_3_cdo.R) - Using parameter `CDO_module` is only available in startR_v0.1.3 or above. Interpolate data by using `s2dverification::CDORemap` in the workflow. + Using parameter `CDO_module` is only available in startR_v0.1.3 or above. Interpolate data by using `s2dv::CDORemap` in the workflow. 4. [Use two functions in workflow](inst/doc/usecase/ex2_4_two_func.R) 5. 6. [Use external parameters in atomic function](inst/doc/usecase/ex2_6_ext_param_func.R) 7. [Calculate the ensemble-adjusted Continuous Ranked Probability Score (CRPS)](inst/doc/usecase/ex2_7_seasonal_forecast_crps.R) - Use `SpecsVerification::EnsCrps` to calculate the ensemble-adjusted Continuous Ranked Probability Score (CRPS) for ECWMF experimental data, and do ensemble mean. Use `s2dverification::PlotEquiMap` to plot the CRPS map. + Use `SpecsVerification::EnsCrps` to calculate the ensemble-adjusted Continuous Ranked Probability Score (CRPS) for ECWMF experimental data, and do ensemble mean. Use `s2dv::PlotEquiMap` to plot the CRPS map. 8. [Use CSTools Calibration function](inst/doc/usecase/ex2_8_calibration.R) Use `CSTools:::.cal`, the interior function of `CSTools::CST_Calibration`, to do the bias adjustment for ECMWF experimental monthly mean data. 9. [Use a mask to apply different methods to different gridpoints](inst/doc/usecase/ex2_9_mask.R) diff --git a/inst/doc/usecase/ex1_1_tranform.R b/inst/doc/usecase/ex1_1_tranform.R index c805b45d8678ddc20b334c3b7f222498b19a0953..a544f84c96005aea28ae6f99f3e61fc5b2fc9c88 100644 --- a/inst/doc/usecase/ex1_1_tranform.R +++ b/inst/doc/usecase/ex1_1_tranform.R @@ -1,12 +1,12 @@ # ------------------------------------------------------------------ # This script shows you how to do the interpolation in Start(). It also -# uses s2dverification::Load to compare the results, which are identical +# uses s2dv::Load to compare the results, which are identical # (only tiny difference due to round-up). # # The parameters in Start() for interpolation include 'transform', # 'transform_extra_cells', 'transform_params', and 'transform_vars'. # 'transform' is the interpolation function. startR provides 'CDORemapper', -# which is the wrapper function of s2dverification::CDORemap. +# which is the wrapper function of s2dv::CDORemap. # 'transform_extra_cells' defines the extra grid points you want to use for # interpolation. The default value is 2. 'transform_params' is a list which # defines the arguments used in 'cdo'. 'transform_vars' is a vector indicating @@ -65,9 +65,9 @@ obs[1,1,1,1,1:3,1:2] #------------------------- -# s2dverification::Load() +# s2dv::Load() #------------------------- -library(s2dverification) +library(s2dv) pobs <- paste0('/esarchive/recon/ecmwf/era5/monthly_mean/', '$VAR_NAME$_f1h/$VAR_NAME$_$YEAR$$MONTH$.nc') diff --git a/inst/doc/usecase/ex2_3_cdo.R b/inst/doc/usecase/ex2_3_cdo.R index 0262de38a50ee259196d275abfe4ddef56d940bb..8c398f7ca5b33b2a079cd92561a167b57ef0b0a8 100644 --- a/inst/doc/usecase/ex2_3_cdo.R +++ b/inst/doc/usecase/ex2_3_cdo.R @@ -1,5 +1,5 @@ # -------------------------------------------------------------- -# Function doing regridding CDO (e.g.: s2dverification::CDORemap) +# Function doing regridding CDO (e.g.: s2dv::CDORemap) #--------------------------------------------------------------- library(startR) repos <- '/esarchive/exp/ecmwf/system5_m1/monthly_mean/$var$_f6h/$var$_$sdate$.nc' @@ -18,8 +18,8 @@ library(startR) lons_data = as.vector(attr(x, 'Variables')$dat1$longitude) lats_data = as.vector(attr(x, 'Variables')$dat1$latitude) resgrid = "r360x180" # prlr - r <- s2dverification::CDORemap(x, lons_data, lats_data, resgrid, - 'bil', crop = FALSE, force_remap = TRUE)[[1]] + r <- s2dv::CDORemap(x, lons_data, lats_data, resgrid, + 'bil', crop = FALSE, force_remap = TRUE)[[1]] return(r) } diff --git a/inst/doc/usecase/ex2_4_two_func.R b/inst/doc/usecase/ex2_4_two_func.R index d4d1b5f14a6f1eb2a162f2becd80f50c06b1a559..2e638bd60ea6d3f90b7ff2cca385e9f89d7d587e 100644 --- a/inst/doc/usecase/ex2_4_two_func.R +++ b/inst/doc/usecase/ex2_4_two_func.R @@ -1,5 +1,5 @@ # -------------------------------------------------------------- -# Two functions (e.g.: s2dverification::CDORemap and Season) +# Two functions (e.g.: s2dv::CDORemap and Season) #--------------------------------------------------------------- library(startR) repos <- '/esarchive/exp/ecmwf/system5_m1/monthly_mean/$var$_f6h/$var$_$sdate$.nc' diff --git a/inst/doc/usecase/ex2_7_seasonal_forecast_verification.R b/inst/doc/usecase/ex2_7_seasonal_forecast_verification.R index 8b746071ecff79ef898695fffb2c499ac4fa948d..b28e6a6d88b0a65ff4890e78a0018791f010ebca 100644 --- a/inst/doc/usecase/ex2_7_seasonal_forecast_verification.R +++ b/inst/doc/usecase/ex2_7_seasonal_forecast_verification.R @@ -104,7 +104,7 @@ # Plotting -library(s2dverification) +library(s2dv) lon <- seq(from = 0, to = 359, length.out = 512) lat <- seq(from = 90, to = -90, length.out = 256) diff --git a/man/CDORemapper.Rd b/man/CDORemapper.Rd index 763be7708c73e0be54b1edcc7e7d8b9d1aeebda4..3f4238ad950c9d7e2405aec440af50842ad3f358 100644 --- a/man/CDORemapper.Rd +++ b/man/CDORemapper.Rd @@ -34,7 +34,7 @@ data subsets onto a specified target grid, intended for use as parameter 'transform' in a Start() call. This function complies with the input/output interface required by Start() defined in the documentation for the parameter 'transform' of function Start().\cr\cr -This function uses the function CDORemap() in the package 's2dverification' to +This function uses the function CDORemap() in the package 's2dv' to perform the interpolation, hence CDO is required to be installed. } \examples{ @@ -63,5 +63,5 @@ perform the interpolation, hence CDO is required to be installed. } } \seealso{ -\code{\link[s2dverification]{CDORemap}} +\code{\link[s2dv]{CDORemap}} } diff --git a/tests/testthat/test-Compute-CDORemap.R b/tests/testthat/test-Compute-CDORemap.R index 991e7e1e12d308fb75be27863a4b274ce6c7ba40..28df2340a6883b72a9a859ca783791a7740c7ee3 100644 --- a/tests/testthat/test-Compute-CDORemap.R +++ b/tests/testthat/test-Compute-CDORemap.R @@ -19,8 +19,8 @@ suppressWarnings( fun <- function(x) { lons_data <- as.vector(attr(x, 'Variables')$dat1$longitude) lats_data <- as.vector(attr(x, 'Variables')$dat1$latitude) - r <- s2dverification::CDORemap(x, lons_data, lats_data, "r360x181", - 'bil', crop = FALSE, force_remap = TRUE)[[1]] + r <- s2dv::CDORemap(x, lons_data, lats_data, "r360x181", + 'bil', crop = FALSE, force_remap = TRUE)[[1]] return(r) } diff --git a/tests/testthat/test-Start-calendar.R b/tests/testthat/test-Start-calendar.R index 11e866d859618d07b8e1cc770d06812241ecb989..4f58a8744cfd69504eceed8883c5b7f3b6a1758e 100644 --- a/tests/testthat/test-Start-calendar.R +++ b/tests/testthat/test-Start-calendar.R @@ -48,7 +48,7 @@ expect_equal( }) test_that("2. 365_day, daily, unit = 'days since 1984-01-01'", { -path_bcc_csm2 <- '/esarchive/exp/CMIP6/dcppA-hindcast/bcc-csm2-mr/cmip6-dcppA-hindcast_i1p1/DCPP/BCC/BCC-CSM2-MR/dcppA-hindcast/r1i1p1f1/day/$var$/gn/v20200114/$var$_day_BCC-CSM2-MR_dcppA-hindcast_s$sdate$-r1i1p1f1_gn_19800101-19891231.nc' +path_bcc_csm2 <- '/esarchive/exp/CMIP6/dcppA-hindcast/bcc-csm2-mr/cmip6-dcppA-hindcast_i1p1/DCPP/BCC/BCC-CSM2-MR/dcppA-hindcast/r1i1p1f1/day/$var$/gn/v20191219/$var$_day_BCC-CSM2-MR_dcppA-hindcast_s$sdate$-r1i1p1f1_gn_19800101-19891231.nc' suppressWarnings( data <- Start(dat = path_bcc_csm2,