Package 'kwb.ogre'

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

Help Index


checkLimsNumbers

Description

check for duplicate LIMS numbers in sample information

Usage

checkLimsNumbers(x)

Arguments

x

data frame as returned by getInfoOnAnalysedSamplesFromExcel or getInfoOnAnalysedSamplesForStation

Value

duplicated entries (if any)


Download Panke Data from Quantum

Description

Download latest Panke data from Quantum web portal

Usage

downloadLatestPankeDataFromQuantum(target.dir)

Arguments

target.dir

full path to target directory

Value

full path(s) to downloaded csv file(s)


Gantt Plot Samples (version 1)

Description

Gantt Plot Samples (version 1)

Usage

ganttPlotSamples_v1(bottleEvents, endTimeOffsets)

Arguments

bottleEvents

data frame as returned by samplingEventsToBottleEvents, with begin and end of time intervals represented by an auto sampler's bottle.

endTimeOffsets

vector of integer offsets determining new end times for the bottle events by: bottleEvents$tEnd <- bottleEvents$tBeg + 60*endTimeOffsets - 1

Value

ganttPlotSamples version 1


Gantt Plot Samples (version 2)

Description

Gantt Plot Samples (version 2)

Usage

ganttPlotSamples_v2(bottleEvents, bottle, duration)

Arguments

bottleEvents

data frame as returned by samplingEventsToBottleEvents, with begin and end of time intervals represented by an auto sampler's bottle.

bottle

bottle number

duration

"duration" of "bottle event"

Value

ganttPlotSamples version 2


getCurrentFlowSubDirectory

Description

getCurrentFlowSubDirectory

Usage

getCurrentFlowSubDirectory(flowDirectory, do.stop = TRUE)

Arguments

flowDirectory

full path to the directory

do.stop

if TRUE (default) the program will stop if there are unexpected files or folders, otherwise a warning is given

Value

path to most recent flow sub-directory


getInfoOnAnalysedSamplesForStation

Description

Read information on analysed samples for one monitoring station from Excel file maintained by OGRE team

Usage

getInfoOnAnalysedSamplesForStation(
  xls,
  station,
  dbg = FALSE,
  sheetPrefix = "data_"
)

Arguments

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_")

Value

data frame with columns station, LIMS_Nr, BAK_LIMS_Nr, firstSampling, lastSampling and Art_der_Probe

See Also

getInfoOnAnalysedSamplesFromExcel


getInfoOnAnalysedSamplesFromExcel

Description

Read information on analysed samples from Excel file maintained by OGRE team

Usage

getInfoOnAnalysedSamplesFromExcel(xls, dbg = FALSE, sheetPrefix = "data_")

Arguments

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_")

Value

data frame with ...

See Also

getInfoOnAnalysedSamplesForStation


Default folder "dictionary" file

Description

default "dictionary" file describing the folder structure to be used in OGRE

Usage

OGRE_DICTIONARY_FILE()

Value

path to OGRE path dictionary file

Examples

OGRE_DICTIONARY_FILE()

OGRE_ODM_LABMETHODS

Description

OGRE_ODM_LABMETHODS

Usage

OGRE_ODM_LABMETHODS(stringsAsFactors = default.stringsAsFactors())

Arguments

stringsAsFactors

TRUE or FALSE (default: default.stringsAsFactors) passed on to data.frame()

Value

data frame with labmethods

Examples

str(OGRE_ODM_LABMETHODS())

OGRE_ODM_METHODS

Description

OGRE_ODM_METHODS

Usage

OGRE_ODM_METHODS(stringsAsFactors = default.stringsAsFactors())

Arguments

stringsAsFactors

TRUE or FALSE (default: default.stringsAsFactors) passed on to data.frame()

Value

data frame with methods

Examples

str(OGRE_ODM_METHODS())

OGRE_ODM_SAMPLE_TYPES

Description

OGRE_ODM_SAMPLE_TYPES

Usage

OGRE_ODM_SAMPLE_TYPES(stringsAsFactors = default.stringsAsFactors())

Arguments

stringsAsFactors

TRUE or FALSE (default: default.stringsAsFactors) passed on to data.frame()

Value

data frame with sample types

Examples

str(OGRE_ODM_SAMPLE_TYPES())

