Hi fellows!
How can I use pydap client to have access to a thredds server?
I tried:
hycom = open_url('
http://hycom.coaps.fsu.edu:8080/thredds/dodsC/
glb_analysis')
... and got:
---------------------------------------------------------------------------
error Traceback (most recent call
last)
/home/cl80/Projetos/xbt/src/python/geovel.py in <module>()
----> 1
2
3
4
5
/usr/lib/python2.5/site-packages/Pydap-3.0.b.4-py2.5.egg/pydap/
client.pyc in open_url(url)
58 """
59 for response in [_ddx, _ddsdas]:
---> 60 dataset = response(url)
61 if dataset: break
62 else:
/usr/lib/python2.5/site-packages/Pydap-3.0.b.4-py2.5.egg/pydap/
client.pyc in _ddsdas(url)
196 (scheme, netloc, path + '.das', query, fragment))
197
--> 198 respdds, dds = request(ddsurl)
199 respdas, das = request(dasurl)
200
/usr/lib/python2.5/site-packages/Pydap-3.0.b.4-py2.5.egg/pydap/util/
http.pyc in request(url)
39
log.info('Opening %s' % url)
40 resp, data = h.request(url, "GET",
---> 41 headers = {'user-agent': pydap.lib.USER_AGENT})
42
43 # When an error is returned, we parse the error message
from the
/var/lib/python-support/python2.5/httplib2/__init__.pyc in request
(self, uri, method, body, headers, redirections, connection_type)
1048 content = new_content
1049 else:
-> 1050 (response, content) = self._request(conn,
authority, uri, request_uri, method, body, headers, redirections,
cachekey)
1051 except Exception, e:
1052 if self.force_exception_to_status_code:
/var/lib/python-support/python2.5/httplib2/__init__.pyc in _request
(self, conn, host, absolute_uri, request_uri, method, body, headers,
redirections, cachekey)
852 auth.request(method, request_uri, headers, body)
853
--> 854 (response, content) = self._conn_request(conn,
request_uri, method, body, headers)
855
856 if auth:
/var/lib/python-support/python2.5/httplib2/__init__.pyc in
_conn_request(self, conn, request_uri, method, body, headers)
821 for i in range(2):
822 try:
--> 823 conn.request(method, request_uri, body,
headers)
824 response = conn.getresponse()
825 except socket.gaierror:
/usr/lib/python2.5/httplib.pyc in request(self, method, url, body,
headers)
864
865 try:
--> 866 self._send_request(method, url, body, headers)
867 except socket.error, v:
868 # trap 'Broken pipe' if we're allowed to
automatically reconnect
/usr/lib/python2.5/httplib.pyc in _send_request(self, method, url,
body, headers)
887 for hdr, value in headers.iteritems():
888 self.putheader(hdr, value)
--> 889 self.endheaders()
890
891 if body:
/usr/lib/python2.5/httplib.pyc in endheaders(self)
858 raise CannotSendHeader()
859
--> 860 self._send_output()
861
862 def request(self, method, url, body=None, headers={}):
/usr/lib/python2.5/httplib.pyc in _send_output(self)
730 msg = "\r\n".join(self._buffer)
731 del self._buffer[:]
--> 732 self.send(msg)
733
734 def putrequest(self, method, url, skip_host=0,
skip_accept_encoding=0):
/usr/lib/python2.5/httplib.pyc in send(self, str)
697 if self.sock is None:
698 if self.auto_open:
--> 699 self.connect()
700 else:
701 raise NotConnected()
/var/lib/python-support/python2.5/httplib2/__init__.pyc in connect
(self)
713 break
714 if not self.sock:
--> 715 raise socket.error, msg
716
717 class HTTPSConnectionWithTimeout(httplib.HTTPSConnection):
error: (111, 'Connection refused')
-----------------------------------------------------------------------------------------------------------------
Thanks for your attention.
L. Alexandre Guerra