Smoothing() crashes when working with a runmeanlen as long as the number of available timesteps and the result is wrong when 'runmeanlen' is odd
Hello @vguemas ,
Valentina reported that the PLOT job crashed in some cases (see issue #136). The conclusion is that there is a bug in Smoothing() that makes it crash when the requested 'runmeanlen' is as long as the number of available timesteps.
I was trying to fix it to include to the next release (I'm trying to have it ready for this night), as well as to generalise it to work on arrays of any number of dimensions and to be a bit more efficient (it goes all together).
However, I've seen in the code that it's coded to work only with even 'runmeanlen'. If the 'runmeanlen' is odd, the values at the extremes will be divided by 2 but it shouldn't happen. See the lines 17, 21, 30, 32 and 41 in the file https://earth.bsc.es/gitlab/es/s2dverification/blob/dc5edb405e69049943ae8d9fb4a910614dbc8019/R/Smoothing.R
If you confirm this is right I will proceed to divide by 2 only when the 'runmeanlen' is even.