In [51]:
from owslib.wps import WebProcessingService
token = 'a890731658ac4f1ba93a62598d2f2645'
headers = {'Access-Token': token}
wps = WebProcessingService("https://bovec.dkrz.de/ows/proxy/hummingbird", verify=False, headers=headers)


/home/pingu/.conda/envs/demo/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)

Show available processes


In [52]:
for process in wps.processes:
    print process.identifier,":", process.title


ncmeta : NetCDF Metadata
cdo_sinfo : CDO sinfo
cdo_lonlatbox : CDO select lon/lat box
cdo_operation : CDO Operation
ensembles : CDO Ensembles Operations
cfchecker : CF Checker by NCAS Computational Modelling Services (NCAS-CMS)
qa_cfchecker : CF Checker by DKRZ
qa_checker : Quality Assurance Checker by DKRZ
ioos_cchecker : IOOS Compliance Checker

Show details about qa_cfchecker process


In [53]:
process = wps.describeprocess(identifier='qa_cfchecker')
for inp in process.dataInputs:
    print inp.identifier, ":", inp.title, ":", inp.dataType


/home/pingu/.conda/envs/demo/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)
dataset : URL to your NetCDF File : ComplexData
cf_version : Check against CF version : //www.w3.org/TR/xmlschema-2/#string

Check file available on http service


In [68]:
inputs = [('dataset', 'http://bovec.dkrz.de:8090/wpsoutputs/hummingbird/output-b9855b08-42d8-11e6-b10f-abe4891050e3.nc')]
execution = wps.execute(identifier='qa_cfchecker', inputs=inputs, output='output', async=False)
print execution.status


/home/pingu/.conda/envs/demo/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)
ProcessSucceeded

In [69]:
for out in execution.processOutputs:
    print out.title, out.reference


CF Checker Report http://bovec.dkrz.de:8090/wpsoutputs/hummingbird/output-c050121a-42d9-11e6-b10f-abe4891050e3.txt

Prepare local file to send to service

To send a local file with the request the file needs to be base64 encoded.


In [70]:
from owslib.wps import ComplexDataInput
import base64
fp = open("/home/pingu/tmp/input2.nc", 'r')
text = fp.read()
fp.close()
encoded = base64.b64encode(text)
content = ComplexDataInput(encoded)
inputs = [ ('dataset', content) ]

In [71]:
execution = wps.execute(identifier='qa_cfchecker', inputs=inputs, output='output', async=False)
print execution.status


/home/pingu/.conda/envs/demo/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)
ProcessSucceeded

In [72]:
for out in execution.processOutputs:
    print out.title, out.reference


CF Checker Report http://bovec.dkrz.de:8090/wpsoutputs/hummingbird/output-c8810a84-42d9-11e6-b10f-abe4891050e3.txt

In [ ]: