Closed bpbond closed 10 years ago
Thanks for letting me know, I was just starting to poke at the 'extract dim names' issue.
FYI we may want to turn off the 'collapse_degen' flag in ncvar_get. This could solve the one time stamp issue.
The function 'nc.get.dim.names' is in the package 'ncdf4.helpers' and returns the names of the dimensions of a nc variable.
But it looks like both my suggestions break with ncdf... At this point I'm very tempted to just hack it with dimension length matching.
Seems like a one-liner gets the dimension names reliably
dimNames <- unlist(lapply(nc$var[[variable]]$dim, FUN=function(x) { x$name }))
…anyway thanks for holding off, I'm going to do some work on this now and will then sync up.
collapse_degen! Missed that! Great, I'll make that change.
…the problem is that this option is not available in the ncdf package, which we've said we want to support. So actually I'm going to leave things as is, with short snippet of code that re-inserts missing dimensions if necessary.
loadEnsemble now handles 'plev' files correctly, as well as any other odd dimension names, by reading those names directly from the netcdf file, instead of assuming them. See commit fff554c4. There's one exception though, and I'm about open an issue.
KTB - I'm going to make some big changes to loadEnsemble…if possible don't touch that today, just for merging ease later. Thanks.