-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathdecimate.Rd
59 lines (54 loc) · 2.08 KB
/
decimate.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/misc.R
\name{decimate}
\alias{decimate}
\title{Smooth and Decimate, or Subsample, an oce Object}
\usage{
decimate(x, by = 10, to, filter, debug = getOption("oceDebug"))
}
\arguments{
\item{x}{an \linkS4class{oce} object.}
\item{by}{an indication of the subsampling. If this is a single number,
then it indicates the spacing between elements of \code{x} that are
selected. If it is two numbers (a condition only applicable if \code{x} is
an \code{echosounder} object, at present), then the first number indicates
the time spacing and the second indicates the depth spacing.}
\item{to}{Indices at which to subsample. If given, this over-rides
\code{by}.}
\item{filter}{optional list of numbers representing a digital filter to be
applied to each variable in the \code{data} slot of \code{x}, before
decimation is done. If not supplied, then the decimation is done strictly by
sub-sampling.}
\item{debug}{a flag that turns on debugging. Set to 1 to get a moderate
amount of debugging information, or to 2 to get more.}
}
\value{
An \linkS4class{oce} object that has been subsampled appropriately.
}
\description{
Later on, other methods will be added, and \code{\link[=ctdDecimate]{ctdDecimate()}} will be
retired in favour of this, a more general, function. The filtering is done
with the \code{\link[=filter]{filter()}} function of the stats package.
}
\section{Bugs}{
Only a preliminary version of this function is provided in
the present package. It only works for objects of class \code{echosounder},
for which the decimation is done after applying a running median filter and
then a boxcar filter, each of length equal to the corresponding component of
\code{by}.
}
\examples{
library(oce)
data(adp)
plot(adp)
adpDec <- decimate(adp, by = 2, filter = c(1 / 4, 1 / 2, 1 / 4))
plot(adpDec)
}
\seealso{
Filter coefficients may be calculated using
\code{\link[=makeFilter]{makeFilter()}}. (Note that \code{\link[=ctdDecimate]{ctdDecimate()}} will be
retired when the present function gains equivalent functionality.)
}
\author{
Dan Kelley
}