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.
Value
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.
See also
Other functions to read glider data:
read.glider.netcdf()
,
read.glider.netcdf.ioos()
,
read.glider.seaexplorer.delayed()
,
read.glider.seaexplorer.realtime()
,
read.glider.slocum.netcdf()
Examples
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)
}