Skip to main content

Creates water balance table from HSPF models.

Project description Latest release hspf_water_balance license

hspf_water_balance - Quick Guide

The hspf_water_balance is a Python script to create a water balance from Hydrological Simulation Program - FORTRAN (HSPF) or by function calls within Python. Uses pandas ( or numpy ( for any heavy lifting.


  • tstoolbox - collected and installed by ‘pip’ or ‘easy_install’ command.


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

Usage - Command Line

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

usage: hspf_water_balance [-h]
{about,detailed,summary,mapping} …
Display version number and system information.
Create detailed water balance of each component.
Create a summary table of precipitation, runoff, evaporation.
Create a table suitable for joining to a shapefile to map surface water balance components.

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_water_balance:

from hspf_water_balance import hspf_water_balance

# Then you could call the functions
ntsd = hspf_water_balance.summary(method='linear', input_ts='tests/test_fill_01.csv')

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

Project details

Release history Release notifications

Download files

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

Files for hspf-water-balance, version
Filename, size File type Python version Upload date Hashes
Filename, size hspf_water_balance- (10.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page