Title: | Quasi-Periodic Time Series Characteristics |
---|---|
Description: | Calculate Characteristics of Quasi-Periodic Time Series, e.g. Estuarine Water Levels. |
Authors: | Tom Cox <[email protected]>, Lennert Schepers <[email protected]> |
Maintainer: | Tom Cox <[email protected]> |
License: | GPL |
Version: | 2.1 |
Built: | 2025-02-13 03:41:17 UTC |
Source: | https://github.com/tomjscox/tides |
The tides package containes routines to calculate ecologicaly relevant characteristics of observed tides in intertidal systems.
Package: | Tides |
Type: | Package |
Version: | 2.0 |
License: | GNU Public License 2 or above |
Tom Cox (maintainer, <[email protected]>), Lennert Schepers (contributor, <[email protected]>)
TidalCharacteristics
: the aggregate function returning several characteristics of the tides
## Not run: ## ## End(Not run)
## Not run: ## ## End(Not run)
Calculate maxima and minima of quasi periodic time series. The function works good when the time series is 'smooth enough'. The function will fail when multiple local extrema exist, with a magnitude similar to the extremum extremorum and in an interval larger than [t-T2, t+T2] around the extremum extremorum at time t. When this is the case, this might be solved by adding extra wrappers around the function.
extrema(h, h0, T2 = 5*60*60, hoffset = 0, filtconst = 1)
extrema(h, h0, T2 = 5*60*60, hoffset = 0, filtconst = 1)
h |
Water level time series. Data frame with time and h column |
h0 |
Reference level, either single valued vector with dimension corresponding to h |
T2 |
'Lower' bound on half the quasi period, but higher than expected stagnant phase; default = 5h |
hoffset |
Offset level, to prevent spurious maxima generation due to small fluctuations |
filtconst |
Filtering constant for smoothing the time series with |
a list containing:
HL |
Data frame with time, water level and reference level of the extrema. Column HL denotes H(igh) (=maximum) or L(ow) (=minimum) water levels |
h |
Original water level data frame with additional columns HL, denoting H(igh) or L(ow) water phase and N(umber) of tidal cycle. |
Tom Cox <tom.cox@untwerpbe>
Determine gaps (time intervals bigger than a certain maximum dtMax) in a time series
gapsts(ts, dtMax,unit = "mins", shiftbegin=FALSE)
gapsts(ts, dtMax,unit = "mins", shiftbegin=FALSE)
ts |
Array of times, not necessarily of class |
dtMax |
Maximum time interval that is not considered as a gap. |
unit |
Unit of dtMax. only used when ts is of class |
shiftbegin |
IF TRUE, the beginning of the gap is estimated at the time of the presumed (but not available) next sample, with the sampling rate derived from the time step between fore-last and last measurement before the gap. If FALSE the gap is assumed to begin at the time of the last sample. |
Data frame with the initial time, end time and time difference (unit = unit) of each interval > dtMax
Tom Cox <[email protected]>& Lennert Schepers <[email protected]>
Calculate inundation frequence at height h0 from series of high water levels H
IF(H, h0,N = length(H[,1]))
IF(H, h0,N = length(H[,1]))
H |
High water levels. Data Frame with column h |
h0 |
Reference level for which IF has to be calculated |
N |
number of cycles in time series, equals the number of high water levels when these are complete (= default value) |
Inundation frequence [%] at reference level h0
Tom Cox <[email protected]>
Calculate inundation times, i.e. time intervals for which water level h > h0. Care must be taken when there are gaps (long time periods for which there is no data )in the time series. Either the erroneous values have to removed manually, or a wrapper making use of the function gapsts can be used.
IT(h, h0, hoffset = 0, dtMax = 15, unit = "mins")
IT(h, h0, hoffset = 0, dtMax = 15, unit = "mins")
h |
Water level time series. data frame with time and h column |
h0 |
Reference level, either single valued or vector with same length as h |
hoffset |
Offset level to cope with small fluctuations due to rain, ripples. h <= h0 + hoffset is considered dry; h> h0+hoffset is considered wet |
dtMax |
Maximum time interval in continuous water level series. Larger time intervals are considered gaps |
unit |
Unit of dtMax. |
a list containing:
IT Data frame with start time (t1), end time (t2) and duration (dt, unit = unit) of inundation
DT Data frame with start time (t1), end time (t2) and duration (dt, unit = unit) of dry time
Tom Cox <[email protected]>
Plot water levels, calculated high and low water, and reference level of a Tides-object
## S3 method for class 'Tides' plot(x,...)
## S3 method for class 'Tides' plot(x,...)
x |
Tides object (e.g. the result of TidalCharacteristics()) |
... |
Other arguments to be passed to plot() |
Produces a very simple plot of a Tides object, containing water levels, calculated high and low water, and reference level of a Tides-object. Useful for diagnostic purposes.
Tom Cox <[email protected]>
Print summary information of Tides-object
## S3 method for class 'Tides' print(x, ...)
## S3 method for class 'Tides' print(x, ...)
x |
Tides object (e.g. the result of TidalCharacteristics()) |
... |
Other arguments to be passed to print() |
Print inundation frequency, average inundation height, average inundation time, average dry time and number of tidal cycles in time series.
Tom Cox <[email protected]>, Lennert Schepers <[email protected]>
Check whether a set of intervals (ivals) contains gaps (given as a second set of intervals). If so, either remove or split the original intervals.
RemoveGaps(gaps, ivals, method = c("All", "Split"))
RemoveGaps(gaps, ivals, method = c("All", "Split"))
gaps |
Dataframe generated with |
ivals |
Data frame of intervals that have to be corrected for gaps (typically dry times DTS or inundation times ITs) |
method |
Method to remove gaps. "All": every interval containing (part of) a gap is removed. "Split": intervals are split into smaller intervals before and after the gap. "None" nothing is done |
Outputs list of summary statistics of a Tides oabject
## S3 method for class 'Tides' summary(object, ...)
## S3 method for class 'Tides' summary(object, ...)
object |
Tides object (e.g. the result of |
... |
Not used (Added for S3 method compatibility) |
A list containing:
IFsum: Inundation frequency: see IF(). The proportion of high water tides higher than h0. A warning will be displayed when the inundation frequency is 100%.
nIndsum: Inundations during time span, when the waterlevel > h0.
IHsum: Average inundation height. A warning will be displayed when the inundation frequency is 100%.
IHcsum: Average inundation height (per cycle).
Tunitssum: time units
ITsum: Average inundation time, in Tunitssum A warning will be displayed when h0 is never inundated
ITCsum: Average inundation time (per cycle), in Tunitssum
ITMsum: Maximal inundation time, in Tunitssum
DTsum: Average dry time, in Tunitssum
DTCsum: Average dry time (per cycle), in Tunitssum
DTMsum: Maximal dry time, in Tunitssum
MHWsum: Average high water. Note that the calculated HW and LW are always >= h0!
MLWsum: Average low water. Note that the calculated HW and LW are always >= h0!
TRsum: Average tidal range. Note that the calculated HW and LW are always >= h0!
nTCsum: number of (tidal) cycles
nTCFsum: number of full tidal cycles (used to measure averages per cycle)
nGsum: number of gaps
GTsum: total gaps time in mins
nTSsum: number of continuous timeseries
TTNoGapsum: total continuous timeseries time (without gaps, also tidal phases before and after gap are not included)
ITTsum: total inundation time (without gaps, and also tidal phases before and after gap are not included)
DTTsum: total dry time (without gaps, and also tidal phases before and after gap are not included)
IPsum: proportion of total time inundated (without gaps, and also tidal phases before and after gap are not included)
DPsum: DTTsum/TSsum # proportion of total time dry (without gaps, and also tidal phases before and after gap are not included)
Lennert Schepers <[email protected]>, Tom Cox <[email protected]>
Calculates the characteristics of observed tidal water levels. Wrapper of the functions extrema
, IT
and IF
. Also works on time series with gaps.
TidalCharacteristics(h, h0 = h$h0, T2 = 5 * 60 * 60, hoffset = 0, filtconst = 1, dtMax = 15, unit = "mins", Tavg = 12.4 * 60, removegaps = c("All", "Split", "None"))
TidalCharacteristics(h, h0 = h$h0, T2 = 5 * 60 * 60, hoffset = 0, filtconst = 1, dtMax = 15, unit = "mins", Tavg = 12.4 * 60, removegaps = c("All", "Split", "None"))
h |
Water level time series. data frame with time and h column |
h0 |
Reference level, either single valued or vector with dimension corresponding to h |
T2 |
'Lower' bound on half the quasi period, but higher than expected stagnant phase; default = 5h |
hoffset |
Offset level, to prevent spurious maxima generation due to small fluctuations |
filtconst |
Filtering constant for smoothing the time series |
dtMax |
Maximum accepted time interval in a continuous series. Bigger time intervals are considered to be gaps |
unit |
Unit of dtMax, Tavg |
Tavg |
Average period of time series |
removegaps |
Method to remove gaps in time series from inundation times and dry times. See |
An object of class Tides
, i.e. a list containing:
HLData frame with extrema
h original water level data frame with additional attributes
gapsa data frame containing start and end times of gaps in the series
IFinundation frequency of the reference level
ITsinundation times at the reference level
DTsdry times at the reference level
h0reference level
NTotal number of cycles in time span
Tom Cox <[email protected]>, Lennert Schepers <[email protected]>
TC <- TidalCharacteristics(waterlevels, filtconst=10,hoffset=1) TC plot(TC) summary(TC)
TC <- TidalCharacteristics(waterlevels, filtconst=10,hoffset=1) TC plot(TC) summary(TC)
This data set gives the observed water levels (in mTAW, the Belgian reference for water levels) the Lippenbroek Flood Control Area with controled reduced tide (FCA-CRT) between 2007-03-01 and 2007-04-01
waterlevels
waterlevels
A data frame containing observation time, the observed water level h (mTAW) and the elevation h0 of the observation site
Cox et al (2006) Flood control areas as an opportunity to restore estuarine habitat. Ecological engineering 28:55-36
Maris et al (2007) Tuning the tide: creating ecological conditions for tidal marsh development in a controlled inundation area. Hydrobiologia 588: 31-43