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

crazy dimvals #8

Open
mdsumner opened this issue Jun 5, 2017 · 1 comment
Open

crazy dimvals #8

mdsumner opened this issue Jun 5, 2017 · 1 comment

Comments

@mdsumner
Copy link
Member

mdsumner commented Jun 5, 2017

A GW file has both dimvals that are length-1 characters with all sorts (surely not intended to be used as dim-vals ever), but also one has a matrix in there.

Dealing with it like this, ignore the character ones (save for some uber future hierachical record) and flatten the matrix ones.

I've seen these character ones before, but never a matrix like this. Want to know if it's common, as it has implications for the general interpretation of curvlinear coordinates.

weird_char_dimvals <- unlist(lapply(nc$dim, function(x) is.character(x$vals)))
    dimension_values <- dplyr::bind_rows(
    lapply(nc$dim[!weird_char_dimvals], function(x) {
      ## some of these are matrices
      tibble::tibble(id = rep(x$id, length(x$vals)), vals = as.vector(x$vals))
    })
    )

ncdump::NetCDF needs a serious rework anyway, and this bogey has been hiding in the cave for a long time

@mdsumner
Copy link
Member Author

mdsumner commented Jun 5, 2017

This means that the vardim link will contain NAs, so either for now we have to treat those variables as unsupported. Or fix it properly.

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