CST_PeriodPET {CSIndicators} | R Documentation |
Compute the Potential Evapotranspiration
Description
Compute the Potential evapotranspiration (PET) that is the amount of evaporation and transpiration that would occur if a sufficient water source were available. This function calculate PET according to the Thornthwaite, Hargreaves or Hargreaves-modified equations.
Usage
CST_PeriodPET(
data,
pet_method = "hargreaves",
time_dim = "syear",
leadtime_dim = "time",
lat_dim = "latitude",
na.rm = FALSE,
ncores = NULL
)
Arguments
data |
A named list with the needed |
pet_method |
A character string indicating the method used to compute the potential evapotranspiration. The accepted methods are: 'hargreaves' and 'hargreaves_modified', that require the data to have variables tmin and tmax; and 'thornthwaite', that requires variable 'tmean'. |
time_dim |
A character string indicating the name of the temporal dimension. By default, it is set to 'syear'. |
leadtime_dim |
A character string indicating the name of the temporal dimension. By default, it is set to 'time'. |
lat_dim |
A character string indicating the name of the latitudinal dimension. By default it is set by 'latitude'. |
na.rm |
A logical value indicating whether NA values should be removed from data. It is FALSE by default. |
ncores |
An integer value indicating the number of cores to use in parallel computation. |
Details
This function is build to be compatible with other tools in that work with 's2dv_cube' object class. The input data must be this object class. If you don't work with 's2dv_cube', see PeriodPET. For more information on the SPEI calculation, see functions CST_PeriodStandardization and CST_PeriodAccumulation.
Examples
dims <- c(time = 3, syear = 3, ensemble = 1, latitude = 1)
exp_tasmax <- array(rnorm(360, 27.73, 5.26), dim = dims)
exp_tasmin <- array(rnorm(360, 14.83, 3.86), dim = dims)
exp_prlr <- array(rnorm(360, 21.19, 25.64), dim = dims)
end_year <- 2012
dates_exp <- as.POSIXct(c(paste0(2010:end_year, "-08-16"),
paste0(2010:end_year, "-09-15"),
paste0(2010:end_year, "-10-16")), "UTC")
dim(dates_exp) <- c(syear = 3, time = 3)
lat <- c(40)
exp1 <- list('tmax' = exp_tasmax, 'tmin' = exp_tasmin, 'pr' = exp_prlr)
res <- PeriodPET(data = exp1, lat = lat, dates = dates_exp)