% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/adp.rdi.R
\name{adpRdiFileTrim}
\alias{adpRdiFileTrim}
\title{Trim an RDI adp File}
\usage{
adpRdiFileTrim(infile, outfile, n, indices, debug = getOption("oceDebug"))
}
\arguments{
\item{infile}{name of an RDI file.}

\item{outfile}{optional name of the new RDI file to be created. If this is not
supplied, a default is used, by adding \verb{_trimmed} to the base filename, e.g.
if \code{infile} is \code{"a.000"} then \code{outfile} will be \code{a_trimmed.000}.}

\item{n}{integer indicating the number of data chunks to keep
at the start of the file. If this is supplied, then \code{indices}
cannot also be supplied.}

\item{indices}{integer vector indicating the indices of the data
chunks that are to be saved to \code{outfile}. If this is supplied,
then \code{n} cannot also be supplied.}

\item{debug}{an integer value indicating the level of debugging. If
this is 0, then \code{\link[=read.adp.rdi]{read.adp.rdi()}} proceeds quietly, except for
issuing warnings and errors if necessary.  If it is 1, then the R
code of \code{\link[=read.adp.rdi]{read.adp.rdi()}} produces some messages.  If it is 2, then also
the underlying C/C++ code produces a message each time a possible
ensemble is detected.  If it is 3, then the C/C++ code also produces
information on some details of the ensemble.  Levels 2 and 3 are
mainly for use by the developers.}
}
\value{
\code{adpRdiFileTrim()} returns the name of the output file, \code{outfile}, as
provided or constructed.
}
\description{
Create an RDI adp file by copying either the first \code{n} data chunks or the
chunks listed in \code{indices} from a given RDI file to a new RDI file.
This can be useful in supplying small sample files for bug reports,
or to speed up further processing of large datasets of which only
a small portion is of interest. Note that the order of the parameters
was changed in 2025-05-26, at which time the \code{indices} parameter
was also added.
}
\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{adpFlagPastBoundary}()},
\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}()}

Other functions that trim data files: 
\code{\link{adpAd2cpFileTrim}()},
\code{\link{advSontekAdrFileTrim}()},
\code{\link{oceFileTrim}()}
}
\author{
Dan Kelley
}
\concept{functions that trim data files}
\concept{things related to adp data}
