Skip to content

CFSv2 NetCDF4 Index Out of Bounds Issue #19

@btickell

Description

@btickell

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions