Obtains a project raster layer for further analysis.

# S4 method for RPhosFate
getLayer(x, i, j = NULL)

# S4 method for RPhosFate,ANY,ANY,ANY
[(x, i, j)

Arguments

x

An S4 RPhosFate river catchment object.

i

A character string specifying a layer name. Substance related layers whose names start with xx are treated differently. They have to be queried by their name (not filename), for example, "xxc" in combination with "PP" in argument j queries the particulate phosphorus concentrations in top soils. See subdirectory sections for further information.

j

A character string specifying a substance if applicable.

Value

A raster::RasterLayer object.

Input subdirectory

This directory holds all possible user input raster data (flow obstacles like roads must be considered during generation of the flow accumulation layers and also be cut out from them in order to be properly respected):

  • acc: Flow accumulations required for transportCalcOrder.

  • acc_wtd: Weighted flow accumulations required for everything (can be equal to acc).

  • CFa: (R)USLE C-factors required for erosion.

  • cha: Channel cells required for everything (1: channel cell, NA: no channel cell).

  • clc: Clay contents of top soils in % required for substance emissions.

  • dem: Digital elevation model in m a.s.l. (optional).

  • dir: D8 flow directions required for transportPrerequisites and substance transport.

  • fid: Field IDs (optional).

  • KFa: (R)USLE K-factors required for erosion.

  • lue: Land use classes (optional).

  • man: Manning's roughness coefficients required for substance transport.

  • xxc: Substance contents of top soils in mg/kg required for substance emissions, for example, ppc for PP top soil contents.

  • rds: Road cells required for transportPrerequisites (0: road cell without subsurface drainage, 1: road cell with subsurface drainage, NA: no road cell).

  • RFa: (R)USLE R-factors required for erosion.

  • slp: Slopes in % required for everything.

  • wsh: Watershed (optional).

Intermediate subdirectory

This directory holds intermediate calculations:

  • inl: Cells representing inlets at roads (storm drains).

  • LFa: L-factors.

  • rhy: Hydraulic radii in m.

  • rip: Cells representing the riparian zones within channel cells.

  • SFa: RUSLE S-factors.

  • slp_cap: Capped slopes in %.

Result subdirectory

This directory holds the model results:

  • ero: Erosion in t/cell/yr.

  • xxe: Substance emissions in kg/cell/yr, for example, ppe for PP emissions.

  • xxr: Substance retentions in t/cell/yr (SS) or kg/cell/yr, for example, ppr for PP retentions.

  • xxt: Substance transports in t/cell/yr (SS) or kg/cell/yr, for example, ppt for PP transports.

  • xxt_cld: Substance cell loads in t/cell/yr (SS) or kg/cell/yr, for example, ppt_cld for PP cell loads.

  • xxt_ctf: Substance cell transfers in t/cell/yr (SS) or kg/cell/yr, for example, ppt_ctf for PP transfers.

  • xxt_inp: Substance inputs into surface waters in t/cell/yr (SS) or kg/cell/yr, for example, ppt_inp for PP inputs into surface waters.

  • xxt_out: Substance outlet loads of subsurface drainages in t/cell/yr (SS) or kg/cell/yr, for example, ppt_out for PP outlet loads.

Examples

# \donttest{
# temporary demonstration project copy
cv_dir <- demoProject()
#> Warning: A folder called "demoProject" already exists and is left as is.
# load temporary demonstration project
x <- RPhosFate(
  cv_dir = cv_dir,
  ls_ini = TRUE
)
# presupposed method call
x <- firstRun(x, "SS")

getLayer(x, "dir")
#> class      : RasterLayer 
#> dimensions : 92, 155, 14260  (nrow, ncol, ncell)
#> resolution : 10, 10  (x, y)
#> extent     : 4702990, 4704540, 2795190, 2796110  (xmin, xmax, ymin, ymax)
#> crs        : +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs 
#> source     : dir.tif 
#> names      : dir 
#> values     : 1, 128  (min, max)
#> 
getLayer(x, "xxt", "SS")
#> class      : RasterLayer 
#> dimensions : 92, 155, 14260  (nrow, ncol, ncell)
#> resolution : 10, 10  (x, y)
#> extent     : 4702990, 4704540, 2795190, 2796110  (xmin, xmax, ymin, ymax)
#> crs        : +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs 
#> source     : sst.tif 
#> names      : sst 
#> values     : 0, 18.83847  (min, max)
#> 
getLayer(x, "xxe", "PP")# }
#> class      : RasterLayer 
#> dimensions : 92, 155, 14260  (nrow, ncol, ncell)
#> resolution : 10, 10  (x, y)
#> extent     : 4702990, 4704540, 2795190, 2796110  (xmin, xmax, ymin, ymax)
#> crs        : +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs 
#> source     : ppe.tif 
#> names      : ppe 
#> values     : 1.387505e-05, 1.202173  (min, max)
#>