read.glider.slocum.csv | R Documentation |
This function handles a CSV format used by some files
made available to the author at some time in the 2010s.
In the meantime, the community has settled on other formats,
such as NetCDF (see read.glider.netcdf()
for how to read
such files). For that reason, there are no plans to
extend or even maintain this function.
read.glider.slocum.csv(
file,
nameMap = list(conductivity = "sci_water_cond", temperature = "sci_water_temp",
pressure = "sci_water_pressure", longitude = "lon", latitude = "lat", depth =
"i_depth", debug = getOption("gliderDebug", default = 0))
)
file |
A connection or a character string giving the name of the file to load. |
nameMap |
List used to rename data columns. See “Details”. |
debug |
integer controlling the amount of debugging output printed. Use 0 for no output, 1 for some. |
An oce object holding the data, with variables renamed as
described in “Details”, and with salinity
added,
as calculated by oce::swSCTp()
which uses the UNESCO
algorithm and assumes that the conductivity values are stored in S/m
units.
Dan Kelley
Other functions to read glider data:
read.glider.netcdf()
,
read.glider.netcdf.ioos()
,
read.glider.seaexplorer.raw()
,
read.glider.slocum.netcdf()
library(oceglider)
if (file.exists("~/slocum.csv")) {
g <- read.glider.slocum.csv("~/slocum.csv")
summary(g)
# 1. Plot time-depth trace, colour-coded for temperature
par(mar = c(3, 3, 1, 1), mgp = c(2, 0.7, 0)) # thin margins
cm <- colormap(z = g[["temperature"]])
drawPalette(colormap = cm, cex.axis = 3 / 4)
t <- g[["time"]]
p <- g[["depth"]]
plot(t, p,
ylim = rev(range(p, na.rm = TRUE)),
xlab = "Time", ylab = "Pressure [dbar]",
col = cm$zcol, cex = 1 / 2, pch = 20
)
mtext(paste("Temperature, from", t[1]), cex = 3 / 4)
# 2. Plot distance-depth trace, colour-coded for temperature
dist <- geodDist(g[["longitude"]], g[["latitude"]], alongPath = TRUE)
par(mar = c(3, 3, 1, 1), mgp = c(2, 0.7, 0)) # thin margins
cm <- colormap(z = g[["temperature"]])
drawPalette(colormap = cm, cex.axis = 3 / 4)
p <- g[["depth"]]
plot(dist, p,
ylim = rev(range(p, na.rm = TRUEp)),
xlab = "Distance [km]", ylab = "Pressure [dbar]",
col = cm$zcol, cex = 1 / 2, pch = 20
)
mtext(paste("Temperature, from", t[1]), cex = 3 / 4)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.