plot,adp-method {oce}R Documentation

Plot an adp Object

Description

Create a summary plot of data measured by an acoustic Doppler profiler.

Usage

## S4 method for signature 'adp'
plot(
  x,
  which,
  j,
  col,
  breaks,
  zlim,
  titles,
  lwd = par("lwd"),
  type = "l",
  ytype = c("profile", "distance"),
  drawTimeRange = getOption("oceDrawTimeRange"),
  useSmoothScatter,
  missingColor = "gray",
  mgp = getOption("oceMgp"),
  mar = c(mgp[1] + 1.5, mgp[1] + 1.5, 1.5, 1.5),
  mai.palette = rep(0, 4),
  tformat,
  marginsAsImage = FALSE,
  cex = par("cex"),
  cex.axis = par("cex.axis"),
  cex.lab = par("cex.lab"),
  xlim,
  ylim,
  control,
  useLayout = FALSE,
  coastline = "coastlineWorld",
  span = 300,
  main = "",
  grid = FALSE,
  grid.col = "darkgray",
  grid.lty = "dotted",
  grid.lwd = 1,
  xlab = NULL,
  debug = getOption("oceDebug"),
  ...
)

Arguments

x

an adp object.

which

list of desired plot types. These are graphed in panels running down from the top of the page. If which is not given, the plot will show images of the distance-time dependence of velocity for each beam. See “Details” for the meanings of various values of which.

j

optional string specifying a sub-class of which. For Nortek Aquadopp profilers, this may either be "default" (or missing) to get the main signal, or "diagnostic" to get a diagnostic signal.

col

optional indication of color(s) to use. If not provided, the default for images is oce.colorsPalette(128,1), and for lines and points is black.

breaks

optional breaks for color scheme

zlim

a range to be used as the zlim parameter to the imagep() call that is used to create the image. If omitted, zlim is set for each panel individually, to encompass the data of the panel and to be centred around zero. If provided as a two-element vector, then that is used for each panel. If provided as a two-column matrix, then each panel of the graph uses the corresponding row of the matrix; for example, setting zlim=rbind(c(-1,1),c(-1,1),c(-.1,.1)) might make sense for which=1:3, so that the two horizontal velocities have one scale, and the smaller vertical velocity has another.

titles

optional vector of character strings to be used as labels for the plot panels. For images, these strings will be placed in the right hand side of the top margin. For timeseries, these strings are ignored. If this is provided, its length must equal that of which.

lwd

if the plot is of a time-series or scattergraph format with lines, this is used in the usual way; otherwise, e.g. for image formats, this is ignored.

type

if the plot is of a time-series or scattergraph format, this is used in the usual way, e.g. "l" for lines, etc.; otherwise, as for image formats, this is ignored.

ytype

character string controlling the type of the y axis for images (ignored for time series). If "distance", then the y axis will be distance from the sensor head, with smaller distances nearer the bottom of the graph. If "profile", then this will still be true for upward-looking instruments, but the y axis will be flipped for downward-looking instruments, so that in either case, the top of the graph will represent the sample nearest the sea surface.

drawTimeRange

boolean that applies to panels with time as the horizontal axis, indicating whether to draw the time range in the top-left margin of the plot.

useSmoothScatter

boolean that indicates whether to use smoothScatter() in various plots, such as which="uv". If not provided a default is used, with smoothScatter() being used if there are more than 2000 points to plot.

missingColor

color used to indicate NA values in images (see imagep()); set to NULL to avoid this indication.

mgp

A 3-element numerical vector used with par("mgp") to control the spacing of axis elements. The default is tighter than the R default.

mar

A 4-element numerical vector used with par("mar") to control the plot margins. The default is tighter than the R default.

mai.palette

margins, in inches, to be added to those calculated for the palette; alter from the default only with caution

tformat

optional argument passed to oce.plot.ts(), for plot types that call that function. (See strptime() for the format used.)

marginsAsImage

boolean, TRUE to put a wide margin to the right of time-series plots, even if there are no images in the which list. (The margin is made wide if there are some images in the sequence.)

cex

numeric character expansion factor for plot symbols; see par().

cex.axis, cex.lab

character expansion factors for axis numbers and axis names; see par().

xlim

optional 2-element list for xlim, or 2-column matrix, in which case the rows are used, in order, for the panels of the graph.

ylim

optional 2-element list for ylim, or 2-column matrix, in which case the rows are used, in order, for the panels of the graph.

control

optional list of parameters that may be used for different plot types. Possibilities are drawBottom (a boolean that indicates whether to draw the bottom) and bin (a numeric giving the index of the bin on which to act, as explained in “Details”).

