sumanager56 / Soil-moisture-signatures

0 stars 0 forks source link

PWP analysis using event-based #9

Open sumanager56 opened 1 year ago

sumanager56 commented 1 year ago

@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

CornFull16in

CornFull4in

CornFull4in

CornNon16in

CornNon16in

CornNon20

CornNon20

CotFul20in

CotFul20in

CotPrec20in

CotPrec20in

julieshortridge commented 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?

sumanager56 commented 1 year ago

The blue dots represent the FC points, whereas the red dots are the PWP estimates.

sumanager56 commented 1 year ago

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.

CornFull16inch

CornFull16

CornFull4

CornFull4

CornNon16

CornNon16

CornNon20

CornNon20

CotFul20

CotFul20

CotPrec20

CotPrec20