2.10.2. vacumm.tide.filters – Filtres de marée

2.10.2.1. Overview

Functions:

2.10.2.2. Content

Filters for tide signals

Each filter is defined by a half-list (second half) of coefficients and the time units between each coefficients.

demerliac(var, **kwargs)[source]

Apply a Demerliac filter to signal (cdms2 variable). First axis is supposed to be time and regular.

  • var: Data to filter with first axis supposed to be time.
  • units: Units of coefficient spacings (like ‘hours’ or cdms2.Hour) [default: ‘hours’]
  • get_tide: Also return the tide signal [default: False].
  • only_tide: Only return the tide signal [default: False].
Returns:cdms2 variables with proper time axis.
  • fvar: Filtered version of var (tide signal removed)
  • OR fvar,tvar: Same + tide signal (get_tide=True)
  • OR tvar: Only tide signal (only_tide=True)
extrema(var, ref='mean', mean=None, getmax=True, getmin=True, getsign=False, getidx=False, spline=True, **kwargs)[source]

Find extrema of 1D array using a reference. This is suited for detecting low and high tides.

  • var: 1D cdms2 array of sea level with a time axis.

  • ref: Zero reference to compute the sea level anomaly:

    • a filter name ('demerliac', 'godin') where the residual as used as the reference (useful only on long time series),
    • 'mean': the reference is the averaged signal,
    • an integer, so that the reference is a running average using a window of length ref,
    • a float that is used as the reference.
  • mean: If ref='mean', mean can be substituted to the real mean value.

  • spline: If True, extremes are computed using spline interpolation (precision=minute).

  • getmin: Return an array of low tides.

  • getmax: Return an array of tides.

  • getsign: Return signs of tide.

  • getidx: Return array of index of low and high tides

Returns:[lows,][highs,][signs] depending on options.
generic(var, coefs, units='hours', get_tide=False, only_tide=False, filter_name='Generic', check_regular=False, strict=True, interp_method='cubic', axis=None)[source]

Apply a filter to signal (cdms2 variable) using symetric coefficients. First axis is supposed to be time and regular.

  • var: Data to filter with first axis supposed to be time.
  • coefs: Second half of coefficients.
  • strict: Mask values where at least one value is missing in the filtering interval.
  • filter_name: Name to give to the filter [default: ‘Generic’]
  • units: Units of coefficient spacings (like ‘hours’ or cdms2.Hour) [default: ‘hours’]
  • get_tide: Also return the tide signal [default: False].
  • only_tide: Only return the tide signal [default: False].
Returns:cdms2 variables with proper time axis.
  • fvar: Filtered version of var (tide signal removed)
  • OR fvar,tvar: Same + tide signal (get_tide=True)
  • OR tvar: Only tide signal (only_tide=True)
godin(var, **kwargs)[source]

Apply a Godin filter to signal (cdms2 variable). First axis is supposed to be time and regular.

  • var: Data to filter with first axis supposed to be time.
  • units: Units of coefficient spacings (like ‘hours’ or cdms2.Hour) [default: ‘hours’]
  • get_tide: Also return the tide signal [default: False].
  • only_tide: Only return the tide signal [default: False].
Returns:cdms2 variables with proper time axis.
  • fvar: Filtered version of var (tide signal removed)
  • OR fvar,tvar: Same + tide signal (get_tide=True)
  • OR tvar: Only tide signal (only_tide=True)
zeros(var, ref='mean', mean=None, getref=True, **kwargs)[source]

Get the zeros of a tidal signal

Returns:A cdms2 variable of signs (-1,1) with a time axis
Usage:
>>> tidal_zeros = zeros(sea_level,ref='demerliac')
>>> print tidal_zeros[0:1]
>>> print tidal_zeros[0:1].getTime().asComponentTime()