% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/adp.R
\name{adpFlagPastBoundary}
\alias{adpFlagPastBoundary}
\title{Flag adp Data Past Water Column Boundary}
\usage{
adpFlagPastBoundary(
  x = NULL,
  fields = NULL,
  df = 20,
  smoother,
  trim = 0.15,
  good = 1,
  bad = 4,
  debug = getOption("oceDebug")
)
}
\arguments{
\item{x}{an \linkS4class{adp} object containing bottom ranges.}

\item{fields}{a variable contained within \code{x} indicating which field to flag.
If NULL (the default) then \code{\link[=adpFlagPastBoundary]{adpFlagPastBoundary()}} applies itself to all flag
fields that have the same dimensionality as \code{v} in the \code{data} slot.}

\item{df}{the degrees of freedom to use during the smoothing spline operation.}

\item{smoother}{a function used to smooth the boundary distance.  If
this is not given, then \code{\link[=smooth.spline]{smooth.spline()}} is called with \code{df} set equal
to the value of \code{df} given by the user.  If it is NULL, then no smoothing
is done. If it is a function that takes 2 arguments and returns
a vector of values, then that is used.  For example, a user might set
\code{smoother=function(x, y) smooth.spline(x,y,nknots=length(x)/5)$y}
to use a smoothing spline with the indicated number of knots.}

\item{trim}{a scale factor for boundary trimming (see \dQuote{Details}).}

\item{good}{number stored in flags to indicate good data.}

\item{bad}{number stored in flags to indicate bad data.}

\item{debug}{an integer specifying whether debugging information is
to be printed during the processing. This is a general parameter that
is used by many \code{oce} functions. Generally, setting \code{debug=0}
turns off the printing, while higher values suggest that more information
be printed. If one function calls another, it usually reduces the value of
\code{debug} first, so that a user can often obtain deeper debugging
by specifying higher \code{debug} values.}
}
\value{
\code{adpFlagPastBoundary} returns an \linkS4class{adp} object with flags
adjusted in the specified fields if data are beyond the water column boundary.
}
\description{
Flag variables with the same dimension of \code{v} in an \linkS4class{adp} object that
are beyond the water column boundary while retaining existing flags.
Currently, this operation can only be performed on \linkS4class{adp} objects that
contain bottom ranges. Commonly, \code{\link[=handleFlags]{handleFlags()}} would then be used to remove
such data.
}
\details{
If the object's \code{oceCoordinate} is \code{"beam"}, this works by smoothing the
time-dependent bottom ranges (as controlled by the \code{smoother} and perhaps the
\code{df} parameters), beam-by-beam. If \code{oceCoordinate} is \code{"enu"}, \code{"xyz"}, or
\code{"other"}, smoothing is done based on a time-dependent bottom range averaged
across all the beams.  Once this is done, data within distance of
\eqn{1-trim} multiplied by the bottom range are flagged as being bad.  The
default value of \code{trim} is 0.15, which is close to the value (0.134) of
\eqn{1-cos(angle*pi/180)}, with angle=30 as the beam angle in degrees.
}
\seealso{
Other things related to adp data: 
\code{\link{[[,adp-method}},
\code{\link{[[<-,adp-method}},
\code{\link{ad2cpCodeToName}()},
\code{\link{ad2cpHeaderValue}()},
\code{\link{adp}},
\code{\link{adp-class}},
\code{\link{adpAd2cpFileTrim}()},
\code{\link{adpConvertRawToNumeric}()},
\code{\link{adpEnsembleAverage}()},
\code{\link{adpRdiFileTrim}()},
\code{\link{adp_rdi.000}},
\code{\link{applyMagneticDeclination,adp-method}},
\code{\link{as.adp}()},
\code{\link{beamName}()},
\code{\link{beamToXyz}()},
\code{\link{beamToXyzAdp}()},
\code{\link{beamToXyzAdpAD2CP}()},
\code{\link{beamToXyzAdv}()},
\code{\link{beamUnspreadAdp}()},
\code{\link{binmapAdp}()},
\code{\link{enuToOther}()},
\code{\link{enuToOtherAdp}()},
\code{\link{handleFlags,adp-method}},
\code{\link{is.ad2cp}()},
\code{\link{plot,adp-method}},
\code{\link{read.adp}()},
\code{\link{read.adp.ad2cp}()},
\code{\link{read.adp.nortek}()},
\code{\link{read.adp.rdi}()},
\code{\link{read.adp.sontek}()},
\code{\link{read.adp.sontek.serial}()},
\code{\link{read.aquadopp}()},
\code{\link{read.aquadoppHR}()},
\code{\link{read.aquadoppProfiler}()},
\code{\link{rotateAboutZ}()},
\code{\link{setFlags,adp-method}},
\code{\link{subset,adp-method}},
\code{\link{subtractBottomVelocity}()},
\code{\link{summary,adp-method}},
\code{\link{toEnu}()},
\code{\link{toEnuAdp}()},
\code{\link{velocityStatistics}()},
\code{\link{xyzToEnu}()},
\code{\link{xyzToEnuAdp}()},
\code{\link{xyzToEnuAdpAD2CP}()}
}
\author{
Jaimie Harbin, Clark Richards, and Dan Kelley
}
\concept{things related to adp data}
