Crossval_metrics issue with Nans after interpolation
Hi @nperez (FYI @nmilders @eduzenli @vtorralba ),
I'm doing tests on the workstation under the branch dev-test_bigpredidata, using the downscaling and crossval modules through this script and this recipe (please note that most of the fields from the recipe get overriden by the script).
After doing interpolating Nans appear at the edges, which make the RPS and RPSS functions fail despite the na.rm = TRUE. Eren came across a solution to for this method (thanks!). A different interpolation method would also fix the issue (i.e. conservative), but in the case that there is all NA data and na.rm = 1 the functions fail.
RPSS:
Line 492: if (f_NAs <= sum(good_values) / length(good_values)) { is edited into
if ((!all(good_values == FALSE)) & (f_NAs <= sum(good_values) / length(good_values))) {
Line 542: if (f_NAs <= sum(good_values) / length(good_values)) { is edited into
if ((!all(good_values == FALSE)) & (f_NAs <= sum(good_values) / length(good_values))) {
RPS:
Line 337: if (f_NAs <= sum(good_values) / length(obs_mean)) { is edited into
if ((!all(good_values == FALSE)) & (f_NAs <= sum(good_values) / length(obs_mean))) {
Could you please have a look at this issue? Has anyone else encountered anything similar?
Many thanks,
Paloma