Skip to main content

Reads Hydrological Simulation Program - FORTRAN binary output files.

Project description

Tests Test Coverage Latest release BSD-3 clause license hspfbintoolbox downloads PyPI - Python Version

Documentation for hspfbintoolbox

The hspfbintoolbox is a Python script and library of functions to read Hydrological Simulation Program Fortran (HSPF) binary files and print to screen. The time series can then be redirected to file, or piped to other command line programs like tstoolbox.

Requirements

  • python 3.7 or later

  • tstoolbox - utilities to process time-series

Installation

pip

pip install hspfbintoolbox

conda

conda install -c conda-forge hspfbintoolbox

Usage - Command Line

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

catalog

Prints out a catalog of data sets in the binary file.

extract

Prints out data to the screen from a HSPF binary output file.

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

import hspfbintoolbox

# Then you could call the functions
ntsd = hspfbintoolbox.extract('tests/test.hbn', 'yearly', ',905,,AGWS')

# Once you have a PANDAS DataFrame you can use that as input.
ntsd = tstoolbox.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

hspfbintoolbox-9.0.4.tar.gz (17.2 MB view hashes)

Uploaded Source

Built Distribution

hspfbintoolbox-9.0.4-py3-none-any.whl (9.9 kB view hashes)

Uploaded Python 3

Supported by

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