The gapctd package can convert Sea-Bird CTD hexadecimal files (.hex) to .cnv file with variables in scientific units. Currently, hex_to_cnv()
supports SBE19plus temperature, conductivity, pressure, and flags, along with data from SBE43 dissolved oxygen and SBE18 pH sensors. The default outputs are:
Note that the cnv file created by hex_to_cnv()
does not include derived quantities that depend on dynamic error corrections from primary channels (e.g. salinity, density, dissolved oxygen). The oce::read.ctd()
package automatically calculates PSS-78 when it is not provided, although this value should not be used directly. Dynamic errors should first be corrected (see Data processing modules, Batch processing steps, and Batch processing instructions and example)
This code below uses hexadecimal and configuration (.xmlcon) files as inputs to generate a .cnv file named 2021_06_24_0001.cnv. The data are then loaded as ctd
objects using the oce package.
library(gapctd) hex_to_cnv(hex_path = system.file("extdata/example/2021_06_24_0001.hex", package = "gapctd"), xmlcon_path = system.file("extdata/example/19-8102_Deploy2021.xmlcon", package = "gapctd"), output_path = "2021_06_24_0001.cnv") dat <- oce::read.oce(file = "2021_06_24_0001.cnv") plot(dat)
library(gapctd) hex_to_cnv(hex_path = system.file("extdata/example/SBE19plus_01908106_2023_06_19_0001.hex", package = "gapctd"), xmlcon_path = system.file("extdata/example/SBE19plusV2_8106_ph_DO_leg2.xmlcon", package = "gapctd"), output_path = "SBE19plus_01908106_2023_06_19_0001.cnv") dat_doph <- oce::read.oce(file = "SBE19plus_01908106_2023_06_19_0001.cnv") plot(dat_doph) head(as.data.frame(dat_doph@data))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.