Open dylanbeaudette opened 7 years ago
There are apparently some SCAN sites with multiple below-ground sensors too.
Several possible solutions:
Examples to follow-up on.
## station 482
##
## WTEQ.I WTEQ.I-2 PREC.I PREC.I-2 TOBS.I TOBS.I-2 TOBS.I-3 TMAX.D TMIN.D TAVG.D SNWD.I SMS.I_8 STO.I_8
## example of multiple versions of the below-ground sensors
## due to sensor repair, replacement, upgrades, loss of function, ???
##
## station 2196
##
## "STO.I-1:-2", "STO.I-1:-4", "STO.I-1:-8", "STO.I-1:-20", "STO.I-1:-40",
## "STO.I-2:-2", "STO.I-2:-4", "STO.I-2:-8", "STO.I-2:-20", "STO.I-2:-40"
## example of multiple versions of the below-ground sensors
## due to sensor repair, replacement, upgrades, loss of function, ???
RE: site 2196
I am pretty sure that these are actually duplicate below-ground sensors. Both sensors are active as of 2021. The values are very similar but not identical.
library(soilDB)
f <- fetchSCAN(2196, 2021)
#> multiple sensors per depth [site 2196] STO.I_2, STO.I_4, STO.I_8, STO.I_20, STO.I_40, STO.I-2_2, STO.I-2_4, STO.I-2_8, STO.I-2_20, STO.I-2_40
#> 7301 records (0.33 Mb transferred)
f1 <- subset(f$STO, f$STO$sensor.id == "STO.I_2")
f2 <- subset(f$STO, f$STO$sensor.id == "STO.I-2_2")
plot(f1$value~f1$Date, type="l", lty = 2)
lines(f2$value~f2$Date, lty = 3)
summary(lm(f1$value ~ f2$value))
#>
#> Call:
#> lm(formula = f1$value ~ f2$value)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -0.214075 -0.051135 -0.000856 0.044210 0.185177
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) -0.0991436 0.0058147 -17.05 <2e-16 ***
#> f2$value 1.0093109 0.0004542 2222.12 <2e-16 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 0.06935 on 363 degrees of freedom
#> Multiple R-squared: 0.9999, Adjusted R-squared: 0.9999
#> F-statistic: 4.938e+06 on 1 and 363 DF, p-value: < 2.2e-16
Good, those are simpler to account for. Keep in mind those notes and this issue has to do with all of the potential reasons for multiple sensors / type / depth. These were examples to follow-up on.
Do you have an example site ID where a sensor was replaced? I'd like to see one of those
An example might be sitenum=783
There are some SCAN/SNOTEL stations with multiple (above-ground) sensors per sensor prefix. For example:
As of ab70a989fa8c9c86d495e3d3f1e4e5a9921caa59
fetchSCAN()
will issue a message and then naively use the first sensor.A better solution would require significant changes to
fetchSCAN()
and / or working with SCAN admins.