Introduction

A pyWPS wrapper has been made for the python pyodv toolbox. The rationale of pyodv as WPS is the same as used in the OGC WxS services as SOS and WFS: subsequent requests dig deeper. The pyodv as WPS service works with 2 back ends: a collection of odv .txt files, and a PostgreSQL-PostGIS database filled with ORM from the odv text files. The PostgreSQL-PostGIS allows queries based on cdi and bbox, while the odv text back-end files only allow queries based on cdi. Please notice that the odv txt files back-end will soon be no longer supported

  1. cdi_get_metadata > cdi_get_parameters > cdi_plot_map, cdi_plot_profile, cdi_plot_timeseries, cdi_plot_timeprofile.
  2. bbox_get_metadata > bbox_get_parameters > bbox_plot_map, bbox_plot_profile, bbox_plot_timeseries, bbox_plot_timeprofile.

For both back-ends functions, common steps are available to get table names and parameter names from file/database: Get_metadata and Get_parameter.

Get_metadata

cdi_get_metadata and bbox_get_metadata are meant to query which odv files are available at the server. *_get_metadata returns a .json object with 6 columns: EDMO_code for the institute where the data originate, LOCAL_CDI_ID for the unique local identifier at the data centre and filename for the file name. The files are stored at the server using the convention $DATAROOT$/<EDMO_code>/<filename>.txt. cdi_get_metadata also returns 3 meta-data columns: the meta-data time and location (lon,lat).
*_get_metadata returns the table in efficient json format for fast machine processing.

http://localhost/cgi-bin/pywps.cgi?service=wps&request=Execute&Identifier=cdi_get_metadata&DataInputs=[]&version=1.0.0

A working example on our test server is in the following code block (note that this url may be dysfunctional now and then, as it is a test server). Next examples are presented directly for the test server as the difference between a call from the local server and the web server is in the pre-ambule, respectively http://localhost/cgi-bin/pywps.cgi?  and http://dtvirt5.deltares.nl/wps?.

http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=odvGetCDI&cdi_get_metadata=[]&version=1.0.0

Get_parameter

cdi_get_parameters and bbox_get_parameters are meant to query one file/database to find which variables are actually available in that file/database (the file should be one of the ones returned by cdi_get_metadata). The functions return a json object (fast for machine processing) with the P01 quantity code in sdn_name, the P06 units in sdn_units and the column name in column_name. The column_name has to be used in the subsequent plotting processes, it is equal to (i) the sdn_code for data columns, (ii) 'QV:" + sdn_code for flag columns and (iii) the standardized odv column name for the first 8 meta-data columns.

Here two examples using cdi_get_parameters:

http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=cdi_get_parameters&DataInputs=[EDMO_code=632;LOCAL_CDI_ID=world_N50W10N40E0;suffix=_20060101_20070101]&version=1.0.0
http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=cdi_get_parameters&DataInputs=[EDMO_code=486;LOCAL_CDI_ID=FI35199620002_00422_H09]&version=1.0.0

and one example using bbox_get_parameters (querying the PostgreSQL-PostGIS database only), giving the input as bounding box bbox=[West,East,South,North]:

http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=bbox_get_parameters&DataInputs=[bbox=12,13,44,45]&version=1.0.0

Plotting services

The remaining WPS wrappers for plotting one odv file/folder have the same name as the associated pydov functions. They have

Four types of plotting services have been created: *map, *profile*timeseries*timeprofile. They compensate each other as they show in different ways the information contained in the database. Service features follow the python function pyodv explained here, as they provide maps (x: Lon, y: Lat, cbar: Parameter), profiles (x: Parameter, y: Depth, cbar: Time), timeseries (x: Time, y: Parameter, cbar: Depth), timeprofiles (x: Time, y: Depth, cbar: Parameter). Examples are shown hereafter.

Plot_map

bbox_plot_map and cdi_plot_map to be applied to one available column from a remote odv file or to the PostgreSQL-PostGIS database. It has a specific optional argument colormap to select a color map. A working example on our test server is (note this url may be dysfunctional now and then, as it is a test server), for bbox and cdi:

