Python toolbox for handling ODV ascii format from OceanDataView adopted by SeaDataNet.
Please also see our Matlabtoolbox ODV for ODV files.
Getting the toolbox
The free and open source python ODV toolbox can be downloaded from https://svn.oss.deltares.nl/repos/openearthtools/trunk/python/OpenEarthTools/openearthtools/io/pyodv/
when you join openearth, download the tools with SubVersion and add them to your python path.
ODV file loading, merging and parsing
For setting up WPS for remote processing of collections of ODV files a python io library pyodv
has been created. Please also see our MATLAB toolbox ODV for ODV files.
ODV = pyodv.odv2df('test01.txt')
An overview of the contents (spatial extent, temporal range, parameters) of the Odv
object can be displayed with
print(ODV) ODV.html()
due to the str
{} and html
function inside the Odv
object. It will display something like this
filename | myfile.txt data_type | profile timeCoverage_min | 2002-03-23T06:10:00.000 timeCoverage_max | 2002-03-23T06:10:00.000 geospatial_lon_min | -6.997 geospatial_lon_max | -6.997 geospatial_lat_min | 46.434 geospatial_lat_max | 46.434 rows | 9524 cols | 22 with names: # | SDN name | SDN units | local name | local units --- + ------------------ + -------------- + ------------------------------ + ---> 000 | | | Cruise | 001 | | | Station | 002 | | | Type | 003 | | | yyyy-mm-ddThh:mm:ss.sss | 004 | | | Longitude | degrees_east 005 | | | Latitude | degrees_north 006 | | | LOCAL_CDI_ID | 007 | | | EDMO_code | 008 | | | Bot. Depth | m 009 | SDN:P011::PRESPS01 | SDN:P061::UPDB | PRESSURE | dbar 010 | | | QV:SEADATANET | 011 | SDN:P011::TEMPS901 | SDN:P061::UPAA | T90 | degC 012 | | | QV:SEADATANET | 013 | SDN:P011::PSALPR02 | SDN:P061::UUUU | Salinity | PSU 014 | | | QV:SEADATANET | 015 | SDN:P011::CPHLPM01 | SDN:P061::UGPL | fluorescence | ugr/l 016 | | | QV:SEADATANET | 017 | SDN:P011::POPTDR01 | SDN:P061::UPCT | Trans_red_25cm | % 018 | | | QV:SEADATANET | 019 | SDN:P011::POTMCV01 | SDN:P061::UPAA | POTM | degC 020 | | | QV:SEADATANET | 021 | SDN:P011::SIGTPR01 | SDN:P061::UKMC | Density | kg/m3
ODV plotting
The ODV
object can be viewed as html ODV.html()
or as formatted command line text print(ODV)
. More advanced views are available for trajectory data as png and kmz images:
pyodv.odv2map ('test01.png',ODV,cname,clims,colormap) pyodv.odv2mapkmz('test01.kmz',ODV,cname,clims,colormap)
where cname
is the name of an ODV column, clims
are the colorlimits and colormap
is a Matplotlib colormap.
For vertical profile data:
pyodv.odv2profile('test01.png',ODV,cname,clims,zname)
For timeseries data:
pyodv.odv2timeseries('test01.png',ODV,cname,clims,log10=0)
pydov as WPS
On our test server we host pyodv with some server-side data files as WPS. On the server the pyodv WPS wrappers are hosted here
/var/lib/wsgi/wps/processes
It is deployed with NGINX as web server, and uwsgi as application server, see:
Setting up pyWPS in combination with uwsgi and nginx
The WPS can be accessed via
http://dtvirt5.deltares.nl/wps?Request=GetCapabilities&Service=WPS
We designed WPS for pyodv similar to the WxS services, please see pyWPSodv
Acknowlegdements
This toolbox is being developed as part of EMODnet chemistry 2.