OGRE_ODM_SITES

Description

TODO: further information on the sites (e.g. addresses need to be added manually within the database...)

Usage

OGRE_ODM_SITES(stringsAsFactors = default.stringsAsFactors())

Arguments

stringsAsFactors

TRUE or FALSE (default: default.stringsAsFactors) passed on to data.frame()

Value

data frame with sources

Examples

str(OGRE_ODM_SITES())

OGRE_ODM_SOURCES

Description

OGRE_ODM_SOURCES

Usage

OGRE_ODM_SOURCES(stringsAsFactors = default.stringsAsFactors())

Arguments

stringsAsFactors

TRUE or FALSE (default: default.stringsAsFactors) passed on to data.frame()

Value

data frame with sources

Examples

str(OGRE_ODM_SOURCES())

OGRE_ODM_UNITS

Description

OGRE_ODM_UNITS

Usage

OGRE_ODM_UNITS(stringsAsFactors = default.stringsAsFactors())

Arguments

stringsAsFactors

TRUE or FALSE (default: default.stringsAsFactors) passed on to data.frame()

Value

data frame with units

Examples

str(OGRE_ODM_UNITS())

OGRE_RAIN_GAUGES

Description

OGRE_RAIN_GAUGES

Usage

OGRE_RAIN_GAUGES()

Value

data frame with rain gauges used in OGRE


OGRE_SITES

Description

OGRE_SITES

Usage

OGRE_SITES()

Value

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_TIMESERIES

Description

OGRE_TIMESERIES

Usage

OGRE_TIMESERIES()

Value

list


OGRE_VARIABLES

Description

OGRE_VARIABLES

Usage

OGRE_VARIABLES()

Value

data frame with laboratory variables

Examples

str(OGRE_VARIABLES())

Open Bottle Selecter

Description

Open Bottle Selecter

Usage

openBottleSelector(bottleEvents, version = 2)

Arguments

bottleEvents

data frame as returned by samplingEventsToBottleEvents, with begin and end of time intervals represented by an auto sampler's bottle.

version

1 or 2 (default: 2), used to switch between different plotting options

Value

opens bottle selector


read_BWB_LaboratoryReportFromXls

Description

NOTE: only rows are used in which parameter, LabMethodName and LabUnits are given

Usage

read_BWB_LaboratoryReportFromXls(
  labResult.xls,
  sheetName = "Tabelle1",
  date.format = kwb.utils::underscoreToPercent("_d._m._Y"),
  methodRequired = FALSE,
  dbg = FALSE,
  open.on.error = TRUE
)

Arguments

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)

Value

data frame with columns VariableCode, LabSampleCode, SamplingDate, SiteCode, DataValueText, LabMethodName, LabUnits


read_hydraulics

Description

read_hydraulics

Usage

read_hydraulics(
  settings,
  dictionary = kwb.utils::selectElements(settings, "dictionary"),
  do.stop = TRUE
)

Arguments

settings

list of settings as returned by configure

dictionary

list of path definitions

do.stop

if TRUE (default) the program will stop if there are unexpected files or folders, otherwise a warning is given

Value

data frame with columns DateTime (POSIXct, UTC), H, v, Q, T


readOgreSamplerFileByName

Description

readOgreSamplerFileByName

Usage

readOgreSamplerFileByName(samplerFile, bottlesToConsider, siteCode = NA)

Arguments

samplerFile

full path to sampler file

bottlesToConsider

bottlesToConsider

siteCode

siteCode (default: NA)

Value

data frame with ???


stopOnWrongSampleSite

Description

stopOnWrongSampleSite

Usage

stopOnWrongSampleSite(sampleData, siteCode, samplerFile = "<unknown>")

Arguments

sampleData

sampleData

siteCode

siteCode

samplerFile

samplerFile (default: "<unknown>")

Value

error if site_id not found


usePredictedFlowInTimeInterval

Description

usePredictedFlowInTimeInterval

Usage

usePredictedFlowInTimeInterval(hydraulicData, firstTimestamp, lastTimestamp)

Arguments

hydraulicData

hydraulicData

firstTimestamp

firstTimestamp

lastTimestamp

lastTimestamp

Value

data frame with filtered hydraulic data (first - last timestamp)