Learn R Programming

oce (version 0.2-1)

read.section: Read a section containing multiple CTD profiles

Description

Read a file that contains a series of ctd profiles that make up an oceanographic section.

Usage

read.section(file, sectionId="", flags, 
             ship="", scientist="", institute="",
             debug=getOption("oceDebug"),
  history)

Arguments

file
a file containing a set of CTD observations. At present, only the exchange BOT format is accepted (see Details).
sectionId
optional string indicating the name for the section. If not provided, the section ID is determined by examination of the file header.
ship
name of the ship carrying out the sampling
scientist
name of chief scientist aboard ship
institute
name of chief scientist's institute
flags
optional list of salinity-quality flags that will be demanded of the salinity data. If not given, an appropriate flag will be chosen based on the data type. For example, for WOCE data, any data with salinity flag not equal to 2 will be rej
debug
logical. If TRUE, print some information that might be helpful during debugging.
history
if provided, the action item to be stored in the log. (Typically only provided for internal calls; the default that it provides is better for normal calls by a user.)

Value

  • An object of class "section", which is a list containing
  • dataa list containing just one item, station, which is a list of ctd objects, one per station.
  • metadataa list containing: header, the header from the data file; sectionId, a name for the section; stationId, a vector of station IDs, one per station; latitude, a vector of station latitudes, decimal and positive in northern hemisphere; and longitude, a vector of station latitudes, decimal and positive in eastern hemisphere.
  • historya history of processing, in the standard oce format.

Details

Only exchange BOT comma-separated value format is permitted at this time, but other formats may be added later. It should also be noted that the parsing scheme was developed after inspection of the A03 data set (see Examples). This may cause problems if the format is not universal. For example, the header must name the salinity column "CTDSAL"; if not, salinity values will not be read from the file.

References

Several repository sites provide section data. An example that is perhaps likely to exist for years is http://cchdo.ucsd.edu, but a search on "WOCE bottle data" should turn up other sites, if this one ceases to exist. Only the so-called exchange BOT data format can be processed by read.section() at this time.

See Also

makeSection can be used to bind together ctd objects into a section.

Examples

Run this code
library(oce)
data(a03)
GS <- subset(a03, indices=124:102)
GSg <- sectionGrid(GS, p=seq(0, 5000, 100))
data(coastlineWorld)
plot(GSg, coastline=coastlineWorld, map.xlim=c(-80,-60))
# Plot stations individually (good for quality-control)
pdf("a03_stations.pdf")
for (s in seq_along(na03$data$station)) {
    plot(na03$data$station[[s]])
}
dev.off()

Run the code above in your browser using DataLab