Title: | Interface for PreSens Fiber Optic Data |
---|---|
Description: | Makes output files from select PreSens Fiber Optic Oxygen Transmitters easier to work with in R. See <http://www.presens.de> for more information about PreSens (Precision Sensing GmbH). Note: this package is neither created nor maintained by PreSens. |
Authors: | Matthew A. Birk |
Maintainer: | Matthew A. Birk <[email protected]> |
License: | GPL-3 |
Version: | 2.1.0 |
Built: | 2025-02-26 03:14:02 UTC |
Source: | https://github.com/cran/presens |
Imports the standard txt file output from most PreSens fiber optic O2 transmitters and converts the data into a data frame.
import_o2(file, o2_unit = "percent_a.s.", date = "%d/%m/%y", salinity = 35)
import_o2(file, o2_unit = "percent_a.s.", date = "%d/%m/%y", salinity = 35)
file |
a character string. The filepath for the file to be read. |
o2_unit |
a character string. The unit of O2 measurement to be output in the data.frame. Options are:
|
date |
a character string. The date format to be passed to |
salinity |
salinity of water sample (psu). Default is 35 psu. |
The following PreSens fiber optic O2 transmitters are supported:
It is very important to note that the PreSens fiber optics O2 transmitters that are supported with this function DO NOT account for salinity (i.e. they assume salinity = 0 ppt). If the water sample measured was not fresh water, the oxygen concentrations (e.g. mg per liter or umol per liter) are incorrect in the PreSens txt file. This function corrects these O2 concentrations based on the salinity value defined by the salinity
argument. Absolute partial pressures (i.e. hPa and torr) will also be slightly different due to the slight influence of salinity on water's vapor pressure. This difference is typically ~0.05% of the recorded value.
A data frame with seven columns is returned.
Date and time, POSIXct format.
Duration of measurement trial (minutes).
Oxygen measurement in desired unit. Column name changes based on o2_unit
argument.
Phase recorded. Phase is inversely related to O2.
Amplitude recorded. Amplitude is an indicator of the quality of the signal. A low amplitude warning is produced by the transmitter below 2500.
Temperature recorded or defined at beginning of measurement trial.
Error code from transmitter. See PreSens user manual for translation of error code.
Conversions are estimates based on the marelac
package and therefore differ slightly from the conversions provided by PreSens.
Matthew A. Birk, [email protected]
## Not run: file <- system.file('extdata', 'all_o2_units.txt', package = 'presens') import_o2(file, o2_unit = 'umol_per_l', salinity = 25) ## End(Not run)
## Not run: file <- system.file('extdata', 'all_o2_units.txt', package = 'presens') import_o2(file, o2_unit = 'umol_per_l', salinity = 25) ## End(Not run)
Extracts the last O2 values from a PreSens text file.
last_o2(file, n_last = 10)
last_o2(file, n_last = 10)
file |
a character string. The filepath for the file to be read. |
n_last |
integer. The number of O2 values to extract and return. Default is 10. |
A vector of numeric O2 values with a length of n_last
.
Matthew A. Birk, [email protected]
## Not run: file <- system.file('extdata', 'all_o2_units.txt', package = 'presens') last_o2(file) last_o2(file, n_last = 5) ## End(Not run)
## Not run: file <- system.file('extdata', 'all_o2_units.txt', package = 'presens') last_o2(file) last_o2(file, n_last = 5) ## End(Not run)
Given a measurement of dissolved O2, a list of commonly used units of oxygen partial pressures and concentrations are returned.
o2_unit_conv(o2 = 100, from = "percent_a.s.", to = "all", salinity = 35, temp = 25, air_pres = 1.013253)
o2_unit_conv(o2 = 100, from = "percent_a.s.", to = "all", salinity = 35, temp = 25, air_pres = 1.013253)
o2 |
a numeric vector of the O2 value(s). Default is 100. |
from |
a string describing the unit used to measure
|
to |
a single string either describing the unit to which the conversion should be conducted (options are the same as in |
salinity |
salinity of water sample (psu). Default is 35 psu. |
temp |
temperature of water sample (°C). Default is 25 °C. |
air_pres |
pressure of air overlying water sample (bar). Default is 1.013253 bar. |
Conversions are based on relationships and values from the package marelac
.
Matthew A. Birk, [email protected]
o2_unit_conv(o2 = 50) o2_unit_conv(o2 = 1:50, from = "umol_per_l", to = "ml_per_l", salinity = 0, temp = 10, air_pres = 1.2) o2_unit_conv()[c('mmHg','kPa')]
o2_unit_conv(o2 = 50) o2_unit_conv(o2 = 1:50, from = "umol_per_l", to = "ml_per_l", salinity = 0, temp = 10, air_pres = 1.2) o2_unit_conv()[c('mmHg','kPa')]
Makes output files from select PreSens Fiber Optic Oxygen Transmitters easier to work with in R. See www.presens.de for more information about PreSens (Precision Sensing GmbH). Note: this package is neither created nor maintained by PreSens.
Matthew A. Birk, [email protected]