Open shburnet opened 4 years ago
I have stumbled upon a similar issue. I am not the author of this package but reading the code, I can give you my opinion ;)
It is more a scientific question than coding since the code works, just the data bring unexpected effects.
seasonal = TRUE takes the deepest peek in density slope an thus filtering some of your wrong peaks which are stronger but more shallow. Depends how your profiles looks like (over whole season, you can notice some major differences).
Your seasonal thermocline depth is not detected probably because (as you say) it is not properly formed thus not satisfying the condition using the threshold set by slope parameter. In that case, you can try to increase it.
Another option would be to delete measurements from shallow depths before the analyses, but from my experience, it fails in some special cases.
The thermocline will always be quite jitterish since it is detected in each time interval separately. You might want to use some smoothers (moving mean, gam). This way you can get stable seasonal thermocline trend and possibly use it for subsequent filtering (some threshold set on residuals).
Another option within this package is to use the wtr.layer
function which is an implementation of the split-and-merge algorithm (documented here). You depth resolution might be too low as I implemented it for high resolution profilers. Still can't hurt to throw your data at it and see what happens. See ?wtr.layer
wtr.layer
function is indeed very nice and it performs better on my testing dataset when comes to detecting thermocline in one given profile.
I must add another option to my list above:
For this approach it is better to go for meta.depths
/thermo.depth
since the wtr.layer
gives you base of epilimnion and not top of metalimnion. That means higher temperature that can be too high after smoothing giving wrong (too shallow) depths
I have 1m interval thermistors collecting hourly data in a reservoir and the thermocline depths calculated over the sampling period look a bit odd (see image below) with many at 1.5 or 12.5m from June into August when seasonal=TRUE. When I change code so seasonal=FALSE, less depths are at 12.5m but more appear at 1.5m. I am still running into these issues and am wondering if you might be able to provide some insight on this and/or coding suggestions to possibly decrease their occurrence.
My best guess is these 1.5 and 12.5m depths are due to a secondary thermocline or stratification isn't well defined enough to calculate a thermocline depth as mentioned in the EM&S (2011) paper but other insights would be appreciated.
Thanks in advance.