You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering a bug when using rangeFill to generate T/F layers for a given year of data when a range goes beyond the limit value. When circular = F in the options, the cells do not generate, as expected, but when circular = T the cells display as true even beyond their expected limits (first:limit, 1:end).
At layer 181, neither 270:1 nor 360:90 should appear as TRUE as they are beyond their range. As expected, they do not appear when circular is set to FALSE. This anomalous behaviour is confirmed by checking the sum of the layers:
plot(sum(t))
Where both cells whose ranges are circular report as having a sum of 365.
The text was updated successfully, but these errors were encountered:
library(terra)
#terra 1.7.74
x <- y <- rast(ncol=2, nrow=2)
values(x) <- c(NA, c(1, 5, 6))
values(y) <- c(NA, c(4, 1, 2))
rangeFill(c(x, y), 8) |> values()
# lyr1 lyr2 lyr3 lyr4 lyr5 lyr6 lyr7 lyr8
#[1,] NaN NaN NaN NaN NaN NaN NaN NaN
#[2,] 1 1 1 1 0 0 0 0
#[3,] NaN NaN NaN NaN NaN NaN NaN NaN
#[4,] NaN NaN NaN NaN NaN NaN NaN NaN
rangeFill(c(x, y), 8, circular=TRUE) |> values()
# lyr1 lyr2 lyr3 lyr4 lyr5 lyr6 lyr7 lyr8
#[1,] NaN NaN NaN NaN NaN NaN NaN NaN
#[2,] 1 1 1 1 0 0 0 0
#[3,] 1 0 0 0 1 1 1 1
#[4,] 1 1 0 0 0 1 1 1
I'm encountering a bug when using
rangeFill
to generate T/F layers for a given year of data when a range goes beyond the limit value. Whencircular = F
in the options, the cells do not generate, as expected, but whencircular = T
the cells display as true even beyond their expected limits (first:limit, 1:end).I managed to capture this behaviour in a small example:
At layer 181, neither 270:1 nor 360:90 should appear as TRUE as they are beyond their range. As expected, they do not appear when circular is set to FALSE. This anomalous behaviour is confirmed by checking the sum of the layers:
Where both cells whose ranges are circular report as having a sum of 365.
The text was updated successfully, but these errors were encountered: