home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 582226104

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/1068#issuecomment-582226104 https://api.github.com/repos/pydata/xarray/issues/1068 582226104 MDEyOklzc3VlQ29tbWVudDU4MjIyNjEwNA== 1197350 2020-02-05T03:38:52Z 2020-02-05T03:38:52Z MEMBER

I am trying to load MERRA2 data via the NASA password-protected opendap server. Although it sounds like both pydap and xarray have been fixed to support this, I still am having basically the same problem @jenfly described over three years ago. At this point it feels like a pydap issue, but I ask on this thread anyway.

Here's a fully reproducible example, password and all 😄

```python from pydap.client import open_url from pydap.cas.urs import setup_session

username = 'rabernat' password = '%8rTMU6VT37r&%3e' url = 'https://goldsmr5.gesdisc.eosdis.nasa.gov:443/opendap/MERRA2_MONTHLY/M2IMNPANA.5.12.4/2019/MERRA2_400.instM_3d_ana_Np.201901.nc4'

session = setup_session(username, password, check_url=url) dataset = open_url(url, session=session) assert 'USVS' in dataset _ = dataset['USVS'][:] raises


HTTPError Traceback (most recent call last) <ipython-input-7-56bfca618586> in <module> ----> 1 _ = dataset['USVS'][:]

/srv/conda/envs/notebook/lib/python3.7/site-packages/pydap/model.py in getitem(self, index) 318 def getitem(self, index): 319 out = copy.copy(self) --> 320 out.data = self._get_data_index(index) 321 return out 322

/srv/conda/envs/notebook/lib/python3.7/site-packages/pydap/model.py in _get_data_index(self, index) 347 return np.vectorize(decode_np_strings)(self._data[index]) 348 else: --> 349 return self._data[index] 350 351 def _get_data(self):

/srv/conda/envs/notebook/lib/python3.7/site-packages/pydap/handlers/dap.py in getitem(self, index) 140 logger.info("Fetching URL: %s" % url) 141 r = GET(url, self.application, self.session, timeout=self.timeout) --> 142 raise_for_status(r) 143 dds, data = r.body.split(b'\nData:\n', 1) 144 dds = dds.decode(r.content_encoding or 'ascii')

/srv/conda/envs/notebook/lib/python3.7/site-packages/pydap/net.py in raise_for_status(response) 37 detail=response.status+'\n'+response.text, 38 headers=response.headers, ---> 39 comment=response.body 40 ) 41

HTTPError: 302 Found

<html><head> <title>302 Found</title> </head><body>

Found

The document has moved here.

</body></html>

```

Is this a problem with pydap? Or the NASA server?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  186169975
Powered by Datasette · Queries took 80.328ms · About: xarray-datasette