Skip to main content

Utilities to work with Hydrological Simulation Program - FORTRAN (HSPF) models.

Project description

https://travis-ci.org/timcera/hspf_utils.svg?branch=master https://coveralls.io/repos/timcera/hspf_utils/badge.png?branch=master Latest release hspf_utils license

hspf_utils - Quick Guide

The hspf_utils is a command line script and Python library of utilities to work with the Hydrological Simulation Program - FORTRAN (HSPF). Uses pandas (http://pandas.pydata.org/) or numpy (http://numpy.scipy.org) for any heavy lifting.

Requirements

  • tstoolbox - Time-series toolbox; collected and installed by ‘pip’ or ‘easy_install’ command.

  • hspfbintoolbox - Utility to extract time-series from HSFP binary output files; collected and installed by ‘pip’ or ‘easy_install’ command.

Installation

Should be as easy as running pip install hspf_utils or easy_install hspf_utils at any command line.

Usage - Command Line

Just run ‘hspf_utils –help’ to get a list of subcommands:

usage: hspf_utils [-h] {about,detailed,summary,mapping,parameters} ...

positional arguments:
  {about,detailed,summary,mapping,parameters}
    about               Display version number and system information.
    detailed            Develops a detailed water balance.
    summary             Develops a summary water balance.
    mapping             Develops a csv file appropriate for joining to a GIS
                        layer.
    parameters          Develops a table of parameter values.

optional arguments:
  -h, --help            show this help message and exit

For the subcommands that output data it is printed to the screen and you can then redirect to a file.

Usage - API

You can use all of the command line subcommands as functions. The function signature is identical to the command line subcommands. The return is always a PANDAS DataFrame. Input can be a CSV or TAB separated file, or a PANDAS DataFrame and is supplied to the function via the ‘input_ts’ keyword.

Simply import hspf_utils:

from hspf_utils import hspf_utils

# Then you could call the functions

# Once you have a PANDAS DataFrame you can use that as input to other
# hspf_utils functions.
ntsd = hspf_utils.aggregate(statistic='mean', agg_interval='daily', input_ts=ntsd)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hspf_utils-5.1.1.tar.gz (12.6 kB view details)

Uploaded Source

File details

Details for the file hspf_utils-5.1.1.tar.gz.

File metadata

  • Download URL: hspf_utils-5.1.1.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0

File hashes

Hashes for hspf_utils-5.1.1.tar.gz
Algorithm Hash digest
SHA256 182a39db5e98db6396892fa739d61ad390aaf61bf886a94fcd60ede7be567c4e
MD5 f49d7edc8518e16a7b01c8cf868c505f
BLAKE2b-256 eb8bdd17bdcb03b2291dc22697881ca638f6ff3c64821e08fc62fb44dccafd52

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page