Learn R Programming

oce (version 0.2-1)

sectionSmooth: Smooth a section (preliminary version that may change)

Description

Smooth a section in the lateral (alpha version that may change)

Usage

sectionSmooth(section, df, debug=getOption("oceDebug"), ...)

Arguments

section
a section object containing the section to be smoothed
df
optional value for df, used by smooth.spline. If not supplied, this is set to the number of stations, divided by 5.
debug
a flag that turns on debugging. Set to 1 to get a moderate amount of debugging information, or to 2 to get more.
...
optional arguments to be supplied to smooth.spline.

Value

  • An object of class "section" that has less lateral variation than the input section.

Details

This is a preliminary version of this function, and it may change in future versions. In particular, this function may get the ability to smooth in the vertical also, and perhaps additional smoothing methods should be allowed.

The section is smoothed using smooth.spline on individual pressure levels. This is done for temperature, salinity, and sigma-theta individually. (This may change; perhaps sigma-theta should be calculated from the smoothed temperature and salinity.)

The ... arguments will be passed to the spline routine, allowing the user to control the spline as desired. If no ... arguments are supplied, sectionSmooth will set df to the number of stations divided by 5, which could be interpreted as smoothing across 5 adjacent stations.

See Also

Sections are normally created with read.section or makeSection. subset may be used to create a new section consisting of just a subset of an existing station, e.g. to focus on a particular region.

Examples

Run this code
# Eastern North Atlantic, showing Mediterranean water. 
library(oce)
data(coastlineWorld)
data(a03)
s <- sectionGrid(subset(a03, indices=90:3), p=seq(00, 2500, 100))
ss <- sectionSmooth(s, df=8)
plot(ss,coastline=coastlineWorld,map.xlim=c(-75,0))

Run the code above in your browser using DataLab