View source: R/get.geotop.inpts.keyword.value.R
get.geotop.inpts.keyword.value | R Documentation |
It returns the values of a keyword of "geotop.inpts" file or data frame with the suitable format.
get.geotop.inpts.keyword.value(
keyword,
inpts.frame = NULL,
vector_sep = NULL,
col_sep = ",",
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",
zlayer.formatter = NULL,
z_unit = c("centimeters", "millimeters"),
geotop_z_unit = "millimeters",
add_suffix_dir = NULL,
MAXNROW = 4,
header.only = FALSE,
...
)
keyword |
keyword name |
inpts.frame |
data frame returned by |
vector_sep |
character value for the separator character if Keyword Value must be returned as a vector, otherwise it is |
col_sep |
character value for the separator character of columuns. It is used if Keyword Value is returned as a data frema or zoo object or list of these objects. Default is |
numeric |
logical value. If |
format |
string format representing the date, see |
date |
logical value. If |
tz |
format string representing the time zone, see |
raster |
logical value. Default is |
file_extension |
Extension to be added to the keyword if keyword is a file name. Default is |
add_wpath |
logical value. Default is |
wpath |
working directory containing GEOtop files (included the inpts file). It is mandatory if |
use.read.raster.from.url |
logical value. Default is |
data.frame |
logical value. It is an option for tabular data. If |
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 |
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 |
date_field |
string value. Default is "Date", otherwise defined by the value of |
isNA |
numeric value indicating NA in geotop ascii files. Default is -9999.00 |
matlab.syntax |
logical value. Default is |
projfile |
fileneme of the GEOtop projection file. Default is |
start_date , end_date |
null objects or dates in |
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 |
zlayer.formatter |
decimal formatter. It is used if |
z_unit |
z coordinate measurement unit. GEOtop values expressed in millimeters which are converted to centimeters by default. Default is |
geotop_z_unit |
z coordinate measurement unit used by GEOtop. Default is |
add_suffix_dir |
character string. Add a suffix at the directory reported in the keyword value |
MAXNROW |
maximum number accepted for |
header.only |
logical value. Default is |
... |
further arguments of |
the keyword value
If inpts.frame
is NULL
, inpts.frame
will be obtained by calling the function declared.geotop.inpts.keywords
with ...
arguments.
library(geotopbricks)
#Simulation working path
wpath <-
'https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/simulations/panola13_run2xC_test3'
## URL path (RAW VERSION) of
## https://github.com/ecor/geotopbricks_doc/tree/master/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
tz <- "Etc/GMT-1" ## See help(timezones) In particular:
## Most platforms support time zones of the form Etc/GMT+n
## and Etc/GMT-n (possibly also without prefix Etc/),
## which assume a fixed offset from UTC (hence no DST).
## Contrary to some expectations
## (but consistent with names such as PST8PDT), negative offsets are times ahead of (east of) UTC,
## positive offsets are times behind (west of) UTC.
start <- get.geotop.inpts.keyword.value("InitDateDDMMYYYYhhmm",
date=TRUE,wpath=wpath,tz=tz)
end <- get.geotop.inpts.keyword.value("EndDateDDMMYYYYhhmm",
date=TRUE,wpath=wpath,tz=tz)
nmeteo <- get.geotop.inpts.keyword.value("NumberOfMeteoStations",
numeric=TRUE,wpath=wpath)
level <- 1:nmeteo
## set meteo data
meteo <- get.geotop.inpts.keyword.value("MeteoFile",wpath=wpath,data.frame=TRUE,
level=level,start_date=start,end_date=end,tz=tz)
##### end set meteo data
## IMPORTING AN OUTPUT SOIL MOISTURE PROFILE:
wpath <- paste0(
'https://raw.githubusercontent.com/ecor/geotopbricks_doc/',
'master/simulations/Muntatschini_pnt_1_225_B2_004')
## URL Path (RAW VERSION) of
## https://github.com/ecor/geotopbricks_doc/tree/master/simulations/Muntatschini_pnt_1_225_B2_004
SMC <- get.geotop.inpts.keyword.value("SoilLiqContentProfileFile",
wpath=wpath,data.frame=TRUE,date_field="Date12.DDMMYYYYhhmm.",
formatter="%04d")
SMCz <- get.geotop.inpts.keyword.value("SoilLiqContentProfileFile",
wpath=wpath,data.frame=TRUE,date_field="Date12.DDMMYYYYhhmm.",
formatter="%04d",zlayer.formatter="z%04d")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.