useAdjusted: Switch [[ and Plot to Focus on Adjusted Data, if Available

View source: R/adjusted.R

useAdjustedR Documentation

Switch [[ and Plot to Focus on Adjusted Data, if Available

Description

useAdjusted returns a copy of an argoFloats object within which the individual oce::argo objects may have been modified so that future calls to [[,argoFloats-method or plot,argoFloats-method will focus with adjusted versions of the data. (Note that this modification cannot be done for fields that lack adjusted values, so in such cases future calls to [[,argoFloats-method or plot,argoFloats-method work with the unadjusted fields.) The procedure is done profile by profile and parameter by parameter. The fallback argument offers a way to ”fall back” to unadjusted values, depending on the data-mode (real-time, adjusted or delayed) for individual items; see “Details”.

Usage

useAdjusted(argos, fallback = FALSE, debug = 0)

Arguments

argos

an argoFloats object, as read by readProfiles().

fallback

a logical value indicating whether to 'fall back' from adjusted data to raw data for profiles that are in real-time mode. By default, fallback is FALSE, to focus entirely on adjusted data. See “Details”.

debug

an integer that controls whether debugging information is printed during processing. If debug is 0 or less, then no information is printed. If it is 1 then minimal overall information is printed. If it exceeds 1, then information is printed for each Argo cycle contained in argos.

Details

There are two cases. First, if fallback is FALSE (which the default) then the focus switches entirely to the adjusted data. This improves the overall reliability of the results, but at the cost of eliminating real-time data. This is because the adjusted fields for real-time data are set to NA as a matter of policy (see section 2.2.5 of reference 1).

Wider data coverage is obtained if fallback is TRUE. In this case, the focus is shifted to adjusted data only if the data-mode for the individual profiles is A or D, indicating either Adjusted or Delayed mode. Any profiles that are of the R (Realtime) data-mode are left unaltered. This blending of adjusted and unadjusted data offers improved spatial and temporal coverage, while reducing the overall data quality, and so this approach should be used with caution. For more on this function see section 3.4 of Kelley et. al (2021).

Value

useAdjusted returns an argoFloats object that is similar to its first argument, but which is set up so that future calls to [[,argoFloats-method or plot,argoFloats-method will focus on the "adjusted" data stream.

Author(s)

Dan Kelley, Jaimie Harbin and Clark Richards

References

  1. Argo Data Management Team. "Argo User's Manual V3.4," January 20, 2021. ⁠https://archimer.ifremer.fr/doc/00187/29825/⁠

  2. Kelley, D. E., Harbin, J., & Richards, C. (2021). argoFloats: An R package for analyzing Argo data. Frontiers in Marine Science, (8), 636922. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3389/fmars.2021.635922")}

Examples

library(argoFloats)
file <- "SD5903586_001.nc"
raw <- readProfiles(system.file("extdata", file, package="argoFloats"))
adj <- useAdjusted(raw)
# Autoscale with adjusted values so frame shows both raw and adjusted.
plot(adj, which="profile", profileControl=list(parameter="oxygen"), pch=2)
points(raw[[1]][["oxygen"]], raw[[1]][["pressure"]], pch=1)
legend("bottomright", pch=c(2,1), legend=c("Raw", "Adjusted"))


argoFloats documentation built on Oct. 18, 2023, 1:06 a.m.