% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ctd.aml.R
\name{read.ctd.aml}
\alias{read.ctd.aml}
\title{Read a ctd File in AML Format}
\usage{
read.ctd.aml(
  file,
  format,
  encoding = "UTF-8-BOM",
  debug = getOption("oceDebug"),
  processingLog,
  ...
)
}
\arguments{
\item{file}{a connection or a character string giving the name of
the file to load.}

\item{format}{an integer indicating the format type.  If not supplied, the
first line is examined to make a guess as to the format (see \dQuote{Details}).}

\item{encoding}{a character value that indicates the encoding to be used for
this data file, if it is textual.  The default value for most functions is
\code{"latin1"}, which seems to be suitable for files containing text written in
English and French.}

\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.}

\item{processingLog}{ignored.}

\item{...}{ignored.}
}
\value{
\code{\link[=read.ctd.aml]{read.ctd.aml()}} returns a \linkS4class{ctd} object.
}
\description{
\code{\link[=read.ctd.aml]{read.ctd.aml()}} reads files that hold data acquired with an AML
Oceanographic Base.X2 CTD instrument. The software associated with
this device can output data in multiple formats, of which \code{\link[=read.ctd.aml]{read.ctd.aml()}}
can read only three, based on files provided to the author by users. If the
\code{format} parameter is not supplied, the function attempts to infer it from
the first line in the file; see \dQuote{Details}.
}
\details{
If \code{format} is not supplied, the first line of the file is examined. If that
line contains \verb{[cast header]} (case insensitive), then format 1 is inferred.
If it contains a comma (i.e. if no header is present) then format 2 is
inferred.  (The AML documentation cautions against saving in this format.)
And if it contains \verb{[header]} (case insensitive) then format 3 is inferred.

Support for types 1 and 2 were added in about the year 2017, whereas type 3
was added in 2024. Documentation was once available for formats 1 and 2, but
it was not an exact match to sample files provided to the author of
\code{\link[=read.ctd.aml]{read.ctd.aml()}}. No documentation seemed to be available for format 3, so
the code was written after manual inspection of a sample file. Given these
things, users are advised to be on the lookout for problems.
}
\examples{
library(oce)
# Show S,T and p for first 5 lines of a format=1 file
f1 <- system.file("extdata", "ctd_aml_type1.csv.gz", package = "oce")
d1 <- read.ctd.aml(f1)
data.frame(S = d1[["salinity"]], T = d1[["temperature"]], p = d1[["pressure"]])

# Show S,T and p for first 5 lines of a format=3 file
f3 <- system.file("extdata", "ctd_aml_type3.csv.gz", package = "oce")
d3 <- read.ctd.aml(f3)
data.frame(S = d3[["salinity"]], T = d3[["temperature"]], p = d3[["pressure"]])

}
\references{
\enumerate{
\item AML Oceanographic. "SeaCast 4 User Manual (Version 2.06)." AML Oceanographic,
May 2016.  This was once available at the <www.subsseateechnologies.com>
website, but neither it nor a new version could be located by the author's
search of the website in September 2024.
}
}
\seealso{
Other things related to ctd data: 
\code{\link{CTD_BCD2014666_008_1_DN.ODF.gz}},
\code{\link{[[,ctd-method}},
\code{\link{[[<-,ctd-method}},
\code{\link{argo2ctd}()},
\code{\link{as.ctd}()},
\code{\link{cnvName2oceName}()},
\code{\link{ctd}},
\code{\link{ctd-class}},
\code{\link{ctd.cnv.gz}},
\code{\link{ctdDecimate}()},
\code{\link{ctdFindProfiles}()},
\code{\link{ctdFindProfilesRBR}()},
\code{\link{ctdRaw}},
\code{\link{ctdRepair}()},
\code{\link{ctdTrim}()},
\code{\link{ctd_aml_type1.csv.gz}},
\code{\link{ctd_aml_type3.csv.gz}},
\code{\link{d200321-001.ctd.gz}},
\code{\link{d201211_0011.cnv.gz}},
\code{\link{handleFlags,ctd-method}},
\code{\link{initialize,ctd-method}},
\code{\link{initializeFlagScheme,ctd-method}},
\code{\link{oceNames2whpNames}()},
\code{\link{oceUnits2whpUnits}()},
\code{\link{plot,ctd-method}},
\code{\link{plotProfile}()},
\code{\link{plotScan}()},
\code{\link{plotTS}()},
\code{\link{read.ctd}()},
\code{\link{read.ctd.itp}()},
\code{\link{read.ctd.odf}()},
\code{\link{read.ctd.odv}()},
\code{\link{read.ctd.saiv}()},
\code{\link{read.ctd.sbe}()},
\code{\link{read.ctd.ssda}()},
\code{\link{read.ctd.woce}()},
\code{\link{read.ctd.woce.other}()},
\code{\link{setFlags,ctd-method}},
\code{\link{subset,ctd-method}},
\code{\link{summary,ctd-method}},
\code{\link{woceNames2oceNames}()},
\code{\link{woceUnit2oceUnit}()},
\code{\link{write.ctd}()}

Other functions that read ctd data: 
\code{\link{read.ctd}()},
\code{\link{read.ctd.itp}()},
\code{\link{read.ctd.odf}()},
\code{\link{read.ctd.saiv}()},
\code{\link{read.ctd.sbe}()},
\code{\link{read.ctd.ssda}()},
\code{\link{read.ctd.woce}()},
\code{\link{read.ctd.woce.other}()}
}
\author{
Dan Kelley
}
\concept{functions that read ctd data}
\concept{things related to ctd data}
