In [1]:
"""Python WPS execute"""
from owslib.wps import WebProcessingService, monitorExecution, printInputOutput
from os import system
In [2]:
wps_url = "http://localhost:8093/wps"
#wps_url = "http://birdhouse-lsce.extra.cea.fr:8093/wps"
wps = WebProcessingService(url=wps_url, verbose=False)
In [3]:
print wps.identification.title
In [5]:
for process in wps.processes:
print '%s : \t %s' % (process.identifier, process.abstract)
In [4]:
files = []
for i in range(1,16): #
#files.append('file:///home/estimr1/EUCLEIA/indices/RX5day/DJF/RX5day_DJF_HadGEM3-A-N216_historical_r1i1p%s_19600101-20131230.nc' % (i))
files.append('file:///home/estimr1/EUCLEIA/indices/TG/yr/TG_yr_HadGEM3-A-N216_historical_r1i1p%s_19600101-20131230.nc' % (i))
In [8]:
from os.path import join
execute = wps.execute(
identifier="fetch", #indices_clipping",
inputs=[
("resource",files[0]),
("resource",files[1]),
("resource",files[2]),
("resource",files[3]),
("resource",files[4]),
("resource",files[5]),
("resource",files[6]),
("resource",files[7]),
("resource",files[8]),
("resource",files[9]),
("resource",files[10]),
("resource",files[11]),
("resource",files[12]),
("resource",files[13]),
("resource",files[14])
])
monitorExecution(execute, sleepSecs=5)
print execute.getStatus()
In [9]:
for o in execute.processOutputs:
print o.reference
In [ ]: