A set of python modules to help users with
- the preparation of the Diva input files: data, contours, parameters;
- the execution of the Diva interpolation tool,
- the reading of output files (analysis, finite-element mesh),
- the input and output plotting.
The Diva interpolation tool has to be installed and compiled on your machine. See the related documentation for the installation.
Clone the package:
git clone git@github.com:gher-ulg/DivaPythonTools.git
or download the latest stable release.
Inside DivaPythonTools directory execute:
pip install -r requirements.txt
python setup.py install
After this you should use it as:
from pydiva import pydiva2d, pydiva4d
The main modules are pydiva2d
and pydiva4d
, which define the classes for the 2D and 4D version of Diva, respectively.
The module defines classes corresponding to the main Diva input (data, parameters, contours) and output files (analysed and error fields, finite-element mesh).
The module defines classes to run the 4D version of Diva.
The figures can be generated with and without the Basemap module (Plot on map projections).
Some examples obtained with mixed-layer depth (MLD) data are shown below. The complete example to generate these plots is inside the Notebooks directory (run_diva2D_MLD).
The Notebooks directory contains additional examples showing how to run 2D and 4D cases.
Scatter plot showing the data positions and values.
By default, each sub-contour is displayed in a different color.
Triangular mesh covering the region of interest.
Pseudo-color plot of the gridded field obtained by the interpolation.
Data, contours, mesh and analysis on the same figure.
Diva developments have benefited from the users' feedback and numerous comments, especially during the editions of the Diva workshops.
The present module was initiated in the frame of SeaDataCloud project.