Learn R Programming

oce (version 0.9-18)

ctd-class: Class to store hydrographic data

Description

Class to store hydrographic data such as measured with a CTD (conductivity, temperature, depth) instrument.

Arguments

Methods

Consider an object named ctd.

Accessing metadata.

Metadata (contained in the S4 slot named metadata) may be retrieved or set by name, ctd[["longitude"]] <- ctd[["longitude"]] + 1 corrects a one-degree error.

Accessing measured data.

Column data may be accessed by name, e.g. ctd[["salinity"]], ctd[["temperature"]], ctd[["pressure"]], etc. Temperature is stored in the ITS-90 scale within the object, but the IPTS-68 value can be accessed with e.g. ctd[["temperature68"]], and this must be done in using various seawater functions, e.g. the density function swRho, if the UNESCO formulation is being requested. The TEOS-10 notation for these quantities also works, with ctd[["SP"]], ctd[["t"]] and ctd[["p"]] returning identical values to those returned for the longer names.

After the names listed above have been checked, the remaining names in the data slot are checked using pmatch, so that e.g. ctd[["sal"]] will recover practical salinity, ctd[["sc"]] will recover scan (if it exists), etc.

Accessing derived data.

Depth is accessed with e.g. ctd[["depth"]], while its negative, the vertical coordinate, is accessed with e.g. ctd[["z"]]; note that these are calculated using swDepth and swZ, and that any values that may have been read in a data file are ignored. Potential temperature defined according to UNESCO-1980 is calculated with ctd[["theta"]] or ctd[["potential temperature"]]. Salinity is retrieved with ctd[["S"]] or ctd[["salinity"]].

Conservative Temperature defined according to TEOS-2010 is calculated with ctd[["CT"]] or ctd[["conservative temperature"]]. Absolute salinity is calculated with ctd[["SA"]] or ctd[["absolute salinity"]]. Note that the salinity calculation requires a latitude and longitude, and if the ctd object lacks those data, the values 300E and 30N will be used as a default. The square of buoyancy frequency is retrieved with ctd[["N2"]] or swN2, density ratio with ctd[["Rrho"]] and spiciness with ctd[["spice"]].

Assigning values.

Items stored in the object may be altered with e.g. ctd[["salinity"]] <- rep(35,10). For obvious reasons, this does not work with derived quantities such as conservative temperature, etc.

Overview of contents.

The show method (e.g. show(ctd)) displays information about the object.

See Also

A file containing CTD profile data may be read with read.ctd, and a CTD object can also be created with as.ctd. See read.ctd for references on data formats used in CTD files. Statistical summaries are provided by summary.ctd, while show displays an overview. CTD objects may be plotted with plot.ctd, which does much of its work by calling plotProfile or plotTS, both of which can also be called by the user, to get fine control over the plots.

A CTD profile can be isolated from a larger record with ctdTrim, a task made easier when plotScan is used to examine the results. Towyow data can be split up into sets of profiles (ascending or descending) with ctdFindProfiles. CTD data may be smoothed and/or cast onto specified pressure levels with ctdDecimate. Low-level manipulation may be done with functions such as ctdAddColumn and ctdUpdateHeader. Additionally, many of the contents of CTD objects may be altered with the [[]] scheme discussed above, and skilled users may also manipulate the contents directly.