http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=bbox_plot_map&DataInputs=[bbox=12,13,43,44;parameter=EPC00008]&version=1.0.0
http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=cdi_plot_map&DataInputs=[EDMO_code=486;LOCAL_CDI_ID=FI35200345015_24FA0_H09;parameter=NTRZZZXX;clim0=5;clim1=20;colormap=jet;]&version=1.0.0


The map functions can return kmz files or png files, which can be chosen by adding the WPS keyword responsedocument. The available options are listed in the getCapabilites return document, in this case default image/png and application/vnd.google-earth.kmz. Note that this is a WPS keyword, and hence appears outside the DataInputs (square brackets). Note that mimetype is a property of WPS keyword responsedocument, which is denoted with the =@. Requesting kmz hence requires padding &responsedocument=Parameters=@mimetype=application/vnd.google-earth.kmz to the url. Working examples for kmz dots are, for bbox and for cdi:

http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=bbox_plot_map&DataInputs=[bbox=12,13,43,44;parameter=EPC00008]&responsedocument=mapname=@mimetype=application/vnd.google-earth.kmz&version=1.0.0
http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=cdi_plot_map&DataInputs=[EDMO_code=486;LOCAL_CDI_ID=FI35200345015_24FA0_H09;parameter=NTRZZZXX;clim0=5;clim1=20;colormap=jet]&responsedocument=mapname=@mimetype=application/vnd.google-earth.kmz&version=1.0.0

 

Kmz columns can be requested as well, with kmzcolumns parameter set to 1:

http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=bbox_plot_map&DataInputs=[bbox=12,13,43,44;parameter=EPC00008;kmzcolumns=1]&responsedocument=mapname=@mimetype=application/vnd.google-earth.kmz&version=1.0.0

 

The previous three bbox requests produce the following outputs.

  

Plot_profile

box_plot_profile and cdi_plot_profile to be applied to one available column from a remote odv file or to the PostgreSQL-PostGIS database. It has specific optional argument z to select the y-axis, otherwise the index is the y-axis. A working example on our test server is (note this url may be dysfunctional now and then, as it is a test server)

http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=bbox_plot_profile&DataInputs=[bbox=12,13,43,44;parameter=EPC00004;z=ADEPZZ01]&version=1.0.0


Different flavours can be added to the WPS DataInputs (square brackets). Two examples (bbox and cdi) are

http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=bbox_plot_profile&
DataInputs=[
bbox=12,13,43,44;
parameter=EPC00004;
z=ADEPZZ01;
starttime=2009-01-01T00:00:00Z;
endtime=2010-01-01T00:00:00Z;
zlim0=0;
zlim1=2;
clim0=0;
clim1=500;
log10=0;
markersize=18.0;
marker=^;
alpha=0.4
]&
version=1.0.0
 
http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=cdi_plot_profile&
DataInputs=[
EDMO_code=486;
LOCAL_CDI_ID=FI35200711007_00010_H09;
parameter=NTRAZZXX;
z=ADEPZZ01;
clim0=0;
clim1=1000;
log10=1;
color=magenta;
linestyle=--;
linewidth=3
]&
version=1.0.0

 

The two bbox requests produce the following outputs.

  

Plot_timeseries

box_plot_timeseries and cdi_plot_timeseries to be applied to one available column from a remote odv file. Working examples on our test server is (note this url may be dysfunctional now and then, as it is a test server)for timeseries are, for bbox and for cdi:

http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=bbox_plot_timeseries&DataInputs=[bbox=12,13,43,44;parameter=EPC00004;z=ADEPZZ01]&version=1.0.0
http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=cdi_plot_timeseries&DataInputs=[EDMO_code=486;LOCAL_CDI_ID=FI35200345015_24FA0_H09;parameter=CPHLZZXX;]&version=1.0.0


Different flavours can be added to the WPS DataInputs (square brackets) of *_plot_timeseries as well. An example is

http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=bbox_plot_timeseries&
DataInputs=[
bbox=12,13,43,44;
parameter=EPC00004;
z=ADEPZZ01;
starttime=2009-01-01T00:00:00Z;
endtime=2010-01-01T00:00:00Z;
zlim0=0;
zlim1=2;
clim0=0;
clim1=500;
log10=0;
markersize=18.0;
marker=^;
alpha=0.4
]&
version=1.0.0
 
http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=cdi_plot_timeseries&
DataInputs=[
EDMO_code=486;
LOCAL_CDI_ID=FI35200345015_24FA0_H09;
parameter=CPHLZZXX;
clim0=0;
clim1=2;
color=brown;
marker=^;
markersize=12;
alpha=0.2
]&
version=1.0.0


The two bbox requests produce the following outputs.

 

Plot_timeprofile

box_plot_timeprofile and cdi_plot_timeprofile to be applied to one available column from a remote odv file. A working example on our test server is (note this url may be dysfunctional now and then, as it is a test server)for timeprofile is: 

http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=bbox_plot_timeprofile&DataInputs=[bbox=-10,-5,45,50;parameter=PSLTZZ01;]&version=1.0.0

 

Different flavours can be added to the WPS DataInputs (square brackets) of *_plot_timeprofile as well. Two examples (bbox and cdi) are

http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=bbox_plot_timeprofile&
DataInputs=[
bbox=12,13,43,44;
parameter=EPC00004;
z=ADEPZZ01;
starttime=2009-01-01T00:00:00Z;
endtime=2010-01-01T00:00:00Z;
zlim0=0;
zlim1=2;
clim0=0;
clim1=500;
log10=0;
markersize=18.0;
marker=^;
alpha=0.4
]&
version=1.0.0
 
http://dtvirt5.deltares.nl/wps?service=wps&request=Execute&Identifier=cdi_plot_timeprofile&
DataInputs=[
EDMO_code=486;
LOCAL_CDI_ID=FI35200345015_24FA0_H09;
parameter=CPHLZZXX;
clim0=0;
clim1=2;
color=brown;
marker=^;
markersize=12;
alpha=0.2
]&
version=1.0.0

 

The two bbox requests produce the following outputs.

 

GetCapabilities 

The above processes and the input/output arguments can be queried with the general WPS getCapabilites operation http://dtvirt5.deltares.nl/wps?service=wps&request=GetCapabilities:

<wps:ProcessOfferings>

<wps:Process wps:processVersion="$ version $">
<ows:Identifier>cdi_get_metadata</ows:Identifier>
<ows:Title>...</ows:Title>
<ows:Abstract>odvGetCDI returns the data contents of a remote server as json or html</ows:Abstract>
</wps:Process>

<wps:Process wps:processVersion="$ version $">
<ows:Identifier>cdi_get_paramters</ows:Identifier>
<ows:Title>...</ows:Title>
<ows:Abstract>odvGetParameters returns the contents of a remote ODV file as json or html</ows:Abstract>
</wps:Process>

<wps:Process wps:processVersion="$ version $">
<ows:Identifier>cdi_plot_map</ows:Identifier>
<ows:Title>...</ows:Title>
<ows:Abstract>odv2map returns a planview plot of a remote ODV file or folder as png and kmz</ows:Abstract>
</wps:Process>

<wps:Process wps:processVersion="$ version $">
<ows:Identifier>cdi_plot_profile</ows:Identifier>
<ows:Title>...</ows:Title>
<ows:Abstract>odv2profile returns a scatter/profile plot of one parameter from a remote ODV file as png</ows:Abstract>
</wps:Process>

<wps:Process wps:processVersion="$ version $">
<ows:Identifier>cdi_plot_timeseries</ows:Identifier>
<ows:Title>...</ows:Title>
<ows:Abstract>odv2timeseries returns a scatter/profile plot of one parameter from a remote ODV file as png</ows:Abstract>
</wps:Process>

Official WPS server

During the first quarter of 2015, WPS services will be transferred from Deltares to Cineca cloud web services, at node ogs02. The implementation is explained in an apart tutorial.

Acknowlegdements

This toolbox is being developed as part of EMODnet chemistry 2.