% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sw.R
\name{swSCTp}
\alias{swSCTp}
\title{Practical Salinity From Electrical Conductivity, Temperature and Pressure}
\usage{
swSCTp(
  conductivity,
  temperature = NULL,
  pressure = NULL,
  conductivityUnit,
  eos = getOption("oceEOS", default = "gsw")
)
}
\arguments{
\item{conductivity}{a measure of conductivity (see also \code{conductivityUnit})
or an \code{oce} object holding hydrographic information. In the second case,
all the other arguments to \code{swSCTp} are ignored.}

\item{temperature}{\emph{in-situ} temperature (\eqn{^\circ}{deg}C), defined
on the ITS-90 scale; see \dQuote{Temperature units} in the documentation for
\code{\link[=swRho]{swRho()}}.}

\item{pressure}{pressure (dbar).}

\item{conductivityUnit}{string indicating the unit used for conductivity.
This may be \code{"ratio"} or \code{""} (meaning conductivity ratio),
\code{"mS/cm"} or \code{"S/m"}.  Note that the ratio mode assumes that
measured conductivity has been divided by the standard conductivity
of 4.2914 S/m.  In dealing with unfamiliar data for which the measurement
unit has not been recorded, it can be sensible to try all three possibilities
for \code{conductivityUnit}, to see which yields the most sensible salinities.}

\item{eos}{equation of state, either \code{"unesco"} or \code{"gsw"}.}
}
\value{
Practical Salinity.
}
\description{
Calculate salinity from what is actually measured by a CTD, \emph{i.e.}
conductivity, \emph{in-situ} temperature and pressure.  Often this is done
by the CTD processing software, but sometimes it is helpful to do this
directly, \emph{e.g.} when there is a concern about mismatches in sensor
response times.
}
\details{
Two variants are provided. First, if \code{eos} is
\code{"unesco"}, then salinity is calculated using
the UNESCO algorithm described by Fofonoff and Millard (1983) as in
reference 1. Second, if \code{eos} is \code{"gsw"}, then the
Gibbs-SeaWater formulation is used, via \code{\link[gsw:gsw_SP_from_C]{gsw::gsw_SP_from_C()}}
in the \CRANpkg{gsw} package. The latter starts with the same formula
as the former, but if this yields a Practical Salinity less than 2,
then the result is instead calculated using
formulae provided by Hill et al. (1986; reference 2), modified to match the
\code{"unesco"} value at Practical salinity equal to 2 (reference 3).
}
\examples{
# 1. Demonstrate agreement with test value in UNESCO documents
swSCTp(1, T90fromT68(15), 0, eos = "unesco") # expect 35
# 2. Demonstrate agreement of gsw and unesco, S>2 case
swSCTp(1, T90fromT68(15), 0, eos = "gsw") # again, expect 35
# 3. Demonstrate close values even in very brackish water
swSCTp(0.02, 10, 100, eos = "gsw") # 0.6013981
swSCTp(0.02, 10, 100, eos = "unesco") # 0.6011721

}
\references{
\enumerate{
\item Fofonoff, P. and R. C. Millard Jr, 1983. Algorithms for
computation of fundamental properties of seawater. \emph{Unesco Technical
Papers in Marine Science}, \emph{44}, 53 pp.
\item K. Hill, T. Dauphinee, and D. Woods. \dQuote{The Extension of the Practical
Salinity Scale 1978 to Low Salinities.} IEEE Journal of Oceanic Engineering 11,
no. 1 (January 1986): 109-12.
\doi{10.1109/JOE.1986.1145154}
\item \code{gsw_from_SP} online documentation, available at
\verb{http://www.teos-10.org/pubs/gsw/html/gsw_C_from_SP.html}
}
}
\seealso{
For thermal (as opposed to electrical) conductivity, see
\code{\link[=swThermalConductivity]{swThermalConductivity()}}.  For computation of electrical
conductivity from salinity, see \code{\link[=swCSTp]{swCSTp()}}.

Other functions that calculate seawater properties: 
\code{\link{T68fromT90}()},
\code{\link{T90fromT48}()},
\code{\link{T90fromT68}()},
\code{\link{computableWaterProperties}()},
\code{\link{locationForGsw}()},
\code{\link{swAbsoluteSalinity}()},
\code{\link{swAlpha}()},
\code{\link{swAlphaOverBeta}()},
\code{\link{swBeta}()},
\code{\link{swCSTp}()},
\code{\link{swConservativeTemperature}()},
\code{\link{swDepth}()},
\code{\link{swDynamicHeight}()},
\code{\link{swLapseRate}()},
\code{\link{swN2}()},
\code{\link{swPressure}()},
\code{\link{swRho}()},
\code{\link{swRrho}()},
\code{\link{swSR}()},
\code{\link{swSTrho}()},
\code{\link{swSigma}()},
\code{\link{swSigma0}()},
\code{\link{swSigma1}()},
\code{\link{swSigma2}()},
\code{\link{swSigma3}()},
\code{\link{swSigma4}()},
\code{\link{swSigmaT}()},
\code{\link{swSigmaTheta}()},
\code{\link{swSoundAbsorption}()},
\code{\link{swSoundSpeed}()},
\code{\link{swSpecificHeat}()},
\code{\link{swSpice}()},
\code{\link{swSpiciness0}()},
\code{\link{swSpiciness1}()},
\code{\link{swSpiciness2}()},
\code{\link{swSstar}()},
\code{\link{swTFreeze}()},
\code{\link{swTSrho}()},
\code{\link{swThermalConductivity}()},
\code{\link{swTheta}()},
\code{\link{swViscosity}()},
\code{\link{swZ}()}
}
\author{
Dan Kelley
}
\concept{functions that calculate seawater properties}
