In [4]:
from pyesgf.logon import LogonManager
lm = LogonManager()
lm.logoff()
lm.is_logged_on()
Out[4]:
In [6]:
lm.logon(hostname="esgf-data.dkrz.de", bootstrap=True, interactive=True)
In [8]:
lm.is_logged_on()
Out[8]:
In [9]:
import requests
In [10]:
file_url = 'http://esgf1.dkrz.de/thredds/fileServer/cordex/cordex/output/EUR-44/MPI-CSC/MPI-M-MPI-ESM-LR/historical/r1i1p1/MPI-CSC-REMO2009/v1/mon/tas/v20150609/tas_EUR-44_MPI-M-MPI-ESM-LR_historical_r1i1p1_MPI-CSC-REMO2009_v1_mon_200101-200512.nc'
In [11]:
headers = {
'user-agent': 'requests',
'connection': 'close'
}
See pydap example, requests_pydap/http.py:
In [12]:
"""
cmd = ["wget"]
cmd.extend(["--certificate", credentials])
cmd.extend(["--private-key", credentials])
cmd.extend(["--ca-certificate", credentials])
cmd.append("--no-check-certificate")
"""
Out[12]:
In [13]:
cert = '/Users/pingu/.esg/credentials.pem'
ca_certs = '/Users/pingu/.esg/certificates'
response = requests.get(
file_url,
cert=(cert, cert),
verify=ca_certs,
headers=headers,
allow_redirects=True,
timeout=120)
In [14]:
response.ok
Out[14]:
In [15]:
response.headers
Out[15]:
In [ ]: