Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stars testing #5

Open
mdsumner opened this issue Jan 24, 2019 · 0 comments
Open

stars testing #5

mdsumner opened this issue Jan 24, 2019 · 0 comments

Comments

@mdsumner
Copy link
Collaborator

files <- fs::dir_ls("../rasterwise/extdata/", recursive = TRUE, glob = "*.nc")
x <- purrr::map(files, purrr::possibly(read_ncdf, NULL))
bad <- purrr::map_lgl(x, is.null)
sum(bad)  ## 1 is bad, for some reason the 1-dim first dimension of /rasterwise/extdata/R13352.nc is
          ## dropped even is collapse = FALSE (not TRUE for basic other cases)

ebad <- logical(length(bad))

for (i in seq_along(files)) {
  if (bad[i]) next;
  x <- purrr::map(ncmeta::nc_vars(files[i])$name, 
                  ~purrr::safely(read_ncdf)(files[i], var = .x))
  ibad <- purrr::map_lgl(x, ~!is.null(.x$error))
  if (any(ibad)) ebad[i] <- TRUE
}




Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant