% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ingest_sensors.R
\name{read_aanderaa_csv}
\alias{read_aanderaa_csv}
\title{Read an Aanderaa RCM current meter CSV export}
\usage{
read_aanderaa_csv(
  file,
  lat = NULL,
  lon = NULL,
  speed_unit = c("auto", "m/s", "cm/s"),
  depth_from_pressure = FALSE,
  verbose = TRUE
)
}
\arguments{
\item{file}{Character. Path to the Aanderaa Data Studio CSV export.}

\item{lat}{Numeric. Site latitude in decimal degrees (required).}

\item{lon}{Numeric. Site longitude in decimal degrees (required).}

\item{speed_unit}{Character. Units of the current speed column.
\code{"auto"} (default) detects from the column header (looks for \code{cm/s}) or
infers from data range; \code{"m/s"} and \code{"cm/s"} override auto-detection.}

\item{depth_from_pressure}{Logical. If \code{TRUE} and a pressure column is
present, approximate depth is derived as \code{pressure_dbar / 1.025} (default
\code{FALSE}; use only when a depth column is absent).}

\item{verbose}{Logical. Print progress messages (default \code{TRUE}).}
}
\value{
A one-row dataframe (site-averaged) with columns \code{lat}, \code{lon},
\code{current_speed}, and any additional variables present in the file
(\code{temperature}, \code{salinity}, \code{dissolved_oxygen}, \code{pressure_dbar}, \code{depth})
-- ready for \code{\link[=merge_sensor_data]{merge_sensor_data()}}.
}
\description{
Reads the CSV file exported by \strong{Aanderaa Data Studio} from an Aanderaa
Recording Current Meter (RCM Blue 5450, SeaGuard RCM, or compatible model).
The export typically contains time, current speed, current direction, and
optionally temperature, pressure/depth, salinity, and dissolved oxygen.

Because Aanderaa instruments are moored at a fixed location, latitude and
longitude must be supplied by the user via \code{lat} and \code{lon}.

Current speed is returned as \code{current_speed} (m/s). If the export uses
cm/s (common in older instrument firmware), set \code{speed_unit = "cm/s"} or
leave as \code{"auto"} and the function will detect units from the column header
or by range-checking the data.
}
\examples{
\donttest{
# Moored RCM Blue at Strangford Lough narrows
rcm <- read_aanderaa_csv(
  "strangford_rcm_2024.csv",
  lat = 54.398,
  lon = -5.558
)
survey <- merge_sensor_data(adcp = rcm, bathy = bathy)
}
}
\seealso{
\code{\link[=read_rdi_adcp]{read_rdi_adcp()}}, \code{\link[=read_nortek_aquadopp]{read_nortek_aquadopp()}}, \code{\link[=merge_sensor_data]{merge_sensor_data()}}
}
