title: PyDap and Xarray remote access to LP DAAC
body: <p>I would like to use xarray/pydap for remote access of data on the <a href="https://ladsweb.modaps.eosdis.nasa.gov/" rel="nofollow noreferrer">LP DAAC</a> OpeNDAP server.</p>
  
  <p>I have an earth data account (username and password - <a href="https://urs.earthdata.nasa.gov/" rel="nofollow noreferrer">login page</a>), and I have added the LP DAAC OpeNDAP application to my list of approved applications.</p>
  
  <p>Below is my effort to access the data. Has anyone else been able to access data via opendap from LP DAAC? Is my url correct? Does this look like a server side (opendap) issue?</p>
  
  <p>Example Code:</p>
  
  <pre><code>from pydap.client import open_url
  from pydap.cas.urs import setup_session
  import xarray as xr
  
  dataset_url = 'https://opendap.cr.usgs.gov/opendap/hyrax/MOD13Q1.006/h00v08.ncml.nc4'
  
  ### Replace with your username and password
  session = setup_session('XXXX', 'XXXXXX', check_url=dataset_url)
  store = xr.backends.PydapDataStore.open(dataset_url, session=session)
  ds = xr.open_dataset(store)
  
  ---------------------------------------------------------------------------
  HTTPError                                 Traceback (most recent call last)
  &lt;ipython-input-5-0ddf552f3174&gt; in &lt;module&gt;
  ----&gt; 1 store = xr.backends.PydapDataStore.open(dataset_url, session=session)
        2 ds = xr.open_dataset(store)
  
  /opt/conda/lib/python3.7/site-packages/xarray/backends/pydap_.py in open(cls, url, session)
       71     def open(cls, url, session=None):
       72         import pydap.client
  ---&gt; 73         ds = pydap.client.open_url(url, session=session)
       74         return cls(ds)
       75 
  
  /opt/conda/lib/python3.7/site-packages/pydap/client.py in open_url(url, application, session, output_grid, timeout)
       65     """
       66     dataset = DAPHandler(url, application, session, output_grid,
  ---&gt; 67                          timeout).dataset
       68 
       69     # attach server-side functions
  
  /opt/conda/lib/python3.7/site-packages/pydap/handlers/dap.py in __init__(self, url, application, session, output_grid, timeout)
       52         ddsurl = urlunsplit((scheme, netloc, path + '.dds', query, fragment))
       53         r = GET(ddsurl, application, session, timeout=timeout)
  ---&gt; 54         raise_for_status(r)
       55         if not r.charset:
       56             r.charset = 'ascii'
  
  /opt/conda/lib/python3.7/site-packages/pydap/net.py in raise_for_status(response)
       37             detail=response.status+'\n'+response.text,
       38             headers=response.headers,
  ---&gt; 39             comment=response.body
       40         )
       41 
  
  HTTPError: 404 Not Found
  
  
  
  
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;
      &lt;link rel='stylesheet' href='/opendap/docs/css/contents.css' type='text/css'/&gt;
      &lt;title&gt;Hyrax: Resource Not Found&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;p align="left"&gt;&amp;nbsp;&lt;/p&gt;
  
  &lt;h1 align="center"&gt;Hyrax - Resource Not Found (404) &lt;/h1&gt;
  &lt;hr align="left" size="1" noshade="noshade"/&gt;
  &lt;table width="100%" border="0"&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;a href="/opendap/docs/images/largeEarth.jpg"&gt;
              &lt;img src="/opendap/docs/images/smallEarth.jpg"
                   alt="I looked everywhere!"
                   title="I looked everywhere!"
                   border="0"/&gt;
              &lt;/a&gt;
          &lt;/td&gt;
  
          &lt;td&gt;
              &lt;p align="left"&gt;The URL requested does not describe a resource that can be found on this server.&lt;/p&gt;
  
              &lt;p align="left"&gt;If you would like to start at the top level of this server, go &lt;a
                      href="/opendap/"&gt;&lt;strong&gt;HERE&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
  
  
              &lt;p align="left"&gt;The specific error message associated with your request was:&lt;/p&gt;
              &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;Failed to locate resource: /MOD13Q1.006/h00v08.ncml.nc4.dds &lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;
  
              &lt;p align="left"&gt;If you think that the server is broken (that the URL you submitted should have worked),
                  then please contact the OPeNDAP user support coordinator at: &lt;a href="mailto:lpdaac@usgs.gov"&gt;lpdaac@usgs.gov&lt;/a&gt;
              &lt;/p&gt;
  
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;hr align="left" size="1" noshade="noshade"/&gt;
  &lt;h1 align="center"&gt;Hyrax - Resource Not Found (404) &lt;/h1&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Version information:</p>
  
  <pre><code>xr.show_versions()
  INSTALLED VERSIONS
  ------------------
  commit: None
  python: 3.7.3 | packaged by conda-forge | (default, Mar 27 2019, 23:01:00) 
  [GCC 7.3.0]
  python-bits: 64
  OS: Linux
  OS-release: 4.4.0-150-generic
  machine: x86_64
  processor: x86_64
  byteorder: little
  LC_ALL: en_US.UTF-8
  LANG: en_US.UTF-8
  LOCALE: en_US.UTF-8
  libhdf5: 1.10.4
  libnetcdf: 4.6.2
  
  xarray: 0.12.1
  pandas: 0.24.2
  numpy: 1.15.4
  scipy: 1.2.1
  netCDF4: 1.5.1.2
  pydap: installed
  h5netcdf: None
  h5py: 2.9.0
  Nio: None
  zarr: 2.3.2
  cftime: 1.0.3.4
  nc_time_axis: None
  PseudonetCDF: None
  rasterio: 1.0.24
  cfgrib: None
  iris: None
  bottleneck: 1.2.1
  dask: 1.2.2
  distributed: 1.28.0
  matplotlib: 3.0.3
  cartopy: 0.17.0
  seaborn: 0.9.0
  setuptools: 41.0.1
  pip: 19.1.1
  conda: 4.6.14
  pytest: None
  IPython: 7.5.0
  sphinx: None
  </code></pre>