You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've used the (relatively new) function adpFlagPastBoundary() a few times for trimming upward-looking ADCP data, to remove the bins near and beyond the surface. (sidenote, it requires a little hacking, to create a br/bottomrange field from the pressure time series because generally the instrument wouldn't be tracking the surface as in the downward-looking vessel-mounted configuration). It works well, but one thing I noticed is that the df argument (that feeds a smoothing spline) is required. For large/rapidly sampled datasets this operation can take a long time, and can also result in excessive trimming if the df is set too low.
I would propose that it would be better if either:
There could be an option to not do any smoothing, or
In addition to being able to specify no smoothing, perhaps the behaviour should be as in other oce functions (e.g. ctdDecimate()) where the method can be a user-specified function (which would allow simple boxcar filters, etc).
Thoughts?
The text was updated successfully, but these errors were encountered:
Here's a mockup. The way a user could set things up is at the definition of Ys below. I don't think that's too daunting for users, especially because it would be documented.
png("0.png")
library(oce)
process<-function(x, y, s) {
if (missing(s)) {
smooth.spline(x, y, df=20)$y
} else {
s(x, y)
}
}
n<-100
set.seed(20250213)
x<- seq(0, 1, length.out=n)
y<- (x-0.2) * (x-0.6) + rnorm(n, sd=0.05)
plot(x, y)
Y<- process(x, y)
lines(x, Y, col=2, lwd=2)
Ys<- process(x, y, \(x, y) smooth.spline(x, y, nknots= length(x)/5)$y)
lines(x, Ys, col=4, lwd=2)
legend("top", lwd=2, col= c(2, 4), legend= c(
"default (spline with df=20)",
"user (spline with knots=n/5)"
))
commit 7176768 of "develop" has code that might solve this issue. I have not tested it, though. All I did was to hack in some code, and rewrite the docs.
Maybe @richardsc can take a look. Since I've done no testing at all, please be on the lookout for problems and maybe also take a look at the diff in code.
I've used the (relatively new) function
adpFlagPastBoundary()
a few times for trimming upward-looking ADCP data, to remove the bins near and beyond the surface. (sidenote, it requires a little hacking, to create abr
/bottomrange field from the pressure time series because generally the instrument wouldn't be tracking the surface as in the downward-looking vessel-mounted configuration). It works well, but one thing I noticed is that thedf
argument (that feeds a smoothing spline) is required. For large/rapidly sampled datasets this operation can take a long time, and can also result in excessive trimming if the df is set too low.I would propose that it would be better if either:
ctdDecimate()
) where the method can be a user-specified function (which would allow simple boxcar filters, etc).Thoughts?
The text was updated successfully, but these errors were encountered: