Dates Management in CreateBasinObs
In CreateBasinObs, there is a DatesR data.frame in BasinObs for P, PET and T, and Qobs has is own DatesR attribute. It works very well in the airGRccia example, but in real life, often Qobs are not available at the beginning of the period. This means that the Qobs data.frame in BasinObs can have less values than other variables and these data are not "chronologically aligned".
Thereafter, when you index it with Qobs <- BasinsObs$Q[Ind_Run, ], and put it in CreateInputsCrit, there is logically is temporal mismatch. Of course you can manually correct that, but that would be much cleaner to make CreateBasinObs create an list whose data.frames correspond the the same periods. Although I recognise that the list would be heavier as we would add NAs.
Ok course, the user could ensure that the same periods are entered. Personnally I used:
DatesR = as.data.frame(as.POSIXlt(stars::st_get_dimension_values(s_sb, "time")))
names(DatesR) = "DatesR"
Q = merge(x = Q, y = DatesR, by.x = "DatesR", by.y = "DatesR", all = TRUE)
But in this case, the help of the function must emphase the necessity to correctly deal with dates and make sure that the same periods are used in Q and in s_sb.
