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

CFSv2 NetCDF4 Index Out of Bounds Issue #19

Open
btickell opened this issue Mar 18, 2022 · 1 comment
Open

CFSv2 NetCDF4 Index Out of Bounds Issue #19

btickell opened this issue Mar 18, 2022 · 1 comment

Comments

@btickell
Copy link

I am trying to access the SubX CFSv2 temperature forecasts used in this project in order to do some slightly different preprocessing and am running into an error with the netCDF4 back-end of xarray.

import xarray as xa
x = xa.open_dataset(
  "https://iridl.ldeo.columbia.edu/SOURCES/.Models/.SubX/.NCEP/.CFSv2/.forecast/.tas/dods",
    decode_times=False,
)
x['tas'][0, :, :, :, :].data 

causes the following error

File src/netCDF4/_netCDF4.pyx:4406, in netCDF4._netCDF4.Variable.__getitem__()

File src/netCDF4/_netCDF4.pyx:5348, in netCDF4._netCDF4.Variable._get()

IndexError: index exceeds dimension bounds

This also occurs when simply trying to access the data as x['tas'].data

Is this a good way to go about this? It seems the scripts here are running into the issue mentioned in #18

Thanks!

@kdl0013
Copy link

kdl0013 commented Mar 24, 2022

@btickell you actually got further along with downloading data from that link than I did. I tried your code on my computer and have the same issues with you. It's a very large file which may have some part in the issue??? The data I downloaded for GEOS (with the script in #18) were daily data, but I had to figure out which days were actually the initialized days because all the other files were filled with np.nan. It appears that you have the entire time series because with GMAO GEOS-5, there were only 1239 initialized days. Your current script has creates 6456 days (which may be unrealistic for CFSv2).

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