Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

OpenEarthTools contains a dedicated toolbox for model input and output. You can access this toolbox from the OSS Deltares SVN server, after downloading a copy with SVN (using Tortoise SVN for instance) with your OpenEarth account. This toolbox allows you to automate actions that are common practice in hydrological modelling. For example, tools are available for:

  • Data analyses tools (e.g. computation of GHG)
  • Data validation (e.g. double mass analysis)
  • Data conversion (e.g. PCRaster to GeoTIFF)
  • Coupling tools to software packages

Toolbox structure

  • Hydrotools - location of classes / functions
    • hydrotools.conversion -  conversion tools for different data formats (NetCDF, GeoTIFF, CSV)
    • hydrotools.coupling - coupling tools to software packages (SOBEK, wflow, 3Di)
    • hydrotools.gis - GIS functions, this could be useful for pre- and postprocessing steps

    • hydrotools.models - integrated functions

    • hydrotools.process - single functions for hydro-meteorological processes e.g. evaporation

    • hydrotools.statistics - pre- and postprocessing tools for computation of statistical parameters (frequency analysis, design discharge calculations)

    • hydrotools.validation - data validation tools (double mass curve, ...)

  • Sandbox - placeholders for unfinished scripts using the same structure as above (e.g. examples of how to use functions or unfinished tools)
  • Notebooks - placeholders for IPython notebooks, same as Sandbox

...

  • Make a checkout (like any subversion project with TortoiseSVN) Tortoise SVN). If you are new to Tortoise SVN consider reading Tortoise SVN Quick Start first
  • Install it by running on command line: python setup.py develop
  • Import the package within Python like any other package: import hydrotools / from hydrotools import *
  • Try out a function e.g.: 

...

  • update a script or copy your new script in the right correct folder in the toolbox structure
  • right click on the folder and choose "SVN Commit"
  • tell us in the comments of the new revision what you changed or added

Basic quality requirements

...

  • a generic setup;
  • a header (docstring) on top at the start of the script with 1) the date of creation 2) the name(s) of the author(s) and 3) a general explanation of the functionality of the script and 4) keywords;
  • a help for each python function, i.e.: a docstring at the top of the script explaining the functionality, followed by the input and output parameters of the script.

...

For a good example see the dem_fill_dig script in the "gis" folder of the Hyrdo Hydro Toolbox.

For more tips on how to write a proper python script check:

...