This function examines the quality-control ("QC") flags within an
object that was created by
readProfiles(). By default, it replaces all suspicious
NA values, so they will not appear in plots or be considered in calculations.
This is an important early step in processing, because suspicious Argo floats commonly
report data that are suspicious based on statistical and physical measures, as
is illustrated in the “Examples” section. See section 3.3 of Kelley et al. (2021) for more on this function.
A list specifying flag values upon which actions will be taken. This can take two forms.
In the first form, the list has named elements each containing a vector of integers. For example, salinities flagged with values of 1 or 3:9 would be specified by flags=list(salinity=c(1,3:9)). Several data items can be specified, e.g. flags=list(salinity=c(1,3:9), temperature=c(1,3:9)) indicates that the actions are to take place for both salinity and temperature.
In the second form, flags is a list holding a single unnamed vector, and this means to apply the actions to all the data entries. For example, flags=list(c(1,3:9)) means to apply not just to salinity and temperature, but to everything within the data slot.
If flags is NULL then flags=list(c(0,3,4,6,7,9)) is used by default where: 0 = data that have not yet been assessed, 3 = "probably bad" data, 4 = for "bad" data, 6 = an unused flag, 7 = an unused flag, or 9 = "missing" data.
See Sections 3.2.1 and 3.2.2 of Carval et al. (2019) for more information on these QC code values.
the actions to perform. The default,
an integer passed to
The work is done by using
on each of the profiles stored within the object. In most cases, only
the object needs to be specified, for the default actions coincide with
common conventions for flags in Argo data.
A copy of
x but with each of the objects within its
data slot having been passed through
Carval, Thierry, Bob Keeley, Yasushi Takatsuki, Takashi Yoshida, Stephen Loch,
Claudia Schmid, and Roger Goldsmith. Argo User's Manual V3.3. Ifremer, 2019.
Kelley, D. E., Harbin, J., & Richards, C. (2021). argoFloats: An R package for analyzing Argo data. Frontiers in Marine Science, (8), 636922. doi: 10.3389/fmars.2021.635922
1 2 3 4 5 6 7 8 9 10 11 12
# Demonstrate applyQC to a built-in file library(argoFloats) f <- system.file("extdata", "SR2902204_131.nc", package="argoFloats") raw <- readProfiles(f) clean <- applyQC(raw) oldpar <- par(no.readonly=TRUE) par(mar=c(3.3, 3.3, 1, 1), mgp=c(2, 0.7, 0)) plot(raw, col="red", which="TS") points(clean[][["SA"]], clean[][["CT"]], pch=20) legend("topleft", pch=20, cex=1, col=c("black", "red"), legend=c("OK", "Flagged"), bg="white") par(oldpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.