hydrotoolbox 2.1.0__tar.gz → 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/.github/workflows/clean-workflow-runs.yml +3 -7
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/CHANGELOG.md +6 -0
- {hydrotoolbox-2.1.0/src/hydrotoolbox.egg-info → hydrotoolbox-2.2.0}/PKG-INFO +2 -2
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/README.rst +1 -1
- hydrotoolbox-2.2.0/VERSION +1 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/docs/command_line.rst +2 -2
- hydrotoolbox-2.2.0/docs/function_summary.rst +28 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/docs/index.rst +3 -3
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/pyproject.toml +1 -1
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/__init__.py +12 -11
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/comparison.py +5 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/boughton.py +4 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/chapman.py +4 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/chapman_maxwell.py +4 -0
- hydrotoolbox-2.2.0/src/hydrotoolbox/baseflow/methods/eckhardt.py +22 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/ewma.py +4 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/five_day.py +4 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/fixed.py +5 -1
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/furey.py +4 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/ihacres.py +9 -8
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/local.py +5 -1
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/lyne_hollick.py +4 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/slide.py +5 -1
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/strict.py +5 -1
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/ukih.py +4 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/willems.py +4 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/param_estimate.py +7 -2
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/separation.py +3 -4
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow_sep.py +115 -46
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/hydrotoolbox.py +1259 -1188
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/indices/indices.py +1 -1
- hydrotoolbox-2.2.0/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/__init__.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0/src/hydrotoolbox.egg-info}/PKG-INFO +2 -2
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox.egg-info/SOURCES.txt +1 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_eckhardt.csv +2513 -2513
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_ihacres.csv +5 -5
- hydrotoolbox-2.1.0/VERSION +0 -1
- hydrotoolbox-2.1.0/docs/function_summary.rst +0 -28
- hydrotoolbox-2.1.0/src/hydrotoolbox/baseflow/methods/eckhardt.py +0 -27
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/.deepsource.toml +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/.github/dependabot.yml +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/.github/workflows/pypi-package.yml +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/.github/workflows/tests.yml +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/.gitignore +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/.gitmodules +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/.pre-commit-config.yaml +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/.sourcery.yaml +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/AUTHORS.rst +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/BADGES.rst +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/CONTRIBUTING.rst +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/LICENSE.txt +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/docs/Makefile +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/docs/authors.rst +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/docs/conf.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/docs/contributing.rst +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/docs/license.rst +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/docs/make.bat +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/docs/readme.rst +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/pytest.ini +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/setup.cfg +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/__init__.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/example.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/__init__.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/methods/general_form.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/baseflow/utils.py +0 -0
- {hydrotoolbox-2.1.0/src/hydrotoolbox/toolbox_utils/src/toolbox_utils → hydrotoolbox-2.2.0/src/hydrotoolbox/indices}/__init__.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/docs/conf.py +0 -0
- {hydrotoolbox-2.1.0/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers → hydrotoolbox-2.2.0/src/hydrotoolbox/toolbox_utils/src/toolbox_utils}/__init__.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/hbn.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/plotgen.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/readers/wdm.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/tsutils.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/src/toolbox_utils/utils.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/tests/test_asbestfreq.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/tests/test_date_slice.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/tests/test_dateparse.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/tests/test_extract.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/tests/test_hbn.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/tests/test_make_list.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/tests/test_period_timestamp.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/tests/test_plotgen.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/tests/test_range_to_numlist.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/tests/test_read.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/toolbox_utils/tests/test_wdm.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox/utils.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox.egg-info/dependency_links.txt +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox.egg-info/entry_points.txt +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox.egg-info/requires.txt +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/src/hydrotoolbox.egg-info/top_level.txt +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/BEC_test.sh +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/Q_BEC_BE_6500.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/Q_BEC_BE_6500.ssf +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/black_earth_creek_05406500_flow.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/black_earth_creek_05406500_test.sh +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_02239501.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_boughton.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_chapman.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_chapman_maxwell.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_ewma.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_five_day.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_furey.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_lyne_hollick.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_strict.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_ukih.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_usgs_hysep_fixed.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_usgs_hysep_local.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_usgs_hysep_slide.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_baseflow_willems.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_percentile_test.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_short.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/data_test_storm_events.csv +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/gtable.out +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/gtable_1955.out +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/hydrotoolbox_indices.txt +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/run_test.sh +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/test_baseflow_sep.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/test_exceedance_time.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/test_flow_duration.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/test_indices.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/test_recession.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/test_storm_events.py +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/tsproc_hydrologic_indices.inp +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/tsproc_hydrologic_indices.rec +0 -0
- {hydrotoolbox-2.1.0 → hydrotoolbox-2.2.0}/tests/tsproc_hydrologic_indices_percentile_test.inp +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hydrotoolbox
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Command line script and Python library for analysis of flow time-series.
|
|
5
5
|
Author-email: Tim Cera <tim@cerazone.net>
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -72,7 +72,7 @@ or numpy (http://numpy.scipy.org) for any heavy lifting.
|
|
|
72
72
|
|
|
73
73
|
Requirements
|
|
74
74
|
------------
|
|
75
|
-
* python 3.
|
|
75
|
+
* python 3.10 or higher
|
|
76
76
|
|
|
77
77
|
Installation
|
|
78
78
|
------------
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.2.0
|
|
@@ -28,7 +28,7 @@ baseflow_sep chapman
|
|
|
28
28
|
:prompt:
|
|
29
29
|
|
|
30
30
|
baseflow_sep chapman_maxwell
|
|
31
|
-
|
|
31
|
+
----------------------------
|
|
32
32
|
.. program-output:: hydrotoolbox baseflow_sep chapman_maxwell --help
|
|
33
33
|
:prompt:
|
|
34
34
|
|
|
@@ -58,7 +58,7 @@ baseflow_sep ihacres
|
|
|
58
58
|
:prompt:
|
|
59
59
|
|
|
60
60
|
baseflow_sep lyne_hollick
|
|
61
|
-
|
|
61
|
+
-------------------------
|
|
62
62
|
.. program-output:: hydrotoolbox baseflow_sep lyne_hollick --help
|
|
63
63
|
:prompt:
|
|
64
64
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.. include:: ../BADGES.rst
|
|
2
|
+
|
|
3
|
+
Python API Function Summary
|
|
4
|
+
===========================
|
|
5
|
+
|
|
6
|
+
.. autosummary::
|
|
7
|
+
:toctree: _function_autosummary
|
|
8
|
+
|
|
9
|
+
hydrotoolbox.about
|
|
10
|
+
hydrotoolbox.baseflow_sep.boughton
|
|
11
|
+
hydrotoolbox.baseflow_sep.chapman
|
|
12
|
+
hydrotoolbox.baseflow_sep.chapman_maxwell
|
|
13
|
+
hydrotoolbox.baseflow_sep.eckhardt
|
|
14
|
+
hydrotoolbox.baseflow_sep.ewma
|
|
15
|
+
hydrotoolbox.baseflow_sep.five_day
|
|
16
|
+
hydrotoolbox.baseflow_sep.furey
|
|
17
|
+
hydrotoolbox.baseflow_sep.ihacres
|
|
18
|
+
hydrotoolbox.baseflow_sep.lyne_hollick
|
|
19
|
+
hydrotoolbox.baseflow_sep.ukih
|
|
20
|
+
hydrotoolbox.baseflow_sep.usgs_hysep_fixed
|
|
21
|
+
hydrotoolbox.baseflow_sep.usgs_hysep_local
|
|
22
|
+
hydrotoolbox.baseflow_sep.usgs_hysep_slide
|
|
23
|
+
hydrotoolbox.baseflow_sep.willems
|
|
24
|
+
hydrotoolbox.exceedance_time
|
|
25
|
+
hydrotoolbox.flow_duration
|
|
26
|
+
hydrotoolbox.indices
|
|
27
|
+
hydrotoolbox.recession
|
|
28
|
+
hydrotoolbox.storm_events
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
hydrotoolbox
|
|
6
6
|
============
|
|
7
7
|
|
|
8
|
-
This is the home page for hydrotoolbox. hydrotoolbox is a command line program
|
|
9
|
-
Python library for hydrologic analysis.
|
|
8
|
+
This is the home page for hydrotoolbox. hydrotoolbox is a command line program
|
|
9
|
+
and Python library for hydrologic analysis.
|
|
10
10
|
|
|
11
|
-
hydrotoolbox should work with Python 3.
|
|
11
|
+
hydrotoolbox should work with Python 3.10+.
|
|
12
12
|
|
|
13
13
|
Table of Contents
|
|
14
14
|
-----------------
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
"""Define hydrotoolbox package."""
|
|
2
2
|
|
|
3
|
+
# Import main functions from hydrotoolbox module
|
|
4
|
+
from hydrotoolbox.hydrotoolbox import (
|
|
5
|
+
about,
|
|
6
|
+
exceedance_time,
|
|
7
|
+
flow_duration,
|
|
8
|
+
indices,
|
|
9
|
+
recession,
|
|
10
|
+
storm_events,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
# Define __all__ list
|
|
3
14
|
__all__ = [
|
|
15
|
+
# Main functions
|
|
4
16
|
"about",
|
|
5
|
-
"baseflow_sep",
|
|
6
17
|
"exceedance_time",
|
|
7
18
|
"flow_duration",
|
|
8
19
|
"indices",
|
|
9
20
|
"recession",
|
|
10
21
|
"storm_events",
|
|
11
22
|
]
|
|
12
|
-
|
|
13
|
-
from .hydrotoolbox import (
|
|
14
|
-
about,
|
|
15
|
-
baseflow_sep,
|
|
16
|
-
exceedance_time,
|
|
17
|
-
flow_duration,
|
|
18
|
-
indices,
|
|
19
|
-
recession,
|
|
20
|
-
storm_events,
|
|
21
|
-
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
__all__ = [
|
|
2
|
+
"eckhardt",
|
|
3
|
+
]
|
|
4
|
+
|
|
5
|
+
from hydrotoolbox.baseflow.methods.general_form import general_form_digital_filter
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def eckhardt(flow, k, BFImax):
|
|
9
|
+
"""Eckhardt filter (Eckhardt, 2005)"""
|
|
10
|
+
denom = 1 - k * BFImax
|
|
11
|
+
alpha = ((1 - BFImax) * k) / denom
|
|
12
|
+
beta = ((1 - k) * BFImax) / denom
|
|
13
|
+
gamma = 0
|
|
14
|
+
|
|
15
|
+
return general_form_digital_filter(flow, alpha, beta, gamma)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def f_Eckhardt(a):
|
|
19
|
+
def _Eckhardt(Q, b_LH, BFImax):
|
|
20
|
+
return eckhardt(Q, b_LH, a, BFImax)
|
|
21
|
+
|
|
22
|
+
return _Eckhardt
|
|
@@ -7,9 +7,15 @@ hydrotoolbox baseflow_sep eckhardt,sliding < daily.csv
|
|
|
7
7
|
|
|
8
8
|
hydrotoolbox recession"""
|
|
9
9
|
|
|
10
|
+
__all__ = [
|
|
11
|
+
"ihacres",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
from hydrotoolbox.baseflow.methods.general_form import general_form_digital_filter
|
|
15
|
+
|
|
10
16
|
|
|
11
17
|
def ihacres(
|
|
12
|
-
|
|
18
|
+
flow,
|
|
13
19
|
k: float,
|
|
14
20
|
C: float,
|
|
15
21
|
a: float,
|
|
@@ -18,13 +24,8 @@ def ihacres(
|
|
|
18
24
|
|
|
19
25
|
Jakeman-Hornberger digital filter (Jakeman and Hornberger, 1993)
|
|
20
26
|
"""
|
|
21
|
-
Qb = Q.copy()
|
|
22
|
-
|
|
23
27
|
alpha = k / (1 + C)
|
|
24
28
|
beta = C / (1 + C)
|
|
29
|
+
gamma = a
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
Qb[row] = alpha * Qb[row - 1] + beta * (Q[row] + a * Q[row - 1])
|
|
28
|
-
mask = Qb > Q
|
|
29
|
-
Qb[mask] = Q[mask]
|
|
30
|
-
return Qb
|
|
31
|
+
return general_form_digital_filter(flow, alpha, beta, gamma)
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
2
|
|
|
3
|
+
__all__ = [
|
|
4
|
+
"local",
|
|
5
|
+
]
|
|
6
|
+
|
|
3
7
|
import numpy as np
|
|
4
8
|
|
|
5
9
|
try:
|
|
@@ -7,7 +11,7 @@ try:
|
|
|
7
11
|
except ImportError:
|
|
8
12
|
from pydantic import validate_arguments as validate_call
|
|
9
13
|
|
|
10
|
-
from .ukih import linear_interpolation
|
|
14
|
+
from hydrotoolbox.baseflow.methods.ukih import linear_interpolation
|
|
11
15
|
|
|
12
16
|
|
|
13
17
|
def local(Q, b_LH, area=None, num_days=None):
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
__all__ = [
|
|
2
|
+
"recession_coefficient",
|
|
3
|
+
"recession_period",
|
|
4
|
+
]
|
|
5
|
+
|
|
1
6
|
import numpy as np
|
|
2
7
|
|
|
3
|
-
from .utils import NSE, moving_average, multi_arange
|
|
8
|
+
from hydrotoolbox.baseflow.utils import NSE, moving_average, multi_arange
|
|
4
9
|
|
|
5
10
|
|
|
6
11
|
def recession_coefficient(Q, strict, date=None, ice_period=None):
|
|
@@ -31,7 +36,7 @@ def recession_coefficient(Q, strict, date=None, ice_period=None):
|
|
|
31
36
|
return np.exp(-1 / K)
|
|
32
37
|
|
|
33
38
|
|
|
34
|
-
def param_calibrate(param_range, method, Q, b_LH):
|
|
39
|
+
def param_calibrate(param_range, method, Q, b_LH=0):
|
|
35
40
|
idx_rec = recession_period(Q)
|
|
36
41
|
idx_oth = np.full(Q.shape[0], True)
|
|
37
42
|
idx_oth[idx_rec] = False
|
|
@@ -72,9 +72,8 @@ def separation(
|
|
|
72
72
|
"ukih",
|
|
73
73
|
"local",
|
|
74
74
|
"chapman_maxwell",
|
|
75
|
-
"furey",
|
|
76
|
-
"eckhardt",
|
|
77
75
|
"ewma",
|
|
76
|
+
"furey",
|
|
78
77
|
"willems",
|
|
79
78
|
]:
|
|
80
79
|
b_lh = lyne_hollick(Q, k=k)[0]
|
|
@@ -120,7 +119,7 @@ def separation(
|
|
|
120
119
|
np.arange(0.0001, 1, 0.0001), f_Eckhardt(k), Q, b_lh
|
|
121
120
|
)
|
|
122
121
|
bfi_max = float(bfi_max)
|
|
123
|
-
b[m] = eckhardt(Q,
|
|
122
|
+
b[m] = eckhardt(Q, k, bfi_max)[0]
|
|
124
123
|
|
|
125
124
|
if m == "ewma":
|
|
126
125
|
e = param_calibrate(np.arange(0.0001, 0.5, 0.0001), ewma, Q, b_lh)
|
|
@@ -131,7 +130,7 @@ def separation(
|
|
|
131
130
|
b[m] = willems(Q, b_lh, k, w)[0]
|
|
132
131
|
|
|
133
132
|
if m == "ihacres":
|
|
134
|
-
b[m] = ihacres(Q, k=k, C=C, a=a)
|
|
133
|
+
b[m] = ihacres(Q, k=k, C=C, a=a)[0]
|
|
135
134
|
|
|
136
135
|
if m == "strict":
|
|
137
136
|
b[m] = strict(Q)
|