Plot a profile, showing variation of some quantity (or quantities) with
pressure, using the oceanographic convention of putting lower pressures
nearer the top of the plot. This works for any oce
object that has a
pressure column in its data
slot.
The colors (col.salinity
, etc.) are only used if two profiles appear
on a plot.
plotProfile(
x,
xtype = "salinity+temperature",
ytype = "pressure",
eos = getOption("oceEOS", default = "gsw"),
lty = 1,
xlab = NULL,
ylab = NULL,
col = "black",
col.salinity = "darkgreen",
col.temperature = "red",
col.rho = "blue",
col.N2 = "brown",
col.dpdt = "darkgreen",
col.time = "darkgreen",
pt.bg = "transparent",
grid = TRUE,
col.grid = "lightgray",
lty.grid = "dotted",
Slim,
Clim,
Tlim,
densitylim,
sigmalim,
N2lim,
Rrholim,
dpdtlim,
timelim,
plim,
xlim,
ylim,
lwd = par("lwd"),
xaxs = "r",
yaxs = "r",
cex = 1,
pch = 1,
useSmoothScatter = FALSE,
df,
keepNA = FALSE,
type = "l",
mgp = getOption("oceMgp"),
mar,
add = FALSE,
inset = FALSE,
debug = getOption("oceDebug", 0),
...
)
None.
a ctd object.
item(s) to be plotted on the x axis, either a character
value taken from the following list, or a numeric vector of length
matching the pressure
field stored in x
. (In the second case,
as of version 1.7-11, a label is auto-constructed, unless the user
supplied a character value for xlab
.)
"salinity"
Profile of salinity.
"conductivity"
Profile of conductivity.
"temperature"
Profile of in-situ temperature.
"theta"
Profile of potential temperature.
"density"
Profile of density (expressed as \(\sigma_\theta\)).
"index"
Index of sample (useful for working with ctdTrim()
).
"salinity+temperature"
Profile of salinity and temperature within a single axis frame.
"N2"
Profile of square of buoyancy frequency \(N^2\),
calculated with swN2()
with
an optional argument setting of df=length(x[["pressure"]])/4
to do
some smoothing.
"density+N2"
Profile of sigma0 and
the square of buoyancy frequency within a single axis frame.
"density+dpdt"
Profile of sigma0 and dP/dt for the
sensor. The latter is useful in indicating problems with the deployment.
It is calculated by first differencing pressure and then using a smoothing
spline on the result (to avoid grid-point wiggles that result because the
SBE software only writes 3 decimal places in pressure). Note that dP/dt may
be off by a scale factor; this should not be a problem if there is a
time
column in the data
slot, or a sample.rate
in the
metadata
slot.
"sigma0"
, "sigma1"
, "sigma2"
, "sigma3"
and "sigma4"
Profile of potential density referenced
to 0dbar (i.e. the surface), 1000dbar, 2000dbar, 3000dbar, and 4000dbar.
"spice"
, "spiciness0"
"spiciness1"
or "spiciness2"
Profile of named quantity. For spice
, swSpice()
is
called with the eos
argument set to "unesco"
. Otherwise,
gsw::gsw_spiciness0()
', gsw::gsw_spiciness1()
' or
gsw::gsw_spiciness2()
' is called.
"Rrho"
Profile of Rrho, defined in the diffusive sense.
"RrhoSF"
Profile of Rrho, defined in the salt-finger sense.
variable to use on y axis. The valid choices are:
"pressure"
(the default), "z"
,
"depth"
, "sigmaTheta"
and "sigma0"
.
equation of state to be used, either "unesco"
or
"gsw"
.
line type for the profile.
optional label for x axis (at top of plot). If not
provided, a label is inferred from the value of xtype
. For
the user-supplied case, bear in mind that the easy way to get
units is to use an expression, e.g.
xlab=expression("Acceleration ["*m/s^2*"]")
.
optional label for y axis. See xlab
for a note on
units. Setting ylab=""
prevents labelling the axis.
color for a general profile.
color for salinity profile (see “Details”).
color for temperature (see “Details”).
color for density (see “Details”).
color for square of buoyancy frequency (see “Details”).
color for dP/dt.
color for delta-time.
inside color for symbols with pch
in 21:25
logical, set to TRUE
to get a grid.
color for grid.
line type for grid.
optional limit for the salinity axis, which can either represent Practical Salinity or Absolute Salinity.
optional limit for the conductivity axis.
optional limit for the temperature axis, which can represent in-situ temperature, potential temperature, or Conservative Temperature.
optional limit for density axis.
optional limit for the density-anomaly
axis, which can represent sigmaTheta
, sigma0
, sigma1
,
sigma2
, sigma3
or sigma4
.
optional limit for the N2 axis.
optional limit for the density ratio axis.
optional limit for the dp/dt axis.
optional limit for the delta-time axis.
optional limit for the pressure axis, ignored unless
ytype=="pressure"
, in which case it takes precedence over
ylim
.
optional limit for x axis, which can apply to any plot type.
This is ignored if the plotted x variable is something for which a limit
may be specified with an argument, e.g. xlim
is ignored for a
salinity profile, because Slim
ought to be given in such a case.
optional limit for y axis, which can apply to any plot type,
although is overridden by plim
if ytype
is "pressure"
or by densitylim
if ytype
is "sigmaTheta"
.
line width value for data line
value of par()
xaxs
to use
value of par()
yaxs
to use
size to be used for plot symbols (see par()
)
code for plotting symbol (see par()
).
boolean, set to TRUE
to use
smoothScatter()
instead of plot()
to draw the plot.
optional argument, passed to swN2()
if provided, and
if a plot using \(N^2\) is requested.
FALSE
type of plot to draw, using the same scheme as
plot()
.
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.
Four-element numerical value to be used to set the plot
margins, with a call to par(mar)
prior to the plot.
If this is not supplied, a reasonable default will be set up.
A logical value that controls whether to add to an existing plot. (It
makes sense to use add=TRUE
in the panel
argument of a
coplot()
, for example.)
A logical value indicating whether to draw an inset plot.
Setting this to TRUE
will prevent the present function from adjusting
the margins, which is
necessary because margin adjustment is the basis for the method used by
plotInset()
.
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 passed to other functions. A common example
is to set df
, for use in swN2()
calculations.
Dan Kelley
read.ctd()
scans ctd information from a file,
plot,ctd-method()
is a general plotting function for ctd
objects, and plotTS()
plots a temperature-salinity diagrams.
Other functions that plot oce data:
download.amsr()
,
plot,adp-method
,
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
,
plotScan()
,
plotTS()
,
tidem-class
Other things related to ctd data:
CTD_BCD2014666_008_1_DN.ODF.gz
,
[[,ctd-method
,
[[<-,ctd-method
,
as.ctd()
,
cnvName2oceName()
,
ctd
,
ctd-class
,
ctd.cnv.gz
,
ctdDecimate()
,
ctdFindProfiles()
,
ctdFindProfilesRBR()
,
ctdRaw
,
ctdRepair()
,
ctdTrim()
,
ctd_aml.csv.gz
,
d200321-001.ctd.gz
,
d201211_0011.cnv.gz
,
handleFlags,ctd-method
,
initialize,ctd-method
,
initializeFlagScheme,ctd-method
,
oceNames2whpNames()
,
oceUnits2whpUnits()
,
plot,ctd-method
,
plotScan()
,
plotTS()
,
read.ctd()
,
read.ctd.aml()
,
read.ctd.itp()
,
read.ctd.odf()
,
read.ctd.odv()
,
read.ctd.saiv()
,
read.ctd.sbe()
,
read.ctd.ssda()
,
read.ctd.woce()
,
read.ctd.woce.other()
,
setFlags,ctd-method
,
subset,ctd-method
,
summary,ctd-method
,
woceNames2oceNames()
,
woceUnit2oceUnit()
,
write.ctd()
library(oce)
data(ctd)
plotProfile(ctd, xtype = "temperature")
Run the code above in your browser using DataLab