Open sumanager56 opened 1 year ago
Thanks Lal - this makes sense and seems like a reasonable addition. What's the difference between the red and blue dots in your plots?
The blue dots represent the FC points, whereas the red dots are the PWP estimates.
I have modified the code such that the PWP points would not be classified near the rising limbs of the graph as you suggested last week. For this, I included one additional criterion that looks into positive derivate values in a window size of 35 and identifies PWP at a particular window of soil moisture time series where the max derivative value is smaller than a certain threshold (<0.03). I have included the same graphs as before with the new code.
@julieshortridge Hi Dr. Shortridge, I made a few changes in the previous code to estimate FC using the event-based method and incorporated some codes to estimate the PWP.
Added code lines in the function
sum_derivatives <- function(x) { sum(x) } window_size <- 25 class.data$sums <- rollapplyr(class.data$dY, window_size, sum_derivatives, align="left",fill=NA) class.data$abs_diffs <- abs(class.data$sums)
PEL.data <- class.data[class.data$abs_diffs<0.01,] #sum of derivates of 25 consecutive swc is smaller than 0.01 PEL.data <- PEL.data[PEL.data$Y < mean(class.data$Y),] #only looks into estimates that are smaller than mean of swc PEL.data <- PEL.data[PEL.data$Y < min(valid.data3$Y),] #only looks into estimates that are smaller than FC estimates PEL.data <- na.omit(PEL.data)
The above code calculates the sum of derivative values (dY) for each consecutive 25 sets of soil moisture data (leaves the first data each time while counting another consecutive set of 20) and reports the sum in a different column. The idea behind this is to find a set that's relatively stable (the sum of derivatives close to zero). Here are some plots showing the results.
CornFull16inch
CornFull4in
CornNon16in
CornNon20
CotFul20in
CotPrec20in