Learn R Programming

evapoRe (version 1.0.1)

pet: Potential Evapotranspiration

Description

The function pet estimates PET using various methods.

Usage

pet(method = "oudin", ...)

Value

A `Raster*` object in mm/day (if raster-based inputs) or a `data.table` with columns lon, lat, date, and value (PET in mm/day).

Arguments

method

Character string indicating the PET estimation method. Available options include:

  • "abtew" — Abtew (1996)

  • "baier_robertson" — Baier and Robertson (1965)

  • "blaney_criddle" — Blaney and Criddle (1950)

  • "hamon" — Hamon (1961)

  • "hargreaves_samani" — Hargreaves and Samani (1985)

  • "jensen_haise" — Jensen and Haise (1963)

  • "mcguinness_bordne" — McGuinness and Bordne (1972)

  • "oudin" — Oudin (2005). Default

  • "penman_monteith_f56" — FAO Penman-Monteith (FAO-56)

  • "priestly_taylor" — Priestly and Taylor (1972)

  • "thornthwaite" — Thornthwaite (1948)

  • "turc" — Turc (1961)

...

Inputs passed to the selected method. These can be:

  • A single Raster* object, file path, or data.table — for methods requiring one variable (e.g., oudin);

  • Named arguments (e.g., tavg = ..., tmax = ...) — for multi-variable methods;

  • A data.table with all required variables — passed as x = your_data.

Details

For single-input methods (e.g., Oudin), you can pass the input directly. For multi-input methods (e.g., Penman-Monteith), use named arguments or a data.table. Use pet_method_requirements() to check required variables.

Examples

Run this code
# \donttest{
# Oudin method with NetCDF path
tavg_path <- file.path(tempdir(), "tavg.nc")
if (file.exists(tavg_path)) {
  pet_od <- pet(method = "oudin", x = tavg_path)
  pet_od <- muldpm(pet_od)
}

# Oudin method with raster
if (requireNamespace("raster", quietly = TRUE)) {
  if (file.exists(tavg_path)) {
    tavg <- raster::brick(tavg_path)
    pet_od <- pet("oudin", tavg)
    pet_od <- muldpm(pet_od)
  }
}

# Oudin method with data.table
if (requireNamespace("data.table", quietly = TRUE)) {
  dt <- data.table::data.table(
    lon = c(10.0, 10.5),
    lat = c(45.0, 45.5),
    date = as.Date(c("2001-06-01", "2001-06-02")),
    tavg = c(18.5, 19.2)
  )
  pet_od <- pet(method = "oudin", x = dt)
  pet_od <- muldpm(pet_od)
}

# Hargreaves-Samani method with multiple raster inputs
tmax_path <- file.path(tempdir(), "tmax.nc")
tmin_path <- file.path(tempdir(), "tmin.nc")
if (requireNamespace("raster", quietly = TRUE)) {
  if (file.exists(tavg_path) && file.exists(tmax_path) && file.exists(tmin_path)) {
    tavg <- raster::brick(tavg_path)
    tmax <- raster::brick(tmax_path)
    tmin <- raster::brick(tmin_path)
    pet_hs <- pet(method = "hargreaves_samani", tavg = tavg, tmin = tmin, tmax = tmax)
    pet_hs <- muldpm(pet_hs)
  }
}
# }

Run the code above in your browser using DataLab