Learn R Programming

DWBmodelUN (version 1.0.0)

upForcing: Upload Forcings

Description

This function loads the precipitation and evapotranspiration estimates that will be used to run or force the DWB model (DWBCalculator). If files are in raster format, it saves a variable cointaining the inputs in table format.

Usage

upForcing(
  path_p = tempdir(),
  path_pet = tempdir(),
  file_type = "raster",
  format = "GTiff"
)

Arguments

path_p

is a character string that specifies the directory where the precipitation rasters or the csv file are stored. The csv file must have nrows = N<U+00B0> of cells and ncol= N<U+00B0> of time steps.

path_pet

is a character string that specifies the location of the potential evapotranspiration rasters or the csv file are stored. The csv file must have nrows= N<U+00B0> of cells and ncol= N<U+00B0> of time steps.

file_type

Character string that specifies the forcing file formats, it should be "raster" or "csv", the default value is "raster".

format

Character string that specifies the format file of the Rasters, possible values are "GTiff" and "NetCDF". Default value is "GTiff".

Value

a list containing the two objects (P and PET).

Details

The character strings that control the location of the forcing files are as default "./precip/" and "./pet/" for precipitation and potential evapotranspiration, but can be change to other directories. However, if one's intention is to upload them from NetCDF files, the strings must be completely changed to a complete path that includes the name and extension of the file.