weighingGauge4: Runs Alan Barr's filter on weighing gauge cumulative...

View source: R/weighingGauge4.R

weighingGauge4R Documentation

Runs Alan Barr's filter on weighing gauge cumulative precipitation

Description

This function is a wrapper for Alan Barr's function PcpFiltPosTh which removes jitter from precipitation data. The called function is iterative and may be slow to execute.

Usage

weighingGauge4(
  obs,
  precipCol = 1,
  smallDropThreshold = 0.1,
  serviceThreshold = -100,
  serviceGapLength = 3,
  quiet = TRUE,
  logfile = ""
)

Arguments

obs

Required. A standard CRHMr obs file.

precipCol

Optional. The number of the column containing the weighing gauge cumulative percipitaion data, not including the datetime. Default is column 1. This function can only work on 1 column of precipitation.

smallDropThreshold

Optional. Minimum interval precipitation (mm). Default is 0.1.

serviceThreshold

Optional. Threshold for removing change in storage due to servicing (mm). Note that this must be a NEGATIVE value. Default is -100.

serviceGapLength

Optional. Maximum gap length (in time intervals) to be filled by linear interpolation after removing servicing (i.e. gauge reset) data. The default value is 3, but you may have to adjust it for very high-frequency data.

quiet

Optional. Suppresses display of messages, except for errors. If you are calling this function in an R script, you will usually leave quiet=TRUE (i.e. the default). If you are working interactively, you will probably want to set quiet=FALSE.

logfile

Optional. Name of the file to be used for logging the action. Normally not used.

Value

If unsuccessful, returns FALSE. If sucessful, returns a modified version of the obs dataframe containing the adjusted precipitation values. Note that the name of the precipitation variable is modified: '_PcpFiltPosT' is appended.

Note

This function is potentially destructive, as it smooths the accumulated precipitation. You may need to set the filter length by trial-and error. You can check the effects using the function weighingGaugePlot. This version does not explicitly incorporate the effects of evaporation.

Author(s)

Kevin Shook

See Also

PcpFiltPosTh weighingGauge1 weighingGauge2 weighingGauge3 weighingGaugePlot weighingGaugeInterval

Examples

## Not run: 
test4 <- weighingGauge4(wg, smallDropThreshold = 0.05, serviceThreshold = -50)
## End(Not run)


CentreForHydrology/CRHMr documentation built on April 6, 2024, 5:27 p.m.