Learn R Programming

geotopbricks (version 1.3.5.4)

get.geotop.inpts.keyword.value: Returns the values of a keyword of "geotop.inpts" file or data frame with the suitable format

Description

Returns the values of a keyword of "geotop.inpts" file or data frame with the suitable format

Usage

get.geotop.inpts.keyword.value(keyword, inpts.frame = NULL,
  vector_sep = NULL, numeric = FALSE, format = "%d/%m/%Y %H:%M",
  date = FALSE, tz = "Etc/GMT+1", raster = FALSE,
  file_extension = ".asc", add_wpath = FALSE, wpath = NULL,
  use.read.raster.from.url = TRUE, data.frame = FALSE,
  formatter = "%04d", level = 1, date_field = "Date", isNA = -9999,
  matlab.syntax = TRUE, projfile = "geotop.proj", start_date = NULL,
  end_date = NULL, ContinuousRecovery = 0,
  ContinuousRecoveryFormatter = "_crec%04d", ...)

Arguments

keyword
keyword name
inpts.frame
data frame returned by declared.geotop.inpts.keywords or NULL. Default is NULL.
vector_sep
character value for the separator chacter if Keyword Value must be returned as a vector, otherwise it is NULL. Default is NULL, but if numeric or date are FALSE, vector_sep
numeric
logical value. If TRUE the Value has numeric type, otherwise it is a string or string vector. Default is FALSE.
date
logical value. If TRUE the Value is retured as POSIXlt date, otherwise it is a string or string vector. Default is FALSE.
format
string format representing the date, see as.POSIXlt, used if date is TRUE. Default is "%d/%m/%Y %H:%M" (which is the format used in geotop.inpts
tz
format string representing the time zone, see as.POSIXlt, used if date is TRUE. Default is "Etc/GMT+1" (until the previous version it was "A") wh
raster
logical value. Default is FALSE. If TRUE function returns direclty the raster map as Raster-class object built with raster
file_extension
Extension to be added to the keyword if keyword is a file name. Default is ".asc"
wpath
working directory containing GEOtop files (included the inpts file). It is mandatory if raster is TRUE. See declared.geotop.inpts.keywords.
add_wpath
logical value. Default is FALSE. If TRUE, the wpath string is attached to the keyword string value. It is automatically set TRUE if raster is TRUE.
use.read.raster.from.url
logical value. Default is TRUE. If TRUE the RasterLayer are read with read.raster.from.url, istead of raster (oth
data.frame
logical value. It is an option for tabular data. If TRUE function returns direclty a data frame or a list of data frames as data.frame or zoo
formatter
string value. It is the decimal formatter contained in the file name and used in case the tabular data are referred at several points. Default is "%04d" . It is used in case data.frame is TRUE.
level
integer values. Numbers incating all the identandification numbers of the files containing the requested data frames. Default is 1, correspondig to the decimal formatter "0001". See examples.
date_field
string value. Default is "Date", otherwise defined by the value of HeaderDateDDMMYYYYhhmmMeteo geotop keyword. It is used only if the argument data.frame is TRUE. If it is NULL or NA
isNA
numeric value indicating NA in geotop ascii files. Default is -9999.00
matlab.syntax
logical value. Default is FALSE. If TRUE a vector is written in a string according to *.m file syntax. Warning: this synstax is not read by GEOtop.
projfile
fileneme of the GEOtop projection file. Default is geotop.proj.
start_date,end_date
null objects or dates in POSIXlt format between which the variables are returned. It is enabled in case that date_field is not NULL or NA and data.frame is TRUE. Default
ContinuousRecovery
integer value. Default is 0. It is used for tabular output data and is the number of times GEOtop simulation broke during its running and was re-launched with 'Contiuous Recovery' option.
ContinuousRecoveryFormatter
character string. Default is '_crec%04d'. It is used only for tabular output data and if ContinuousRecovery is equal or greater than 1.
...
further arguments of declared.geotop.inpts.keywords

Value

  • the keyword value

Examples

Run this code
library(geotopbricks)

#Simulation working path
wpath <- 'http://www.boussinesq.org/geotopbricks/simulations/panola13_run2xC_test3'
prefix <- get.geotop.inpts.keyword.value("SoilLiqWaterPressTensorFile",wpath=wpath)

slope <- get.geotop.inpts.keyword.value("SlopeMapFile",raster=TRUE,wpath=wpath)
bedrock_depth <- get.geotop.inpts.keyword.value("BedrockDepthMapFile",raster=TRUE,wpath=wpath)

layers <- get.geotop.inpts.keyword.value("SoilLayerThicknesses",numeric=TRUE,wpath=wpath)
names(layers) <- paste("L",1:length(layers),sep="")

##### set van genuchten parameters to estimate water volume
theta_sat <- get.geotop.inpts.keyword.value("ThetaSat",numeric=TRUE,wpath=wpath)
theta_res <- get.geotop.inpts.keyword.value("ThetaRes",numeric=TRUE,wpath=wpath)
alphaVG <-  get.geotop.inpts.keyword.value("AlphaVanGenuchten",
numeric=TRUE,wpath=wpath) # expressed in mm^-1

nVG <-  get.geotop.inpts.keyword.value("NVanGenuchten",numeric=TRUE,wpath=wpath)


##### end set van genuchten parameters to estimate water volume


##### set meteo data

start <-  get.geotop.inpts.keyword.value("InitDateDDMMYYYYhhmm",date=TRUE,wpath=wpath,tz="A")
end <- get.geotop.inpts.keyword.value("EndDateDDMMYYYYhhmm",date=TRUE,wpath=wpath,tz="A")

nmeteo <- get.geotop.inpts.keyword.value("NumberOfMeteoStations",numeric=TRUE,wpath=wpath)
level <- 1:nmeteo

# Not Run: uncomment the following lines to calculate "meteo"
# meteo <- get.geotop.inpts.keyword.value("MeteoFile",wpath=wpath,data.frame=TRUE,
#         level=level,start_date=start,end_date=end)
#

##### end set meteo data

Run the code above in your browser using DataLab