useLayout

set to FALSE to prevent using layout() to set up the plot. This is needed if the call is to be part of a sequence set up by e.g. par(mfrow).

coastline

a coastline object, or a character string naming one. This is used only for which="map". See notes at plot,ctd-method() for more information on built-in coastlines.

span

approximate span of map in km

main

main title for plot, used just on the top panel, if there are several panels.

grid

if TRUE, a grid will be drawn for each panel. (This argument is needed, because calling grid() after doing a sequence of plots will not result in useful results for the individual panels.

grid.col

color of grid

grid.lty

line type of grid

grid.lwd

line width of grid

xlab

optional character value giving the label for the x axis. If NULL (the default) then the label is determined automatically.

debug

an integer specifying whether debugging information is to be printed during the processing. This is a general parameter that is used by many oce functions. Generally, setting debug=0 turns off the printing, while higher values suggest that more information be printed. If one function calls another, it usually reduces the value of debug first, so that a user can often obtain deeper debugging by specifying higher debug values.

...

optional arguments passed to plotting functions. For example, supplying despike=TRUE will cause time-series panels to be de-spiked with despike(). Another common action is to set the color for missing values on image plots, with the argument missingColor (see imagep()). Note that it is an error to give breaks in ..., if the formal argument zlim was also given, because they could contradict each other.

Details

The plot may have one or more panels, with the content being controlled by the which argument.

In addition to the above, the following shortcuts are defined:

The color scheme for image plots (which in 1:12) is provided by the col argument, which is passed to image() to do the actual plotting. See “Examples” for some comparisons.

A common quick-look plot to assess mooring movement is to use which=15:18 (pressure being included to signal the tide, and tidal currents may dislodge a mooring or cause it to settle).

By default, ⁠plot,adp-method⁠ uses a zlim value for the image() that is constructed to contain all the data, but to be symmetric about zero. This is done on a per-panel basis, and the scale is plotted at the top-right corner, along with the name of the variable being plotted. You may also supply zlim as one of the ... arguments, but be aware that a reasonable limit on horizontal velocity components is unlikely to be of much use for the vertical component.

A good first step in the analysis of measurements made from a moored device (stored in d, say) is to do plot(d, which=14:18). This shows time series of water properties and sensor orientation, which is helpful in deciding which data to trim at the start and end of the deployment, because they were measured on the dock or on the ship as it travelled to the mooring site.

Value

A list is silently returned, containing xat and yat, values that can be used by oce.grid() to add a grid to the plot.

Author(s)

Dan Kelley

See Also

Other functions that plot oce data: download.amsr(), plot,adv-method, plot,amsr-method, plot,argo-method, plot,bremen-method, plot,cm-method, plot,coastline-method, plot,ctd-method, plot,gps-method, plot,ladp-method, plot,landsat-method, plot,lisst-method, plot,lobo-method, plot,met-method, plot,odf-method, plot,rsk-method, plot,satellite-method, plot,sealevel-method, plot,section-method, plot,tidem-method, plot,topo-method, plot,windrose-method, plot,xbt-method, plotProfile(), plotScan(), plotTS(), tidem-class

Other things related to adp data: [[,adp-method, [[<-,adp-method, ad2cpCodeToName(), ad2cpHeaderValue(), adp-class, adpAd2cpFileTrim(), adpConvertRawToNumeric(), adpEnsembleAverage(), adpFlagPastBoundary(), adpRdiFileTrim(), adp_rdi.000, adp, applyMagneticDeclination,adp-method, as.adp(), beamName(), beamToXyzAdpAD2CP(), beamToXyzAdp(), beamToXyzAdv(), beamToXyz(), beamUnspreadAdp(), binmapAdp(), enuToOtherAdp(), enuToOther(), handleFlags,adp-method, is.ad2cp(), read.adp.ad2cp(), read.adp.nortek(), read.adp.rdi(), read.adp.sontek.serial(), read.adp.sontek(), read.adp(), read.aquadoppHR(), read.aquadoppProfiler(), read.aquadopp(), rotateAboutZ(), setFlags,adp-method, subset,adp-method, subtractBottomVelocity(), summary,adp-method, toEnuAdp(), toEnu(), velocityStatistics(), xyzToEnuAdpAD2CP(), xyzToEnuAdp(), xyzToEnu()

Examples

library(oce)
data(adp)
plot(adp, which = 1:3)
plot(adp, which = "temperature", tformat = "%H:%M")


[Package oce version 1.8-2 Index]