plot.ctd {oce}R Documentation

Plot seawater CTD data

Description

Plot CTD data, by default in a four-panel display showing (a) profiles of salinity and temperature, (b) profiles of density and the square of buoyancy frequency, (c) a TS diagram and (d) a coastline diagram indicating the station location.

Usage

## S4 method for signature 'ctd'
plot(x, which,
     col=par("fg"), fill,
     borderCoastline=NA, colCoastline="lightgray",
     eos=getOption("oceEOS", default='gsw'),
     ref.lat=NaN, ref.lon=NaN, 
     grid=TRUE,
     coastline="best",
     Slim, Clim, Tlim, plim, densitylim, N2lim, Rrholim,
     dpdtlim, timelim,
     lonlim, latlim,
     clongitude, clatitude, span, showHemi=TRUE,
     lonlabel=NULL, latlabel=NULL, sides=NULL,
     projection=NULL, parameters=NULL, orientation=NULL,
     latlon.pch=20, latlon.cex=1.5, latlon.col="red",
     cex=1, cex.axis=par('cex.axis'),
     pch=1,
     useSmoothScatter=FALSE,
     df,
     keepNA=FALSE,
     type='l',
     adorn=NULL,
     mgp=getOption("oceMgp"),
     mar=c(mgp[1]+1.5,mgp[1]+1.5,mgp[1]+1.5,mgp[1]+1),
     inset=FALSE,
     add=FALSE,
     debug=getOption("oceDebug"),
     ...)

Arguments

x

A ctd object, e.g. as read by read.ctd, or a list containing items named salinity and temperature.

which

list of desired plot types, as given below. If which is not supplied, a default will be used. This default will be c(1,2,3,5) if the CTD is in profiling mode (i.e. if x@metadata$deploymentType=="profile" or if that item is non extant). If the deployment type is "moored" or "thermosalinograph", the default will be c(30, 3, 31, 5). If it is "towyo", c(30, 31, 32, 3) will be used.

  • which=1 or which="salinity+temperature" gives a combined profile of temperature and salinity

  • which=2 or which="density+N2" gives a combined profile of sigma-theta and N^2

  • which=3 or which="TS" gives a TS plot

  • which=4 or which="text" gives a textual summary of some aspects of the data

  • which=5 or which="map" gives a map plotted with plot.coastline, with a dot for the station location. Notes near the top boundary of the map give the station number, the sampling date, and the name of the chief scientist, if these are known. Note that the longitude will be converted to a value between -180 and 180 before plotting. (See also notes about span.)

  • which=5.1 as for which=5, except that the file name is drawn above the map

  • which=6 or which="density+dpdt" gives a profile of density and dP/dt, which is useful for evaluating whether the instrument is dropping properly through the water column

  • which=7 or which="density+time" gives a profile of density and time

  • which=8 or which="index" gives a profile of index number (especially useful for ctdTrim)

  • which=9 or which="salinity" gives a salinity profile

  • which=10 or which="temperature" gives a temperature profile

  • which=11 or which="density" gives a density profile

  • which=12 or which="N2" gives an N^2 profile

  • which=13 or which="spice" gives a spiciness profile

  • which=14 or which="tritium" gives a tritium profile

  • which=15 or which="Rrho" gives an Rrho profile

  • which=16 or which="RrhoSF" gives an RrhoSF profile

  • which=17 or which="conductivity" gives a conductivity profile

col

colour of lines or symbols

fill

a legacy parameter that will be permitted only temporarily; see “History”.

borderCoastline

colour of coastlines and international borders, passed to plot.coastline if a map is included in which.

colCoastline

fill colour of coastlines and international borders, passed to plot.coastline if a map is included in which. Set to NULL to avoid filling.

eos

equation of state to be used, either "unesco" or "gsw".

ref.lat

Latitude of reference point for distance calculation

ref.lon

Longitude of reference point for distance calculation

grid

Set TRUE to get a grid on all plots.

coastline

a specification of the coastline to be used for which="map". This may be a coastline object, whether built-in or supplied by the user, or a character string. If the later, it may be the name of a built-in coastline ("coastlineWorld", "coastlineWorldFine", or "coastlineWorldCoarse"), or "best", to choose a suitable coastline for the locale, or "none" to prevent the drawing of a coastline. There is a speed penalty for providing coastline as a character string, because it forces plot.coastline to load it on every call. So, if plot.coastline is to be called several times for a given coastline, it makes sense to load it in before the first call, and to supply the object as an argument, as opposed to the name of the object.

Slim

optional limits of salinity axes

Clim

optional limits of conductivity axes

Tlim

optional limits of temperature axes

plim

optional limits of pressure axes

densitylim

optional limits of density axis

N2lim

optional limits of N^2 axis

Rrholim

optional limits of R_rho axis

dpdtlim

optional limits of dP/dt axis

timelim

optional limits of delta-time axis

lonlim

optional limits of longitude axis of map (ignored if no map plotted) DEPRECATED 2014-01-07

latlim

optional limits of latitude axis of map (ignored if no map plotted) DEPRECATED 2014-01-07

clongitude

center longitude

clatitude

center latitude

span

optional span of map, in km. If not given, this will be determined as a small multiple of the distance to the nearest point of land, in an attempt to show some coastline in the plot.

showHemi

logical indicating whether to show hemisphere in axis tick labels.

lonlabel,latlabel,sides

optional vectors of longitude and latitude to label on the indicated sides of plot, passed to plot.coastline. Using these arguments permits reasonably simple customization. If they are are not provided, reasonable defaults will be used.

projection

projection for map, if desired. If this is NULL, no projection will be used; the map will simply show longitude and latitude in a cartesian frame, scaled to retain shapes at the centre. If this is the string "automatic", then either a Mercator or Stereographic projection will be used, depending on whether the CTD station is within 70 degrees of the equator or at higher latitudes. Finally, if this is a string in the format used by mapPlot, then it is is passed to that function.

parameters

parameters for map, as for projection.

orientation

orientation for map, as for projection.

latlon.pch

pch for sample location (ignored if no map plotted)

latlon.cex

cex for sample location (ignored if no map plotted)

latlon.col

col for sample location (ignored if no map plotted)

cex

size to be used for plot symbols (see par)

cex.axis

size factor for axis labels (see par)

pch

code for plotting symbol (see par).

useSmoothScatter

boolean, set to TRUE to use smoothScatter instead of plot to draw the plot.

df

optional argument that is ignored except for plotting buoyancy frequency; in that case, it is passed to swN2 as the argument named df.

keepNA

flag indicating whether to keep NA values in linegraphs, which will yield breaks in the lines.

type

type of plot to draw, using the same scheme as plot.

adorn

list of expressions to be executed for the panels in turn, e.g. to adorn the plots. If the number matches the number of panels, then the strings are applied to the appropriate panels, as they are drawn from top-left to bottom-right. If only a single expression is provided, it is used for all panels. (See “Examples”.)

mgp

3-element numerical vector to use for par(mgp), and also for par(mar), computed from this. The default is tighter than the R default, in order to use more space for the data and less for the axes.

mar

value to be used with par("mar").

inset

set to TRUE for use within plotInset. The effect is to prevent the present function from adjusting margins, which is necessary because margin adjustment is the basis for the method used by plotInset.

add

add to an existing plot. This only works if length(which)=1, and it will yield odd results if the value of which does not match that in the previous plots.

debug

set to a positive value to get debugging information during processing.

...

optional arguments passed to plotting functions. A common example is to set df, for use in swN2 calculations.

Details

Creates a multi-panel summary plot of data measured in a CTD cast. The panels are controlled by the which argument. Normally, 4 panels are specified with the which, but it can also be useful to specify less than 4 panels, and then to draw other panels after this call.

If only 2 panels are requested, they will be drawn side by side.

If more than one panel is drawn, then on exit from plot.ctd, the value of par will be reset to the value it had before the function call. However, if only one panel is drawn, the adjustments to par made within plot.ctd are left in place, so that further additions may be made to the plot.

History

Until February, 2016, plot.cctd relied on a now-defunct argument fill to control colours; colCoastline is to be used now, instead. Also, now it is possible to set the edge of coasts and international boundaries, with borderCoastline.

Author(s)

Dan Kelley

See Also

The documentation for ctd-class explains the structure of CTD objects, and also outlines the other functions dealing with them.

Examples

library(oce)
data(ctd) 
plot(ctd)

[Package oce version 0.9-18 Index]