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

When length(dvar)==1 #39

Closed
Mattriks opened this issue Apr 16, 2020 · 1 comment
Closed

When length(dvar)==1 #39

Mattriks opened this issue Apr 16, 2020 · 1 comment

Comments

@Mattriks
Copy link
Contributor

I'm trying out GeoData.jl (master). I have a NetCDF file with 4 dims (lat,lon,time, and lev). lev only has 1 level (Vertical=20000.0).

using NCDatasets
ds = Dataset(filename)
dvar = ds["lev"] # length(dvar)==1
dvar[2]

NetCDF error: NetCDF: Index exceeds dimension bound (NetCDF error code: -40)

In GeoData, that error happens on this line.
I get the error with commit 9c2f79f, but not with commit 309aa76 (because of the correction in L240, which I know is necessary).

@rafaqz
Copy link
Owner

rafaqz commented Apr 16, 2020

Ok that's just a typo, those lines should be inside the length check. Fixed on master.

I hadn't tested for dim of length 1.

@rafaqz rafaqz closed this as completed Apr 21, 2020
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

2 participants