home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 291926319

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
291926319 MDU6SXNzdWUyOTE5MjYzMTk= 1860 IndexError when accesing a data variable through a PydapDataStore 10137 closed 0     4 2018-01-26T14:58:14Z 2018-01-27T08:41:21Z 2018-01-27T08:41:21Z NONE      

Code Sample, a copy-pastable example if possible

python import xarray as xa from pydap.cas.urs import setup_session url = 'https://goldsmr4.gesdisc.eosdis.nasa.gov/dods/M2T1NXFLX' session = setup_session(username='****', password='****', check_url=url) store = xa.backends.PydapDataStore.open(url, session=session) ds = xa.open_dataset(store) tlml = ds['tlml'] print(tlml[0,0,0])

Problem description

I was trying to connect to NASA MERRA-2 data through OPeNDAP, following the documentation here: http://xarray.pydata.org/en/stable/io.html#OPeNDAP. Opening the dataset works fine, but trying to access a data variable throws a strange IndexError. Traceback below: ``` Traceback (most recent call last):

File "C:\Anaconda3\envs\jaws\lib\site-packages\IPython\core\formatters.py", line 702, in call printer.pretty(obj) File "C:\Anaconda3\envs\jaws\lib\site-packages\IPython\lib\pretty.py", line 395, in pretty return default_pprint(obj, self, cycle) File "C:\Anaconda3\envs\jaws\lib\site-packages\IPython\lib\pretty.py", line 510, in _default_pprint _repr_pprint(obj, p, cycle) File "C:\Anaconda3\envs\jaws\lib\site-packages\IPython\lib\pretty.py", line 701, in _repr_pprint output = repr(obj) File "c:\src\xarray\xarray\core\common.py", line 100, in __repr__ return formatting.array_repr(self) File "c:\src\xarray\xarray\core\formatting.py", line 393, in array_repr summary.append(short_array_repr(arr.values)) File "c:\src\xarray\xarray\core\dataarray.py", line 411, in values return self.variable.values File "c:\src\xarray\xarray\core\variable.py", line 392, in values return _as_array_or_item(self._data) File "c:\src\xarray\xarray\core\variable.py", line 216, in _as_array_or_item data = np.asarray(data) File "C:\Anaconda3\envs\jaws\lib\site-packages\numpy\core\numeric.py", line 492, in asarray return array(a, dtype, copy=False, order=order) File "c:\src\xarray\xarray\core\indexing.py", line 572, in __array__ self._ensure_cached() File "c:\src\xarray\xarray\core\indexing.py", line 569, in _ensure_cached self.array = NumpyIndexingAdapter(np.asarray(self.array)) File "C:\Anaconda3\envs\jaws\lib\site-packages\numpy\core\numeric.py", line 492, in asarray return array(a, dtype, copy=False, order=order) File "c:\src\xarray\xarray\core\indexing.py", line 553, in __array__ return np.asarray(self.array, dtype=dtype) File "C:\Anaconda3\envs\jaws\lib\site-packages\numpy\core\numeric.py", line 492, in asarray return array(a, dtype, copy=False, order=order) File "c:\src\xarray\xarray\core\indexing.py", line 520, in __array__ return np.asarray(array[self.key], dtype=None) File "c:\src\xarray\xarray\conventions.py", line 134, in __getitem__ return np.asarray(self.array[key], dtype=self.dtype) File "c:\src\xarray\xarray\coding\variables.py", line 71, in __getitem__ return self.func(self.array[key]) File "c:\src\xarray\xarray\coding\variables.py", line 140, in _apply_mask data = np.asarray(data, dtype=dtype) File "C:\Anaconda3\envs\jaws\lib\site-packages\numpy\core\numeric.py", line 492, in asarray return array(a, dtype, copy=False, order=order) File "c:\src\xarray\xarray\core\indexing.py", line 520, in __array__ return np.asarray(array[self.key], dtype=None) File "c:\src\xarray\xarray\backends\pydap.py", line 33, in getitem result = robust_getitem(array, key, catch=ValueError) File "c:\src\xarray\xarray\backends\common.py", line 67, in robust_getitem return array[key] File "C:\src\pydap\src\pydap\model.py", line 320, in getitem out.data = self._get_data_index(index) File "C:\src\pydap\src\pydap\model.py", line 350, in _get_data_index return self._data[index] File "C:\src\pydap\src\pydap\handlers\dap.py", line 149, in getitem return dataset[self.id].data File "C:\src\pydap\src\pydap\model.py", line 426, in getitem return self._getitem_string(key) File "C:\src\pydap\src\pydap\model.py", line 410, in _getitem_string return self[splitted[0]]['.'.join(splitted[1:])] File "C:\src\pydap\src\pydap\model.py", line 320, in getitem out.data = self._get_data_index(index) File "C:\src\pydap\src\pydap\model.py", line 350, in _get_data_index return self._data[index] IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices ```

Expected Output

Expecting to see the value of variable 'tlml' at these coordinates.

Output of xr.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 3.6.4.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 61 Stepping 4, GenuineIntel
byteorder: little
LC_ALL: None
LANG: en
LOCALE: None.None

xarray: 0.10.0+dev44.g0a0593d
pandas: 0.22.0
numpy: 1.14.0
scipy: 1.0.0
netCDF4: 1.3.1
h5netcdf: 0.5.0
Nio: None
zarr: None
bottleneck: 1.2.1
cyordereddict: None
dask: 0.16.1
distributed: 1.20.2
matplotlib: None
cartopy: None
seaborn: None
setuptools: 38.4.0
pip: 9.0.1
conda: None
pytest: None
IPython: 6.2.1
sphinx: 1.6.6

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1860/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 4 rows from issue in issue_comments
Powered by Datasette · Queries took 156.802ms · About: xarray-datasette