Learn R Programming

geotopbricks (version 1.5.8.2)

brickFromOutputSoil3DTensor: brickFromOutputSoil3DTensor

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",
  time_formatter = "N%04d",
  suffix_one.layer = "N%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,
  only.map.filename = FALSE,
  add_suffix_dir = 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 layer (e.g. SoilLayerThicknesses or SoilFile). Default is SoilLayerThicknesses.

one.layer

logical value. If TRUE a RasterLayer-class object is imported, otherwise a RasterBrick-classobject is returened. Default for brickFromOutputSoil3DTensor is FALSE

suffix

charachter string containing the decimal formatter used by GEOtop in the output file names. Default is "L%04dN%04.asc". A simple user is recommended not to modify the value of this argument and use the default value.

time_formatter, suffix_one.layer

charachter string (suffix_one.layer is used for 2Dxy map) containing the decimal formatter used by GEOtop in the output file names to indicate time instant. Default is "N%04.asc". A simple user is recommended not to modify the value of this argument and use the default value.

wpath, tz, use.read.raster.from.url

see get.geotop.inpts.keyword.value

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)

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".

crs, start.from.zero

see brick.decimal.formatter. If crs is not NULL (Default) , projfile is ignored.

projfile

name of the *.proj file containing CRS information. See get.geotop.inpts.keyword.value. Default is "geotop.proj". If is NULL or NA or this file does not exist, it is not searched and read.. In case use.read.raster.from.url is TRUE and no NULL or NA values are assinged, the *.proj file is searched.

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.

only.map.filename

logical value. If it is TRUE, only map file names are returned and maps are not imported. Default is FALSE.

add_suffix_dir, ...

additional arguments for get.geotop.inpts.keyword.value or brickFromOutputSoil3DTensor

Author

Emanuele Cordano

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",

"RelHumMapFiladd_suffix_dir=NULLe",

"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)
if (FALSE) {
# The data containing in the link are only for educational use
wpath <- 'https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/simulations/idroclim_test1'
## URL path (RAW VERSION) of 
## https://github.com/ecor/geotopbricks_doc/tree/master/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