Title: | Functions Used Within the OGRE Project at KWB |
---|---|
Description: | This package contains functions for: reading logger files. |
Authors: | Hauke Sonnenberg [aut, cre] , Michael Rustler [ctb] (0000-0003-0647-7726), OgRe [fnd], Kompetenzzentrum Wasser Berlin gGmbH [cph] |
Maintainer: | Hauke Sonnenberg <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2024-10-23 02:43:23 UTC |
Source: | https://github.com/KWB-R/kwb.ogre |
check for duplicate LIMS numbers in sample information
checkLimsNumbers(x)
checkLimsNumbers(x)
x |
data frame as returned by |
duplicated entries (if any)
Download latest Panke data from Quantum web portal
downloadLatestPankeDataFromQuantum(target.dir)
downloadLatestPankeDataFromQuantum(target.dir)
target.dir |
full path to target directory |
full path(s) to downloaded csv file(s)
Gantt Plot Samples (version 1)
ganttPlotSamples_v1(bottleEvents, endTimeOffsets)
ganttPlotSamples_v1(bottleEvents, endTimeOffsets)
bottleEvents |
data frame as returned by |
endTimeOffsets |
vector of integer offsets determining new end times for the bottle events by: bottleEvents$tEnd <- bottleEvents$tBeg + 60*endTimeOffsets - 1 |
ganttPlotSamples version 1
Gantt Plot Samples (version 2)
ganttPlotSamples_v2(bottleEvents, bottle, duration)
ganttPlotSamples_v2(bottleEvents, bottle, duration)
bottleEvents |
data frame as returned by |
bottle |
bottle number |
duration |
"duration" of "bottle event" |
ganttPlotSamples version 2
getCurrentFlowSubDirectory
getCurrentFlowSubDirectory(flowDirectory, do.stop = TRUE)
getCurrentFlowSubDirectory(flowDirectory, do.stop = TRUE)
flowDirectory |
full path to the directory |
do.stop |
if |
path to most recent flow sub-directory
Read information on analysed samples for one monitoring station from Excel file maintained by OGRE team
getInfoOnAnalysedSamplesForStation( xls, station, dbg = FALSE, sheetPrefix = "data_" )
getInfoOnAnalysedSamplesForStation( xls, station, dbg = FALSE, sheetPrefix = "data_" )
xls |
full path to Excel file |
station |
three letter code of monitoring station for which data are to be read |
dbg |
if TRUE, debug messages are shown, else not |
sheetPrefix |
prefix of sheet names of sheets to be read (default: "data_") |
data frame with columns station, LIMS_Nr, BAK_LIMS_Nr, firstSampling, lastSampling and Art_der_Probe
getInfoOnAnalysedSamplesFromExcel
Read information on analysed samples from Excel file maintained by OGRE team
getInfoOnAnalysedSamplesFromExcel(xls, dbg = FALSE, sheetPrefix = "data_")
getInfoOnAnalysedSamplesFromExcel(xls, dbg = FALSE, sheetPrefix = "data_")
xls |
full path to Excel file |
dbg |
if TRUE, debug messages are shown, else not |
sheetPrefix |
prefix of sheet names of sheets to be read (default: "data_") |
data frame with ...
getInfoOnAnalysedSamplesForStation
default "dictionary" file describing the folder structure to be used in OGRE
OGRE_DICTIONARY_FILE()
OGRE_DICTIONARY_FILE()
path to OGRE path dictionary file
OGRE_DICTIONARY_FILE()
OGRE_DICTIONARY_FILE()
OGRE_ODM_LABMETHODS
OGRE_ODM_LABMETHODS(stringsAsFactors = default.stringsAsFactors())
OGRE_ODM_LABMETHODS(stringsAsFactors = default.stringsAsFactors())
stringsAsFactors |
TRUE or FALSE (default: |
data frame with labmethods
str(OGRE_ODM_LABMETHODS())
str(OGRE_ODM_LABMETHODS())
OGRE_ODM_METHODS
OGRE_ODM_METHODS(stringsAsFactors = default.stringsAsFactors())
OGRE_ODM_METHODS(stringsAsFactors = default.stringsAsFactors())
stringsAsFactors |
TRUE or FALSE (default: |
data frame with methods
str(OGRE_ODM_METHODS())
str(OGRE_ODM_METHODS())
OGRE_ODM_SAMPLE_TYPES
OGRE_ODM_SAMPLE_TYPES(stringsAsFactors = default.stringsAsFactors())
OGRE_ODM_SAMPLE_TYPES(stringsAsFactors = default.stringsAsFactors())
stringsAsFactors |
TRUE or FALSE (default: |
data frame with sample types
str(OGRE_ODM_SAMPLE_TYPES())
str(OGRE_ODM_SAMPLE_TYPES())
TODO: further information on the sites (e.g. addresses need to be added manually within the database...)
OGRE_ODM_SITES(stringsAsFactors = default.stringsAsFactors())
OGRE_ODM_SITES(stringsAsFactors = default.stringsAsFactors())
stringsAsFactors |
TRUE or FALSE (default: |
data frame with sources
str(OGRE_ODM_SITES())
str(OGRE_ODM_SITES())
OGRE_ODM_SOURCES
OGRE_ODM_SOURCES(stringsAsFactors = default.stringsAsFactors())
OGRE_ODM_SOURCES(stringsAsFactors = default.stringsAsFactors())
stringsAsFactors |
TRUE or FALSE (default: |
data frame with sources
str(OGRE_ODM_SOURCES())
str(OGRE_ODM_SOURCES())
OGRE_ODM_UNITS
OGRE_ODM_UNITS(stringsAsFactors = default.stringsAsFactors())
OGRE_ODM_UNITS(stringsAsFactors = default.stringsAsFactors())
stringsAsFactors |
TRUE or FALSE (default: |
data frame with units
str(OGRE_ODM_UNITS())
str(OGRE_ODM_UNITS())
OGRE_RAIN_GAUGES
OGRE_RAIN_GAUGES()
OGRE_RAIN_GAUGES()
data frame with rain gauges used in OGRE
OGRE_SITES
OGRE_SITES()
OGRE_SITES()
list of lists. One list element per Site, each of which is a list with exactly one list element: SiteID, holding the SiteID of the corresponding site
OGRE_VARIABLES
OGRE_VARIABLES()
OGRE_VARIABLES()
data frame with laboratory variables
str(OGRE_VARIABLES())
str(OGRE_VARIABLES())
Open Bottle Selecter
openBottleSelector(bottleEvents, version = 2)
openBottleSelector(bottleEvents, version = 2)
bottleEvents |
data frame as returned by |
version |
1 or 2 (default: 2), used to switch between different plotting options |
opens bottle selector
NOTE: only rows are used in which parameter, LabMethodName and LabUnits are given
read_BWB_LaboratoryReportFromXls( labResult.xls, sheetName = "Tabelle1", date.format = kwb.utils::underscoreToPercent("_d._m._Y"), methodRequired = FALSE, dbg = FALSE, open.on.error = TRUE )
read_BWB_LaboratoryReportFromXls( labResult.xls, sheetName = "Tabelle1", date.format = kwb.utils::underscoreToPercent("_d._m._Y"), methodRequired = FALSE, dbg = FALSE, open.on.error = TRUE )
labResult.xls |
full path to Excel file |
sheetName |
name of sheet in Excel file. Default: "Tabelle1" |
date.format |
date format used in Excel file. Default: "%d.%m.%Y" |
methodRequired |
if TRUE, only those rows of the Excel file are considered in which a method is given in column "Methode". Default: FALSE |
dbg |
print debug messages (default: FALSE) |
open.on.error |
open on error (default: TRUE) |
data frame with columns VariableCode, LabSampleCode, SamplingDate, SiteCode, DataValueText, LabMethodName, LabUnits
read_hydraulics
read_hydraulics( settings, dictionary = kwb.utils::selectElements(settings, "dictionary"), do.stop = TRUE )
read_hydraulics( settings, dictionary = kwb.utils::selectElements(settings, "dictionary"), do.stop = TRUE )
settings |
list of settings as returned by |
dictionary |
list of path definitions |
do.stop |
if |
data frame with columns DateTime (POSIXct, UTC), H, v, Q, T
readOgreSamplerFileByName
readOgreSamplerFileByName(samplerFile, bottlesToConsider, siteCode = NA)
readOgreSamplerFileByName(samplerFile, bottlesToConsider, siteCode = NA)
samplerFile |
full path to sampler file |
bottlesToConsider |
bottlesToConsider |
siteCode |
siteCode (default: NA) |
data frame with ???
stopOnWrongSampleSite
stopOnWrongSampleSite(sampleData, siteCode, samplerFile = "<unknown>")
stopOnWrongSampleSite(sampleData, siteCode, samplerFile = "<unknown>")
sampleData |
sampleData |
siteCode |
siteCode |
samplerFile |
samplerFile (default: "<unknown>") |
error if site_id not found
usePredictedFlowInTimeInterval
usePredictedFlowInTimeInterval(hydraulicData, firstTimestamp, lastTimestamp)
usePredictedFlowInTimeInterval(hydraulicData, firstTimestamp, lastTimestamp)
hydraulicData |
hydraulicData |
firstTimestamp |
firstTimestamp |
lastTimestamp |
lastTimestamp |
data frame with filtered hydraulic data (first - last timestamp)