Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timcera/hspfbintoolbox
Command line script and Python package to read time-series from the Hydrological Simulation Program - FORTRAN (HSPF) binary output.
https://github.com/timcera/hspfbintoolbox
cli hydrology python simulation
Last synced: 3 months ago
JSON representation
Command line script and Python package to read time-series from the Hydrological Simulation Program - FORTRAN (HSPF) binary output.
- Host: GitHub
- URL: https://github.com/timcera/hspfbintoolbox
- Owner: timcera
- License: bsd-3-clause
- Created: 2014-12-14T07:34:53.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2024-06-05T00:15:27.000Z (5 months ago)
- Last Synced: 2024-06-11T17:00:22.114Z (5 months ago)
- Topics: cli, hydrology, python, simulation
- Language: Python
- Homepage:
- Size: 16.2 MB
- Stars: 8
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.rst
- License: LICENSE.txt
- Authors: AUTHORS.rst
Awesome Lists containing this project
- open-sustainable-technology - hspfbintoolbox - A Python script and library of functions to read Hydrological Simulation Program Fortran (HSPF) binary files and print to screen. (Hydrosphere / Freshwater and Hydrology)
README
.. image:: https://github.com/timcera/hspfbintoolbox/actions/workflows/pypi-package.yml/badge.svg
:alt: Tests
:target: https://github.com/timcera/hspfbintoolbox/actions/workflows/pypi-package.yml
:height: 20.. image:: https://img.shields.io/coveralls/github/timcera/hspfbintoolbox
:alt: Test Coverage
:target: https://coveralls.io/r/timcera/hspfbintoolbox?branch=master
:height: 20.. image:: https://img.shields.io/pypi/v/hspfbintoolbox.svg
:alt: Latest release
:target: https://pypi.python.org/pypi/hspfbintoolbox/
:height: 20.. image:: http://img.shields.io/pypi/l/hspfbintoolbox.svg
:alt: BSD-3 clause license
:target: https://pypi.python.org/pypi/hspfbintoolbox/
:height: 20.. image:: http://img.shields.io/pypi/dd/hspfbintoolbox.svg
:alt: hspfbintoolbox downloads
:target: https://pypi.python.org/pypi/hspfbintoolbox/
:height: 20.. image:: https://img.shields.io/pypi/pyversions/hspfbintoolbox
:alt: PyPI - Python Version
:target: https://pypi.org/project/hspfbintoolbox/
:height: 20Documentation 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
~~~
.. code-block:: bashpip install hspfbintoolbox
conda
~~~~~
.. code-block:: bashconda 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)