Learn R Programming

geotopbricks (version 1.3.5.4)

brickFromOutputSoil3DTensor: Extracts a brick or a raster layer from a output 3D Tensor or 2D map respectively

Description

Extracts a brick or a raster layer from a output 3D Tensor or 2D map respectively

Usage

brickFromOutputSoil3DTensor(x, when, layers = "SoilLayerThicknesses",
  one.layer = FALSE, suffix = "L%04dN%04d.asc", wpath = NULL,
  tz = "A", start_date_key = "InitDateDDMMYYYYhhmm",
  end_date_key = "EndDateDDMMYYYYhhmm", timestep = "OutputSoilMaps",
  use.read.raster.from.url = FALSE, crs = NULL, projfile = "geotop.proj",
  start.from.zero = FALSE, secondary.suffix = NULL, ...)

rasterFromOutput2DMap(x, when, ...)

Arguments

x
string. GEOtop keyword reletated to the 3D or 2D variable to be imported in R.
when
POSIXct-class for date and time on which the variable x is requested.
layers
number of soil layer or geotop keyword for soil leyer (e.g. SoilLayerThicknesses or SoilFile). Default is SoilLayerThicknesses.
timestep
time step expressed in seconds every which the raster file has been created. It can be a string corresponding to the geotop keyword in the inpts file. Default value is "OutputSoilMaps".
suffix
charcher string containing the decimal formatter used by GEOtop in the output file names. Default is "L not to modify the value of this argument and use the default value.
wpath,tz,use.read.raster.from.url
projfile
name of the *.proj file containing CRS information. See get.geotop.inpts.keyword.value. Default is "geotop.proj". If is NULL or NA
crs,start.from.zero
see brick.decimal.formatter. If crs is not NULL (Default) , projfile is ignored.
one.layer
logical value. If TRUE a RasterLayer-class object is imported, otherwise a RasterBrick-classobject is returened. Defau
start_date_key,end_date_key
initial and final detes and times of the GEOtop simulation or alternatively the respective keywords of *.inpts file (Default)
secondary.suffix
String secondary suffix which can be added at the end of the Map file name (optional). Default is NULL and no secondary suffix is added.

Details

These functions brickFromOutputSoil3DTensor and rasterFromOutput2DMap return 3D or 2D Raster-class objects respectively. rasterFromOutput2DMap is a wrapper function of brickFromOutputSoil3DTensor with the option one.layer==TRUE. The functionswork with the following output keywords:

"SoilTempTensorFile",

"SoilAveragedTempTensorFile",

"SoilLiqContentTensorFile",

"SoilAveragedLiqContentTensorFile",

"SoilIceContentTensorFile",

"SoilAveragedIceContentTensorFile",

"SoilLiqWaterPressTensorFile",

"SoilTotWaterPressTensorFile" for brickFromOutputSoil3DTensor;

"FirstSoilLayerTempMapFile",

"FirstSoilLayerAveragedTempMapFile",

"FirstSoilLayerLiqContentMapFile",

"FirstSoilLayerIceContentMapFile",

"LandSurfaceWaterDepthMapFile",

"ChannelSurfaceWaterDepthMapFile",

"NetRadiationMapFile",

"InLongwaveRadiationMapFile",

"NetLongwaveRadiationMapFile",

"NetShortwaveRadiationMapFile",

"InShortwaveRadiationMapFile",

"DirectInShortwaveRadiationMapFile",

"ShadowFractionTimeMapFile",

"SurfaceHeatFluxMapFile",

"SurfaceSensibleHeatFluxMapFile",

"SurfaceLatentHeatFluxMapFile",

"SurfaceTempMapFile",

"PrecipitationMapFile",

"CanopyInterceptedWaterMapFile",

"SnowDepthMapFile",

"GlacierDepthMapFile",

"SnowMeltedMapFile",

"SnowSublMapFile",

"GlacierMeltedMapFile",

"GlacierSublimatedMapFile",

"AirTempMapFile",

"WindSpeedMapFile",

"WindDirMapFile",

"RelHumMapFile",

"SWEMapFile",

"GlacierWaterEqMapFile"

"SnowDurationMapFile",

"ThawedSoilDepthMapFile",

"ThawedSoilDepthFromAboveMapFile",

"WaterTableDepthMapFile",

"WaterTableDepthFromAboveMapFile",

"NetPrecipitationMapFile",

"EvapotranspirationFromSoilMapFile" for rasterFromOutput2DMap.

See Also

get.geotop.inpts.keyword.value,brick.decimal.formatter

Examples

Run this code
library(geotopbricks)
# The data containing in the link are only for educational use
wpath <- "http://www.boussinesq.org/geotopbricks/simulations/idroclim_test1"
x <- "SoilLiqContentTensorFile"
tz <-  "Etc/GMT+1"
when <- as.POSIXct("2002-03-22",tz=tz)

# Not Run because it elapses too long time!!!
# Please Uncomment the following lines to run by yourself!!!
# b <- brickFromOutputSoil3DTensor(x,when=when,wpath=wpath,tz=tz,use.read.raster.from.url=TRUE)

# a 2D map:
x_e <- "SnowDepthMapFile"
# Not Run: uncomment the following line
# m <- rasterFromOutput2DMap(x_e,when=when,wpath=wpath,timestep="OutputSnowMaps",
#                            tz=tz,use.read.raster.from.url=TRUE)
## NOTE: set use.read.raster.from.url=FALSE (default)
# if the "wpath" directorty is in the local file system.
# Not Run: uncomment the following line
# plot(m)

Run the code above in your browser using DataLab