-
Notifications
You must be signed in to change notification settings - Fork 28
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
Is there a way to return list of variables in netcdf? #181
Comments
The NcFile type returned by nc = NetCDF.open(p)
varnames = keys(nc.vars) This will include all variables including dimension variables. Also, if you want to make sure the NetCDF file gets immediately closed after the query and not only when gc is triggered you can use the do-syntax. So the following would return all variable names that are not a dimension name at the same time and make sure the file is immediately closed again. NetCDF.open(p) do nc
setdiff(keys(nc.vars),keys(nc.dim))
end |
I have a netcdf file and I want to programmatically determine the list of variables contained in the file. The only utility I could identify is NetCDF.info but it just prints a bunch of info to screen.
The text was updated successfully, but these errors were encountered: