sw.N2 {oce} | R Documentation |
Compute N^2, the square of the buoyancy frequency for a seawater profile.
N2 <- sw.N2(ctd, ...) N2 <- sw.N2(p, sigma.theta=NULL, ...)
ctd |
an object of class "ctd ". |
p |
pressure [dbar] |
sigma.theta |
Surface-referenced potential density minus 1000 [kg/m^3] |
... |
Extra arguments that will be passed to
smooth.spline if supplied. A common example is to set df ,
the degrees of freedom for the spline fit; if not set, this will be set
to the value length(p)/5 . |
In the first form, the argument is a ctd
object, from which the
salinity, temperature and pressure values are extracted, used to calculate
sigma.theta, and then used for the calculation of the square of the buoyancy
frequency.
The result is calculated from the derivative of a smoothing cubic
spline fitted to the density profile using smooth.spline
.
Optional arguments in ... are passed to this routine, and this gives
the user a great deal of control over the smoothing technique; see the
documentation on smooth.spline
for details. For example,
plot.profile
uses df=length(x$p)/5
as an optional
argument to N2
to do some smoothing of the density profile.
Square of buoyancy frequency [radian/s].
Dan Kelley
library(oce) data(ctd) # Illustrate effect of changing df plot(sw.N2(ctd), ctd$data$pressure, ylim=rev(range(ctd$data$pressure)), xlab="N2",ylab="p", type='l') lines(sw.N2(ctd, df=10), ctd$data$pressure, col="blue") grid()