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
{{ message }}
Repository navigation
cd_extract(): an area on sea cells only returns NaN without a warning #153
cd_extract() returns NaN with no warning for an area that falls entirely on ERA5-Land's sea cells. ERA5-Land has no values over the ocean (10,835 of the 31,581 cells in the live tmean_annual COG are NA), and cd_crop() (terra::crop(snap = "out", mask = TRUE), R/cd_crop.R:36) followed by global(mean, na.rm = TRUE) (R/cd_extract.R:77) gives NaN when every cell is NA.
Measured on the live catalog: a 0.02° polygon on Triangle Island (-129.08, 50.86) returns NaN for every year, silently. A 0.01° polygon inland near Squamish returns a value, because a polygon smaller than a cell picks up the cell it touches.
cd_extract_daily() already handles the point case: a point in a sea cell moves to the nearest land cell and is flagged cell_moved.
Proposed
Warn, naming the area, when an extract has no land cells; or follow cd_extract_daily() and take the nearest land cell, flagged. Found while reviewing the README tagline for #142.
Activity