Learn R Programming

oce (version 0.9-14)

swRrho: Density ratio

Description

Compute density ratio

Usage

swRrho(ctd, sense=c("diffusive", "finger"), smoothingLength=10, df)

Arguments

ctd
an object of class ctd
sense
an indication of the sense of double diffusion under study and therefore of the definition of Rrho; see Details
smoothingLength
ignored if df supplied, but otherwise the latter is calculated as the number of data points, divided by the number within a depth interval of smoothingLength metres.
df
if given, this is provided to smooth.spline.

Value

  • Density ratio defined in either the "diffusive" or "finger" sense.

Details

This computes Rrho (density ratio) from a ctd object, calculating derivatives from smoothing splines whose properties are governed by smoothingLength or df. If sense="diffusive" the definition is $(beta*dS/dz)/(alpha*d(theta)/dz)$ and the reciprocal for "finger".

If the default arguments are acceptable, ctd[["Rrho"]] may be used instead of swRrho(ctd).

The function returns NA if there are fewer than 4 depths in the profile, because it is not reasonable to fit a spline to such short profiles of salinity and temperature.

Examples

Run this code
library(oce)
data(section)
stn <- section[["station"]][[20]]
par(mfrow=c(1,3))
plotProfile(stn,"salinity")
plotProfile(stn,"temperature")
plotProfile(stn, "RrhoSF")

Run the code above in your browser using DataLab