Package 'Tides'

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

Help Index


Characteristics of water level time series in intertidal systems.

Description

The tides package containes routines to calculate ecologicaly relevant characteristics of observed tides in intertidal systems.

Details

Package: Tides
Type: Package
Version: 2.0
License: GNU Public License 2 or above

Author(s)

Tom Cox (maintainer, <[email protected]>), Lennert Schepers (contributor, <[email protected]>)

See Also

TidalCharacteristics: the aggregate function returning several characteristics of the tides

Examples

## Not run: 
## 


## End(Not run)

Extrema

Description

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.

Usage

extrema(h, h0, T2 = 5*60*60, hoffset = 0, filtconst = 1)

Arguments

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 filter(x, rep(1/filtconst,filtconst))

Value

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.

Author(s)

Tom Cox <tom.cox@untwerpbe>


Gaps in time series

Description

Determine gaps (time intervals bigger than a certain maximum dtMax) in a time series

Usage

gapsts(ts, dtMax,unit = "mins", shiftbegin=FALSE)

Arguments

ts

Array of times, not necessarily of class POSIXt. Time sequences with differences of subsequent values < dtMax are considered a continuous series. Time differences > dtMax are considered gaps between two consecutive series.

dtMax

Maximum time interval that is not considered as a gap.

unit

Unit of dtMax. only used when ts is of class POSIXt

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.

Value

Data frame with the initial time, end time and time difference (unit = unit) of each interval > dtMax

Author(s)

Tom Cox <[email protected]>& Lennert Schepers <[email protected]>


Inundation frequence

Description

Calculate inundation frequence at height h0 from series of high water levels H

Usage

IF(H, h0,N = length(H[,1]))

Arguments

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)

Value

Inundation frequence [%] at reference level h0

Author(s)

Tom Cox <[email protected]>


Inundation time

Description

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.

Usage

IT(h, h0, hoffset = 0, dtMax = 15, unit = "mins")

Arguments

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.

Value

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

Author(s)

Tom Cox <[email protected]>


Simple plot of Tides

Description

Plot water levels, calculated high and low water, and reference level of a Tides-object

Usage

## S3 method for class 'Tides'
plot(x,...)

Arguments

x

Tides object (e.g. the result of TidalCharacteristics())

...

Other arguments to be passed to plot()

Details

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.

Author(s)

Tom Cox <[email protected]>


Print summary information of Tides-object

Description

Print summary information of Tides-object

Usage

## S3 method for class 'Tides'
print(x, ...)

Arguments

x

Tides object (e.g. the result of TidalCharacteristics())

...

Other arguments to be passed to print()

Details

Print inundation frequency, average inundation height, average inundation time, average dry time and number of tidal cycles in time series.

Author(s)

Tom Cox <[email protected]>, Lennert Schepers <[email protected]>


Remove gaps from intervals

Description

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.

Usage

RemoveGaps(gaps, ivals, method = c("All", "Split"))

Arguments

gaps

Dataframe generated with gapsts containing gaps in waterlevel time series

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


Summary of tidal characteristics

Description

Outputs list of summary statistics of a Tides oabject

Usage

## S3 method for class 'Tides'
summary(object, ...)

Arguments

object

Tides object (e.g. the result of TidalCharacteristics)

...

Not used (Added for S3 method compatibility)

Value

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)

Author(s)

Lennert Schepers <[email protected]>, Tom Cox <[email protected]>


Calculate tidal characteristics

Description

Calculates the characteristics of observed tidal water levels. Wrapper of the functions extrema, IT and IF. Also works on time series with gaps.

Usage

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

Arguments

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 RemoveGaps

Value

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

Author(s)

Tom Cox <[email protected]>, Lennert Schepers <[email protected]>

See Also

extrema, IT, plot.Tides

Examples

TC <- TidalCharacteristics(waterlevels, filtconst=10,hoffset=1)
 TC
 plot(TC)
 summary(TC)

Observed water levels of the tides in the Lippenbroek Flood Control Area with controled reduced tide (FCA-CRT)

Description

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

Usage

waterlevels

Format

A data frame containing observation time, the observed water level h (mTAW) and the elevation h0 of the observation site

References

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