Import and export WaterML timeseries files

Import WaterML

Basics

This app allows one or multiple WaterML timeseries files to be imported into Hydra.

The app assumes that you have downloaded timeseries files from the cuahsi web service. A single file can be passed to the app or a directory. If a directory is passed, the app will find the appropriate timeseries files and import all the data it can.

Basic usage:

ImportWML.py [-h] [-f Timeseries file]

Options

Option Short Parameter Description
--help -h   show help message and exit.
--file -t Timeseries File XML file containing a WaterML timeseries
--datacollectionname -n Dataset Collection Name Name of the dataset grouping

File structure

Building a windows executable

  • Use pyinstaller (pip install pyisntaller) to build a windows executable.
  • cd to the $PATH_TO_HYDRA/HydraPlugins/WaterMLPlugin/trunk
  • pyinstaller -F ImportWML.py :
  • If you want more compression (a smaller exe), install upx and run: pyinstaller -F –upx-dir=/path/to/upx/dir ExportWML.py
  • An executable file will appear in the dist folder

API docs

A Hydra plug-in for importing WML timeseries files.

class ImportWML.ImportWML(url=None, session_id=None)
read_timeseries_data(targets, dataset_collection_name)

Read Water ML timeseries data. @target Can be either a directory containing multiple timeseries files or a single timeseries file.

read_timeseries_file(file)

Taking a wml file as an argument, return an array where each element is a line in the wml.