In [1]:
import requests

In [23]:
token = "53cb2e327d894fd0b927dab7a33ed5f2"

In [3]:
#opendap_url = "http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis2.dailyavgs/surface/mslp.2006.nc"
opendap_url = "http://esg-dn1.nsc.liu.se/thredds/dodsC/esg_dataroot1/cordexdata/cordex/output/EUR-44/SMHI/CCCma-CanESM2/historical/r1i1p1/SMHI-RCA4/v1/mon/tasmax/v20130927/tasmax_EUR-44_CCCma-CanESM2_historical_r1i1p1_SMHI-RCA4_v1_mon_199101-200012.nc"
#opendap_url = "http://esg-dn1.nsc.liu.se/thredds/dodsC/esg_dataroot2/cmip5data/cmip5/output1/SMHI/EC-EARTH/decadal1970/mon/atmos/Amon/r1i3p1/v20140318/tasmax/tasmax_Amon_EC-EARTH_decadal1970_r1i3p1_197101-198012.nc"

In [4]:
req_url = "https://localhost:5000/ows/wps?version=1.0.0&service=wps&request=describeprocess&identifier=hello"

In [5]:
response = requests.get(req_url, verify=False)


/home/pingu/.conda/envs/twitcher/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:843: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)

In [7]:
print response.text


<!-- PyWPS 4.0.0 -->
<wps:ProcessDescriptions xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsDescribeProcess_response.xsd" service="WPS" version="1.0.0" xml:lang="en-US">
  <ProcessDescription wps:processVersion="1.4" storeSupported="true" statusSupported="true">
    <ows:Identifier>hello</ows:Identifier>
    <ows:Title>Say Hello</ows:Title>
    <DataInputs>
      <Input minOccurs="1" maxOccurs="1">
        <ows:Identifier>name</ows:Identifier>
        <ows:Title>Your name</ows:Title>
        <LiteralData>
          <ows:DataType ows:reference="urn:ogc:def:dataType:OGC:1.1:string">string</ows:DataType>
          <ows:AnyValue/>
        </LiteralData>
      </Input>
    </DataInputs>
    <ProcessOutputs>
      <Output>
        <ows:Identifier>output</ows:Identifier>
        <ows:Title>Output response</ows:Title>
        <LiteralOutput>
          <ows:DataType ows:reference="urn:ogc:def:dataType:OGC:1.1:string">string</ows:DataType>
        </LiteralOutput>
      </Output>
    </ProcessOutputs>
  </ProcessDescription>
</wps:ProcessDescriptions>


In [24]:
req_url = "https://localhost:5000/ows/wps?version=1.0.0&service=wps&request=execute&identifier=hello"

In [25]:
response = requests.get(req_url+"&token="+token+"&datainputs=name=tux", verify=False)


/home/pingu/.conda/envs/twitcher/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:843: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)

In [26]:
print response.text


<!-- PyWPS 4.0.0 -->
<wps:ExecuteResponse xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsExecute_response.xsd" service="WPS" version="1.0.0" xml:lang="en-US" serviceInstance="https://localhost:5000/ows/wps?service=WPS&amp;request=GetCapabilities" statusLocation="file:///tmp/2a6bf1ee-d81e-11e6-ab9a-68f72837e1b4.xml">
  <wps:Process wps:processVersion="1.4">
    <ows:Identifier>hello</ows:Identifier>
    <ows:Title>Say Hello</ows:Title>
  </wps:Process>
  <wps:Status creationTime="2017-01-11T17:51:15Z">
    <wps:ProcessSucceeded>PyWPS Process Say Hello finished</wps:ProcessSucceeded>
  </wps:Status>
  <wps:ProcessOutputs>
    <wps:Output>
      <ows:Identifier>output</ows:Identifier>
      <ows:Title>Output response</ows:Title>
      <wps:Data>
        <wps:LiteralData dataType="urn:ogc:def:dataType:OGC:1.1:string">Hello tux</wps:LiteralData>
      </wps:Data>
    </wps:Output>
  </wps:ProcessOutputs>
</wps:ExecuteResponse>


In [27]:
ext_req_url = "https://localhost:5000/ows/proxy/hummingbird?version=1.0.0&service=wps&request=execute&identifier=ncdump"

In [28]:
response = requests.get(ext_req_url+"&token="+token+"&datainputs=dataset_opendap="+opendap_url, verify=False)


/home/pingu/.conda/envs/twitcher/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:843: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)

In [29]:
print response.text


<!-- PyWPS 4.0.0 -->
<wps:ExecuteResponse xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsExecute_response.xsd" service="WPS" version="1.0.0" xml:lang="en-US" serviceInstance="https://localhost:5000/ows/proxy/hummingbird?service=WPS&amp;request=GetCapabilities" statusLocation="http://localhost:8090/wpsoutputs/hummingbird/40ab0d28-d81e-11e6-b5b4-68f72837e1b4.xml">
  <wps:Process wps:processVersion="4.4.1">
    <ows:Identifier>ncdump</ows:Identifier>
    <ows:Title>NCDump</ows:Title>
    <ows:Abstract>Run ncdump to retrieve netcdf header metadata.</ows:Abstract>
  </wps:Process>
  <wps:Status creationTime="2017-01-11T17:51:53Z">
    <wps:ProcessSucceeded>PyWPS Process NCDump finished</wps:ProcessSucceeded>
  </wps:Status>
  <wps:ProcessOutputs>
    <wps:Output>
      <ows:Identifier>output</ows:Identifier>
      <ows:Title>NetCDF Metadata</ows:Title>
      <ows:Abstract>NetCDF Metadata</ows:Abstract>
      <wps:Reference xlink:href="http://localhost:8090/wpsoutputs/hummingbird/nc_dump3vTQkM.txt" mimeType="text/plain"/>
    </wps:Output>
  </wps:ProcessOutputs>
</wps:ExecuteResponse>


In [ ]: