mesas 2.0.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.
Files changed (60) hide show
  1. mesas-2.0.0/.gitignore +41 -0
  2. mesas-2.0.0/CITATION.cff +37 -0
  3. mesas-2.0.0/LICENSE.txt +22 -0
  4. mesas-2.0.0/PKG-INFO +80 -0
  5. mesas-2.0.0/README.md +37 -0
  6. mesas-2.0.0/doc/Makefile +19 -0
  7. mesas-2.0.0/doc/concepts.rst +128 -0
  8. mesas-2.0.0/doc/conf.py +80 -0
  9. mesas-2.0.0/doc/config.rst +55 -0
  10. mesas-2.0.0/doc/fig/QS.png +0 -0
  11. mesas-2.0.0/doc/fig/sas_spec.png +0 -0
  12. mesas-2.0.0/doc/functions.rst +6 -0
  13. mesas-2.0.0/doc/index.rst +77 -0
  14. mesas-2.0.0/doc/inputs.rst +153 -0
  15. mesas-2.0.0/doc/installation.rst +49 -0
  16. mesas-2.0.0/doc/make.bat +35 -0
  17. mesas-2.0.0/doc/model.rst +6 -0
  18. mesas-2.0.0/doc/options.rst +95 -0
  19. mesas-2.0.0/doc/quickstart.rst +162 -0
  20. mesas-2.0.0/doc/results.rst +140 -0
  21. mesas-2.0.0/doc/sasspec.rst +245 -0
  22. mesas-2.0.0/doc/solspec.rst +91 -0
  23. mesas-2.0.0/doc/specs.rst +5 -0
  24. mesas-2.0.0/examples/data.csv +101 -0
  25. mesas-2.0.0/examples/quickstart.py +31 -0
  26. mesas-2.0.0/mesas/__init__.py +13 -0
  27. mesas-2.0.0/mesas/me/__init__.py +0 -0
  28. mesas-2.0.0/mesas/me/recursive_split.py +514 -0
  29. mesas-2.0.0/mesas/sas/__init__.py +0 -0
  30. mesas-2.0.0/mesas/sas/_solve_numba.py +1297 -0
  31. mesas-2.0.0/mesas/sas/functions.py +828 -0
  32. mesas-2.0.0/mesas/sas/model.py +1193 -0
  33. mesas-2.0.0/mesas/sas/specs.py +471 -0
  34. mesas-2.0.0/mesas/utils/__init__.py +0 -0
  35. mesas-2.0.0/mesas/utils/vis.py +361 -0
  36. mesas-2.0.0/pyproject.toml +116 -0
  37. mesas-2.0.0/test/MeSASInputHourly.csv +35066 -0
  38. mesas-2.0.0/test/__init__.py +0 -0
  39. mesas-2.0.0/test/conftest.py +13 -0
  40. mesas-2.0.0/test/test_benchmark.py +711 -0
  41. mesas-2.0.0/test/test_benchmark2.py +769 -0
  42. mesas-2.0.0/test/test_evapoconcentration.py +98 -0
  43. mesas-2.0.0/test/test_examples.py +40 -0
  44. mesas-2.0.0/test/test_gamma_table.py +123 -0
  45. mesas-2.0.0/test/test_phase1_fixes.py +167 -0
  46. mesas-2.0.0/test/test_phase4_validation.py +125 -0
  47. mesas-2.0.0/test/test_record_options.py +241 -0
  48. mesas-2.0.0/test/test_stage0_benchmarks.py +233 -0
  49. mesas-2.0.0/test/test_stage0_edge_cases.py +203 -0
  50. mesas-2.0.0/test/test_stage0_examples.py +76 -0
  51. mesas-2.0.0/test/test_stage0_mass_balance.py +203 -0
  52. mesas-2.0.0/test/test_stage0_performance.py +104 -0
  53. mesas-2.0.0/test/test_stage6_property.py +288 -0
  54. mesas-2.0.0/test/test_stage6_recursive_split.py +172 -0
  55. mesas-2.0.0/test/test_stage6_sas_functions.py +428 -0
  56. mesas-2.0.0/test/test_stage6_time_varying.py +414 -0
  57. mesas-2.0.0/test/test_time.py +741 -0
  58. mesas-2.0.0/test/test_time2.py +791 -0
  59. mesas-2.0.0/test/test_vis_smoke.py +120 -0
  60. mesas-2.0.0/test/unsteady_data.csv +5844 -0
mesas-2.0.0/.gitignore ADDED
@@ -0,0 +1,41 @@
1
+ # Build artifacts
2
+ build/
3
+ builddir/
4
+ dist/
5
+ mesas.egg-info/
6
+ *.so
7
+ *.pyc
8
+ __pycache__/
9
+
10
+ # Editor/IDE
11
+ *.swo
12
+ *.swp
13
+ /.idea/
14
+ /.vscode/
15
+ /.claude/
16
+
17
+ # Project-specific excludes
18
+ misc/
19
+ /mesas/junk/
20
+ /mesas/dev/
21
+ /doc/_build/
22
+ */_build/*
23
+ examples/benchmark/Ciaran/
24
+ examples/miniLEO
25
+ debug/
26
+
27
+ # Generated files
28
+ *.log
29
+ test/test.log
30
+ test/*.pdf
31
+ examples/Archive.zip
32
+ examples/data_with_results.csv
33
+ test/MESASct.py
34
+ .coverage
35
+ *.egg-info/
36
+ .pytest_cache/
37
+
38
+ # Hypothesis property-testing cache
39
+ .hypothesis/
40
+ .ruff_cache/
41
+ .DS_Store
@@ -0,0 +1,37 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it using the metadata from this file, and cite the accompanying paper (see preferred-citation)."
3
+ type: software
4
+ title: "mesas.py: Multiscale Estimation of StorAge Selection"
5
+ authors:
6
+ - family-names: "Harman"
7
+ given-names: "Ciaran J."
8
+ orcid: "https://orcid.org/0000-0002-3185-002X"
9
+ affiliation: "Johns Hopkins University"
10
+ - family-names: "Xu Fei"
11
+ given-names: "Esther"
12
+ affiliation: "Johns Hopkins University"
13
+ repository-code: "https://github.com/JH-LandHydroLab/mesas"
14
+ url: "https://mesas.readthedocs.io/"
15
+ license: MIT
16
+ doi: "10.5281/zenodo.7144730"
17
+ identifiers:
18
+ - type: doi
19
+ value: "10.5281/zenodo.7144730"
20
+ description: "Concept DOI for all versions (resolves to the latest archived release)"
21
+ preferred-citation:
22
+ type: article
23
+ title: "mesas.py v1.0: a flexible Python package for modeling solute transport and transit times using StorAge Selection functions"
24
+ authors:
25
+ - family-names: "Harman"
26
+ given-names: "Ciaran J."
27
+ orcid: "https://orcid.org/0000-0002-3185-002X"
28
+ affiliation: "Johns Hopkins University"
29
+ - family-names: "Xu Fei"
30
+ given-names: "Esther"
31
+ affiliation: "Johns Hopkins University"
32
+ journal: "Geoscientific Model Development"
33
+ volume: 17
34
+ start: 477
35
+ end: 495
36
+ year: 2024
37
+ doi: "10.5194/gmd-17-477-2024"
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Ciaran J. Harman
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
mesas-2.0.0/PKG-INFO ADDED
@@ -0,0 +1,80 @@
1
+ Metadata-Version: 2.5
2
+ Name: mesas
3
+ Version: 2.0.0
4
+ Summary: MESAS - Multiscale Estimation of StorAge Selection.
5
+ Project-URL: homepage, https://mesas.readthedocs.io/
6
+ Project-URL: documentation, https://mesas.readthedocs.io/
7
+ Project-URL: repository, https://github.com/JH-LandHydroLab/mesas
8
+ Author: Ciaran J. Harman
9
+ Author-email: charman1@jhu.edu
10
+ Maintainer: Ciaran J. Harman
11
+ Maintainer-email: charman1@jhu.edu
12
+ License-Expression: MIT
13
+ License-File: LICENSE.txt
14
+ Keywords: SAS,Storage selection functions,hydrology
15
+ Classifier: Development Status :: 5 - Production/Stable
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Topic :: Scientific/Engineering :: Physics
25
+ Requires-Python: >=3.10
26
+ Requires-Dist: matplotlib
27
+ Requires-Dist: numba
28
+ Requires-Dist: numpy>1.22
29
+ Requires-Dist: pandas
30
+ Requires-Dist: scipy
31
+ Provides-Extra: docs
32
+ Requires-Dist: sphinx-copybutton; extra == 'docs'
33
+ Requires-Dist: sphinx-rtd-theme>=2.0; extra == 'docs'
34
+ Requires-Dist: sphinx>=7.0; extra == 'docs'
35
+ Provides-Extra: estimation
36
+ Requires-Dist: scikit-learn; extra == 'estimation'
37
+ Provides-Extra: test
38
+ Requires-Dist: hypothesis; extra == 'test'
39
+ Requires-Dist: pytest-cov; extra == 'test'
40
+ Requires-Dist: pytest>=7.0; extra == 'test'
41
+ Requires-Dist: scikit-learn; extra == 'test'
42
+ Description-Content-Type: text/markdown
43
+
44
+ # mesas.py
45
+
46
+ StorAge Selection is a theoretical framework for modeling transport through control volumes. It is appropriate if you are interested a system that can be treated as a single control volume (or a collection of such), and wish to make minimal assumptions about the internal organization of the transport. SAS assumes that the material leaving a system is some combination of the material that entered at earlier times. This can be useful for constructing simple models of very complicated flow systems, and for inferring the emergent transport properties of a system from tracer data.
47
+
48
+ For more information see the free HydroLearn course: [Tracers and transit times in time-variable hydrologic systems: A gentle introduction to the StorAge Selection (SAS) approach](https://edx.hydrolearn.org/courses/course-v1:JHU+570.412+Sp2020)
49
+
50
+ ## Installation
51
+
52
+ Install with Conda:
53
+
54
+ conda install -c conda-forge mesas
55
+
56
+ or with pip:
57
+
58
+ pip install mesas
59
+
60
+ Either installs mesas v2 and all of its dependencies. As of v2, mesas is pure
61
+ Python — the numerical solver is JIT-compiled with
62
+ [Numba](https://numba.pydata.org/), so no Fortran compiler is needed.
63
+
64
+ The legacy Fortran-based v1.x remains available by pinning the version, e.g.
65
+ `conda install -c conda-forge mesas=1.20240418`. To work on the development
66
+ version, clone this repository and `pip install -e .`
67
+
68
+ Further instructions can be found here: https://mesas.readthedocs.io/en/latest/installation.html
69
+
70
+ ## Documentation
71
+
72
+ Documentation for the code is available here: https://mesas.readthedocs.io/en/latest/
73
+
74
+ ## Citation
75
+
76
+ If you use mesas.py in your research, please cite:
77
+
78
+ Harman, C. J. and Xu Fei, E.: mesas.py v1.0: a flexible Python package for modeling solute transport and transit times using StorAge Selection functions, Geosci. Model Dev., 17, 477-495, https://doi.org/10.5194/gmd-17-477-2024, 2024.
79
+
80
+ [![DOI](https://zenodo.org/badge/183813641.svg)](https://zenodo.org/badge/latestdoi/183813641)
mesas-2.0.0/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # mesas.py
2
+
3
+ StorAge Selection is a theoretical framework for modeling transport through control volumes. It is appropriate if you are interested a system that can be treated as a single control volume (or a collection of such), and wish to make minimal assumptions about the internal organization of the transport. SAS assumes that the material leaving a system is some combination of the material that entered at earlier times. This can be useful for constructing simple models of very complicated flow systems, and for inferring the emergent transport properties of a system from tracer data.
4
+
5
+ For more information see the free HydroLearn course: [Tracers and transit times in time-variable hydrologic systems: A gentle introduction to the StorAge Selection (SAS) approach](https://edx.hydrolearn.org/courses/course-v1:JHU+570.412+Sp2020)
6
+
7
+ ## Installation
8
+
9
+ Install with Conda:
10
+
11
+ conda install -c conda-forge mesas
12
+
13
+ or with pip:
14
+
15
+ pip install mesas
16
+
17
+ Either installs mesas v2 and all of its dependencies. As of v2, mesas is pure
18
+ Python — the numerical solver is JIT-compiled with
19
+ [Numba](https://numba.pydata.org/), so no Fortran compiler is needed.
20
+
21
+ The legacy Fortran-based v1.x remains available by pinning the version, e.g.
22
+ `conda install -c conda-forge mesas=1.20240418`. To work on the development
23
+ version, clone this repository and `pip install -e .`
24
+
25
+ Further instructions can be found here: https://mesas.readthedocs.io/en/latest/installation.html
26
+
27
+ ## Documentation
28
+
29
+ Documentation for the code is available here: https://mesas.readthedocs.io/en/latest/
30
+
31
+ ## Citation
32
+
33
+ If you use mesas.py in your research, please cite:
34
+
35
+ Harman, C. J. and Xu Fei, E.: mesas.py v1.0: a flexible Python package for modeling solute transport and transit times using StorAge Selection functions, Geosci. Model Dev., 17, 477-495, https://doi.org/10.5194/gmd-17-477-2024, 2024.
36
+
37
+ [![DOI](https://zenodo.org/badge/183813641.svg)](https://zenodo.org/badge/latestdoi/183813641)
@@ -0,0 +1,19 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line.
5
+ SPHINXOPTS =
6
+ SPHINXBUILD = sphinx-build
7
+ SOURCEDIR = .
8
+ BUILDDIR = _build
9
+
10
+ # Put it first so that "make" without argument is like "make help".
11
+ help:
12
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13
+
14
+ .PHONY: help Makefile
15
+
16
+ # Catch-all target: route all unknown targets to Sphinx using the new
17
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18
+ %: Makefile
19
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,128 @@
1
+ .. _concepts:
2
+
3
+ ========
4
+ Concepts
5
+ ========
6
+
7
+ This page introduces the StorAge Selection (SAS) framework at a level
8
+ appropriate for users of the package. For the full mathematical
9
+ treatment, see `Harman (2015) <https://doi.org/10.1002/2014WR015707>`_
10
+ and `Benettin et al. (2022) <https://doi.org/10.5194/gmd-15-3881-2022>`_
11
+ and `Harman and Xu Fei (2024) <https://gmd.copernicus.org/articles/17/477/2024/>`_.
12
+
13
+ What is StorAge Selection?
14
+ ==========================
15
+
16
+ StorAge Selection (SAS) is a framework for modeling transport through a
17
+ control volume — a catchment, a soil column, a lake, or any system
18
+ where fluid enters, is stored, and eventually leaves.
19
+
20
+ The key idea is simple: **at each moment in time, the water leaving a
21
+ system is a mixture of water that entered at different times in the
22
+ past.** The SAS function describes *which ages of water are
23
+ preferentially selected for discharge*.
24
+
25
+ Age-ranked storage
26
+ ==================
27
+
28
+ The foundation of SAS is the concept of **age-ranked storage**. At any
29
+ time :math:`t`, the water in storage can be sorted by how long it has been
30
+ in the system. We define:
31
+
32
+ .. math::
33
+
34
+ S_T(T, t) = \int_0^T s_T(\tau, t)\, d\tau
35
+
36
+ where :math:`s_T(\tau, t)` is the density of water of age :math:`\tau`
37
+ in storage at time :math:`t`, and :math:`S_T(T, t)` is the cumulative
38
+ storage up to age :math:`T`. The total storage is
39
+ :math:`S(t) = S_T(\infty, t)`.
40
+
41
+ The SAS function
42
+ ================
43
+
44
+ The **SAS function** :math:`\Omega_Q(S_T, t)` is a cumulative
45
+ distribution function that maps age-ranked storage to cumulative
46
+ probability:
47
+
48
+ .. math::
49
+
50
+ \Omega_Q(S_T, t) = P(\text{discharged water has age-ranked storage} \leq S_T)
51
+
52
+ When :math:`\Omega_Q` is a straight line from 0 to :math:`S(t)`, all
53
+ ages of water are equally likely to be discharged — this is the
54
+ **well-mixed** case. When :math:`\Omega_Q` rises steeply at small
55
+ :math:`S_T`, young water is preferentially discharged. When it rises
56
+ steeply near :math:`S(t)`, old water is preferred.
57
+
58
+ The backward transit time distribution for outflow :math:`Q` is:
59
+
60
+ .. math::
61
+
62
+ p_Q(T, t) = \frac{\partial \Omega_Q}{\partial S_T} \cdot s_T(T, t)
63
+
64
+ Types of SAS functions
65
+ ======================
66
+
67
+ MESAS supports several types of SAS functions:
68
+
69
+ **Piecewise-linear**
70
+ Defined by breakpoints in :math:`(S_T, P)` space. The simplest is a
71
+ uniform distribution: ``"ST": [0, S_max]``. Adding more breakpoints
72
+ creates more complex shapes.
73
+
74
+ **Gamma distribution**
75
+ A flexible one-parameter family. The shape parameter :math:`a`
76
+ controls whether young water (:math:`a < 1`) or intermediate-aged
77
+ water (:math:`a > 1`) is preferentially discharged.
78
+ Specified with ``"func": "gamma"``.
79
+
80
+ **Beta distribution**
81
+ Defined over a finite interval, useful when total storage volume is
82
+ known. Has two shape parameters :math:`a` and :math:`b`.
83
+ Specified with ``"func": "beta"``.
84
+
85
+ **Kumaraswamy distribution**
86
+ Similar to the beta but with a closed-form CDF, making it
87
+ computationally efficient.
88
+ Specified with ``"func": "kumaraswamy"``.
89
+
90
+ All distribution-based SAS functions accept ``loc`` and ``scale``
91
+ parameters that shift and stretch the distribution along the
92
+ :math:`S_T` axis.
93
+
94
+ Solute transport
95
+ ================
96
+
97
+ Once the water fluxes are solved, solute transport follows
98
+ directly. The concentration of water of a given age in storage
99
+ determines the concentration of the outflow:
100
+
101
+ .. math::
102
+
103
+ C_Q(t) = \int_0^\infty \frac{m_T(T,t)}{s_T(T,t)} \, p_Q(T,t) \, dT
104
+
105
+ where :math:`m_T(T,t)` is the age-ranked solute mass in storage.
106
+
107
+ MESAS also supports:
108
+
109
+ - **First-order reactions** via ``k1`` and ``C_eq`` parameters
110
+ - **Evapoconcentration** via the ``alpha`` parameter
111
+ - **Multiple solutes** tracked simultaneously
112
+
113
+ Time-varying parameters
114
+ ========================
115
+
116
+ Any SAS function or solute parameter can be made time-varying by
117
+ setting its value to a string that names a column in the input
118
+ DataFrame. For example, setting ``"scale": "S_0"`` in a gamma
119
+ specification causes the scale parameter to be read from the ``"S_0"``
120
+ column at each timestep.
121
+
122
+ Further reading
123
+ ===============
124
+
125
+ - `Harman (2015) <https://doi.org/10.1002/2014WR015707>`_ — Original SAS theory paper
126
+ - `Harman and Xu Fei (2024) <https://gmd.copernicus.org/articles/17/477/2024/>`_ — Unified framework for age and transit time distributions
127
+ - `Benettin et al. (2022) <https://doi.org/10.5194/gmd-15-3881-2022>`_ — MESAS model description paper (GMD)
128
+ - `HydroLearn course <https://edx.hydrolearn.org/courses/course-v1:JHU+570.412+Sp2020>`_ — Free online course on SAS theory
@@ -0,0 +1,80 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+
3
+ import os
4
+ import sys
5
+
6
+ # Make the package importable for autodoc
7
+ sys.path.insert(0, os.path.abspath(".."))
8
+
9
+ # -- Project information -----------------------------------------------------
10
+
11
+ project = "MESAS"
12
+ copyright = "2019–2026, Ciaran J. Harman"
13
+ author = "Ciaran J. Harman"
14
+
15
+ # Pull version from pyproject.toml metadata
16
+ try:
17
+ from importlib.metadata import version as _get_version
18
+
19
+ release = _get_version("mesas")
20
+ except Exception:
21
+ release = "dev"
22
+ version = release
23
+
24
+ # -- General configuration ---------------------------------------------------
25
+
26
+ extensions = [
27
+ "sphinx.ext.autodoc",
28
+ "sphinx.ext.doctest",
29
+ "sphinx.ext.intersphinx",
30
+ "sphinx.ext.mathjax",
31
+ "sphinx.ext.viewcode",
32
+ "sphinx.ext.napoleon",
33
+ "sphinx_copybutton",
34
+ ]
35
+
36
+ templates_path = ["_templates"]
37
+ source_suffix = ".rst"
38
+ master_doc = "index"
39
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
40
+ pygments_style = "sphinx"
41
+
42
+ # -- Autodoc configuration ---------------------------------------------------
43
+
44
+ autodoc_member_order = "bysource"
45
+ autodoc_typehints = "description"
46
+ autodoc_default_options = {
47
+ "members": True,
48
+ "show-inheritance": True,
49
+ }
50
+
51
+ # -- Napoleon (NumPy docstring) configuration --------------------------------
52
+
53
+ napoleon_google_docstring = False
54
+ napoleon_numpy_docstring = True
55
+ napoleon_use_param = True
56
+ napoleon_use_rtype = True
57
+
58
+ # -- Options for HTML output -------------------------------------------------
59
+
60
+ html_theme = "sphinx_rtd_theme"
61
+ html_theme_options = {
62
+ "logo_only": False,
63
+ "prev_next_buttons_location": "bottom",
64
+ "style_nav_header_background": "#1E74AE",
65
+ "collapse_navigation": False,
66
+ "sticky_navigation": True,
67
+ "navigation_depth": 4,
68
+ "includehidden": False,
69
+ "titles_only": False,
70
+ }
71
+ html_static_path = ["_static"]
72
+
73
+ # -- Options for intersphinx -------------------------------------------------
74
+
75
+ intersphinx_mapping = {
76
+ "python": ("https://docs.python.org/3/", None),
77
+ "numpy": ("https://numpy.org/doc/stable/", None),
78
+ "pandas": ("https://pandas.pydata.org/docs/", None),
79
+ "scipy": ("https://docs.scipy.org/doc/scipy/", None),
80
+ }
@@ -0,0 +1,55 @@
1
+ .. _config:
2
+
3
+ =====================
4
+ Configuring the model
5
+ =====================
6
+
7
+ To run `mesas.py` the user must provide some information about how the model is to be configured. First, at least one SAS function must be specified. In addition you may wish to provide information about solutes to be transported through the system, and/or modify the default model options.
8
+
9
+ The recommended way of providing configuration data is in a text file formatted using the `JSON standard <https://www.json.org/json-en.html>`_. Typically this file is called something like ``config.json``. The contents look very much like a python ``dict``, with some differences. A minimal example of a configuration file is a text file containing the following text:
10
+
11
+ .. code-block:: json
12
+
13
+ {
14
+ "sas_specs":{
15
+ "Flux out":{
16
+ "SAS fun":{
17
+ "ST": [0, 100]
18
+ }
19
+ }
20
+ }
21
+ }
22
+
23
+
24
+ This specifies a single uniform SAS function between 0 and 100 associated with the flux named ``"Flux out"``.
25
+
26
+ `mesas.py` looks for three top-level entries in the file:
27
+
28
+ * ``"sas_specs"``: spcification of the SAS functions (see :ref:`sasspec`)
29
+ * ``"solute_parameters"``: information about solutes to be transported through the system (see :ref:`solspec`)
30
+ * ``"options"``: optional arguments for customizing the model run (see :ref:`options`)
31
+
32
+ For more information click the links above. Here is an example of the contents of a ``config.json`` file that uses all three of these top-level fields.
33
+
34
+ .. code-block:: json
35
+
36
+ {
37
+ "sas_specs":{
38
+ "Flux out":{
39
+ "SAS fun":{
40
+ "ST": [0, 100]
41
+ }
42
+ }
43
+ },
44
+
45
+ "solute_parameters":{
46
+ "solute A":{
47
+ "C_old": 0.5
48
+ }
49
+ },
50
+
51
+ "options":{
52
+ "dt": 3600
53
+ }
54
+ }
55
+
Binary file
Binary file
@@ -0,0 +1,6 @@
1
+ SAS Functions
2
+ =============
3
+
4
+ .. automodule:: mesas.sas.functions
5
+ :members:
6
+ :exclude-members: kumaraswamy_gen, kumaraswamy
@@ -0,0 +1,77 @@
1
+ .. MESAS documentation master file, created by sphinx-quickstart on Thu Sep 12 19:57:56 2019. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive.
2
+
3
+ =====
4
+ MESAS
5
+ =====
6
+ Multiscale Estimation of StorAge Selection functions
7
+
8
+
9
+ What are StorAge Selection functions?
10
+ -------------------------------------
11
+
12
+ StorAge Selection is a theoretical framework for modeling transport through control volumes. It is appropriate if you are interested a system that can be treated as a single control volume (or a collection of such), and wish to make minimal assumptions about the internal organization of the transport. SAS assumes that the material leaving a system is some combination of the material that entered at earlier times. This can be useful for constructing simple models of very complicated flow systems, and for inferring the emergent transport properties of a system from tracer data.
13
+
14
+ SAS is a very general framework -- at heart, it is composed of two parts: a way of keeping track of changes in the age structure of the 'population' of fluid parcels in a system, and a rule (or rules) that determines how that age structure changes. By using tracers to investigate what rule best mimics the behaviour of a given system, we can learn important information about that system -- most directly, something about the volume of tracer-transporting fluid that is actively 'turning over'. SAS is a generalization of commonly-used transit time theory to the case where fluxes vary in time, and there may be more than one outflow (e.g. discharge and ET).
15
+
16
+ For more information see the free HydroLearn course: `Tracers and transit times in time-variable hydrologic systems: A gentle introduction to the StorAge Selection (SAS) approach <https://edx.hydrolearn.org/courses/course-v1:JHU+570.412+Sp2020>`_
17
+
18
+ What is mesas.py?
19
+ -----------------
20
+
21
+ The package will eventually include a number of component tools for building SAS models and using them to analyze tracer data.
22
+
23
+ Currently the main repository codebase includes three submodules:
24
+
25
+ mesas.sas
26
+ The main submodule for building and running SAS models
27
+ mesas.utils
28
+ Tools for manipulating SAS model input data and results
29
+ mesas.utils.vis
30
+ Visualization of SAS model results
31
+
32
+ I hope to expand these in the future, and welcome contributors through the `GitHub repository <https://github.com/JH-LandHydroLab/mesas>`_
33
+
34
+ Support, bugs, suggestions, etc.
35
+ --------------------------------
36
+ If you find a bug please open an issue on GitHub here: https://github.com/JH-LandHydroLab/mesas/issues
37
+
38
+ You can also use the issue tracer to make suggestions to improve the code.
39
+
40
+ If you need further help using the code or interpreting the results, please get in touch: charman1 at jhu dot edu
41
+
42
+
43
+ Table of contents
44
+ -----------------
45
+ .. toctree::
46
+ :maxdepth: 2
47
+ :caption: Getting started
48
+
49
+ installation
50
+ quickstart
51
+ concepts
52
+
53
+ .. toctree::
54
+ :maxdepth: 2
55
+ :caption: User guide
56
+
57
+ inputs
58
+ config
59
+ sasspec
60
+ solspec
61
+ options
62
+ results
63
+
64
+ .. toctree::
65
+ :maxdepth: 2
66
+ :caption: Reference
67
+
68
+ functions.rst
69
+ specs.rst
70
+ model.rst
71
+
72
+ Indices and tables
73
+ ==================
74
+
75
+ * :ref:`genindex`
76
+ * :ref:`modindex`
77
+ * :ref:`search`