Run rosetta() method from Python module

# S3 method for default
run_rosetta(soildata, vars = NULL, rosetta_version = 3, ...)

# S3 method for data.frame
run_rosetta(soildata, vars = NULL, rosetta_version = 3, ...)

# S3 method for matrix
run_rosetta(soildata, vars = NULL, rosetta_version = 3, ...)

# S3 method for RasterStack
run_rosetta(
  soildata,
  vars = NULL,
  rosetta_version = 3,
  cores = 1,
  core_thresh = 20000L,
  file = paste0(tempfile(), ".tif"),
  nrows = nrow(soildata)/(terra::ncell(soildata)/core_thresh),
  overwrite = TRUE
)

# S3 method for RasterBrick
run_rosetta(
  soildata,
  vars = NULL,
  rosetta_version = 3,
  cores = 1,
  core_thresh = 20000L,
  file = paste0(tempfile(), ".tif"),
  nrows = nrow(soildata)/(terra::ncell(soildata)/core_thresh),
  overwrite = TRUE
)

# S3 method for SpatRaster
run_rosetta(
  soildata,
  vars = NULL,
  rosetta_version = 3,
  cores = 1,
  core_thresh = 20000L,
  file = paste0(tempfile(), ".tif"),
  nrows = nrow(soildata)/(terra::ncell(soildata)/core_thresh),
  overwrite = TRUE
)

Arguments

soildata

A list of numeric vectors each containing 3 to 6 values: "sand", "silt", "clay", "bulkdensity", "th33", "th1500", a data.frame or matrix with 3 to 6 columns OR a Raster*/SpatRaster object with 3 to 6 layers.

vars

character. Optional: names and order of custom column names if soildata is a data.frame, RasterStack, RasterBrick or SpatRaster. Default NULL assumes input column order follows sand, silt, clay, bulkdensity, th33, th1500 and does not check names.

rosetta_version

Default: 3

...

additional arguments not used

cores

number of cores; used only for processing SpatRaster or Raster* input

core_thresh

Magic number for determining processing chunk size. Default 20000L. Used to calculate default nrows

file

path to write incremental raster processing output for large inputs that do not fit in memory; passed to terra::writeStart() and used only for processing SpatRaster or Raster* input; defaults to a temporary file created by tempfile() if needed

nrows

number of rows to use per block chunk; passed to terra::readValues() and terra::writeValues(); used only for processing SpatRaster or Raster* inputs. Defaults to the total number of rows divided by the number of cells divided by core_thresh.

overwrite

logical; overwrite file? passed to terra::writeStart(); defaults to TRUE if needed

Value

A data.frame containing mean and stdev for following five columns (parameters for van Genuchten-Mualem equation)

  • "theta_r", residual water content

  • "theta_s", saturated water content

  • "log10(alpha)", 'alpha' shape parameter, log10(1/cm)

  • "log10(npar)", 'n' shape parameter

  • "log10(Ksat)", saturated hydraulic conductivity, log10(cm/day)